Page 1 of 1
[0.7.5] Script bug - gettile inside of onchunkgenerated
Posted: Mon Nov 04, 2013 9:53 pm
by FreeER
trying to call game.gettile().name inside of onchunkgenerated leads to a crash to desktop, though you can call game.gettile() without it crashing. Not sure if it's only when starting a new game or if it is because of how events are handled though.
Also, not a bug but is there a way to toggle the minimap? tried to use game.disableminimap() but obviously that didn't work lol
Re: [0.7.5] Script bug - gettile inside of onchunkgenerated
Posted: Tue Nov 05, 2013 11:01 am
by slpwnd
Thanks for the report. At the moment manipulation with luatile will crash if the corresponding tile hasn't been generated yet. It shouldn't matter whether this is in onchunkgenerated callback (called after the tiles and entities are generated) or elsewhere. Obviously the game shouldn't crash:) I will put a "valid" attribute to the lua tile that will basically say whether the tile has been generated. And manipulating invalid tile will cause a script to stop (not crash). This will be done for 0.8.
As for the minimap. No it cannot be toggled from the script at the moment. The game.disableminimap() is used for the scenarios where minimap doesn't have sense, then even if the minimap is enabled in the options it will not be shown (but it doesn't change the settings).
Re: [0.7.5] Script bug - gettile inside of onchunkgenerated
Posted: Tue Nov 05, 2013 11:53 am
by Dysoch
As for the minimap. No it cannot be toggled from the script at the moment. The game.disableminimap() is used for the scenarios where minimap doesn't have sense, then even if the minimap is enabled in the options it will not be shown (but it doesn't change the settings).
Anyway you can add a toggle to next version? Want to add toggle minimap off when no radar or not enough energy in radar.
Part of the code is already in place, hate to see it go to waste!