[0.7.5] Script bug - gettile inside of onchunkgenerated

This subforum contains all the issues which we already resolved.
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

[0.7.5] Script bug - gettile inside of onchunkgenerated

Post 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
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me :)
Or drop into #factorio on irc.esper.net

slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: [0.7.5] Script bug - gettile inside of onchunkgenerated

Post 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).

User avatar
Dysoch
Filter Inserter
Filter Inserter
Posts: 445
Joined: Fri Oct 18, 2013 2:27 pm
Contact:

Re: [0.7.5] Script bug - gettile inside of onchunkgenerated

Post 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!
Creator of:
- DyTech
- DyWorld
- DyWorld-Dynamics
- DyWorld-Dynamics 2
Active since Factorio 0.6

Post Reply

Return to “Resolved Problems and Bugs”