why does onload fire every few minutes, but not at the start

Place to get help with not working mods / modding interface.
sparr
Smart Inserter
Smart Inserter
Posts: 1463
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

why does onload fire every few minutes, but not at the start

Post by sparr »

Code: Select all

game.onload (function()
        game.player.print("Hello World")
end)
This is my test case. I think it's firing every time the game autosaves. That's about the right frequency to match how often I see the message. What's wrong here?
drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: why does onload fire every few minutes, but not at the s

Post by drs9999 »

Yes every time the game is saved (by user or autosave) the game is loaded again after that. When starting a new game the oninit-event is called
sparr
Smart Inserter
Smart Inserter
Posts: 1463
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: why does onload fire every few minutes, but not at the s

Post by sparr »

But it's NOT firing when I load a saved game manually.
Post Reply

Return to “Modding help”