I've used lua commands in-game to change a bunch of tiles from water to grass but the maps (the minimap and the "M" overview map) do not reflect the changes. I've tried saving the game, restarting Factorio and loading the game but it still doesn't refresh the maps.
Is it possible?
How to update the map after modifying the terrain?
-
- Inserter
- Posts: 23
- Joined: Mon Aug 11, 2014 1:34 pm
- Contact:
Re: How to update the map after modifying the terrain?
I'd think that game.player.force.chart(boundingbox_to_chart) would work (though I haven't had to do this myself), see Wiki Lua/Force, well the wiki doesn't actually have much more to say for that command but...
-
- Inserter
- Posts: 23
- Joined: Mon Aug 11, 2014 1:34 pm
- Contact:
Re: How to update the map after modifying the terrain?
Thanks. I'll test it ASAP and see if it does work.
-
- Inserter
- Posts: 23
- Joined: Mon Aug 11, 2014 1:34 pm
- Contact:
Re: How to update the map after modifying the terrain?
It doesn't work. Console says "chart" expected a table but got nil instead.
Re: How to update the map after modifying the terrain?
Did you give it a bounding box?
I imagine it's looking for something like [s](-500, 500, -500, 500);[/s] a table of coordinates.
E: I should bother learning lua at some point.
I imagine it's looking for something like [s](-500, 500, -500, 500);[/s] a table of coordinates.
E: I should bother learning lua at some point.
Last edited by n9103 on Mon Sep 15, 2014 1:10 am, edited 2 times in total.
Re: How to update the map after modifying the terrain?
chart would need to be called with a valid bounding box (nil means it got something with a value equivalent to "no real value here"), I used boundingbox_to_chart as a placeholder (sorry for not making that obvious). I usually use a function like thisVBMeireles wrote:It doesn't work. Console says "chart" expected a table but got nil instead.
Code: Select all
function getbb(position, radius) return {{position.x-radius, position.y-radius}, {position.x+radius, position.y+radius}} end
to chart a box 20 wide by 20 tall (10 in each direction) centered around the player. Or you could manually create the bounding box as {{game.player.position.x-10, game.player.position.y-10},{game.player.position.x+10, game.player.position.y+10}} but... that's very annoying in my opinion especially if I need more than one bounding box .
-
- Inserter
- Posts: 23
- Joined: Mon Aug 11, 2014 1:34 pm
- Contact:
Re: How to update the map after modifying the terrain?
Awesome. I'll try it with the proper input next time.