Page 1 of 1

Clarification on eventGameInit / rules.js

Posted: 25 Oct 2012, 05:37
by aubergine
rules.js applies the baseType setting, during eventGameInit()

If a game is loaded, does eventGameInit() get called again?

If it does, how come there isn't a mass deletion of player-built structures due to the baseType setting being re-applied?

Re: @Per: Clarification on eventGameInit / rules.js

Posted: 25 Oct 2012, 13:38
by Per
eventGameInit() is only run on initial game startup, and not on game load.

Re: @Per: Clarification on eventGameInit / rules.js

Posted: 25 Oct 2012, 14:13
by aubergine
Ah, that's interesting. Is the same true for eventStartLevel()?

Re: @Per: Clarification on eventGameInit / rules.js

Posted: 25 Oct 2012, 23:10
by aubergine
Also, if I setTimer() or queue() in eventGameInit() is there a possibility that those will get triggered before eventStartLevel() or do timed/queued function calls get held until after eventStartLevel()?

Re: @Per: Clarification on eventGameInit / rules.js

Posted: 26 Oct 2012, 00:04
by Per
eventStartLevel() is also not called on load.

Timers will not trigger between the two.

Re: @Per: Clarification on eventGameInit / rules.js

Posted: 26 Oct 2012, 00:12
by aubergine
Ah, most awesome! :)

*goes off to code an eventGameLoaded() add-on*