//--------------------------------------------------------------------------------------------------// Global Variables//--------------------------------------------------------------------------------------------------intgv_someVariable;voidInitGlobals(){gv_someVariable=1;}//--------------------------------------------------------------------------------------------------// Trigger Initialization//--------------------------------------------------------------------------------------------------voidInitTriggers(){gt_someTrigger_Init();}//--------------------------------------------------------------------------------------------------// Map Initialization//--------------------------------------------------------------------------------------------------voidInitMap(){InitGlobals();InitTriggers();}
There you go :)
Copy-pasta directly from an empty map's script. That's all automatically created. InitMap() is called at map initialization (it doesn't need an event, it's always called automatically. It's the entry point of all triggers). InitGlobals() initializes global vars. And InitTriggers() - you guessed it - initializes triggers.
If you set a variable after initializing it it won't be called at map init of course.
You're right with your point, though. Usually I limit myself to creating triggers in initializers. Initializers are called even before Map Initialization events, and I know from experience that some things screw up.
When you run something at 1 second elapsed time then you actually do something at map init, too.
The GUI trigger automatically adds a piece of script (almost the same as an initializer fuzzy was talking about) that creates your trigger at map init.
All triggers are created at map init, no matter what their events are. Also all variable initialization is done at map init.
There you go :)
Copy-pasta directly from an empty map's script. That's all automatically created. InitMap() is called at map initialization (it doesn't need an event, it's always called automatically. It's the entry point of all triggers). InitGlobals() initializes global vars. And InitTriggers() - you guessed it - initializes triggers.
If you set a variable after initializing it it won't be called at map init of course.
You're right with your point, though. Usually I limit myself to creating triggers in initializers. Initializers are called even before Map Initialization events, and I know from experience that some things screw up.
@SouLCarveRR: Go
When you run something at 1 second elapsed time then you actually do something at map init, too.
The GUI trigger automatically adds a piece of script (almost the same as an initializer fuzzy was talking about) that creates your trigger at map init.
All triggers are created at map init, no matter what their events are. Also all variable initialization is done at map init.