What are the differences between these two? I assume GameStart means Frame 1 now?
[EDIT] I just tested with World Builder, and seems to speed it up by a teeny amount. So... is it safe to do synced stuff like Unit creation during Preload, or will that desync people in MP? [/EDIT]
GamePreload vs. GameStart
Moderator: Moderators
Re: GamePreload vs. GameStart
Not much, just the moment when they run.
I found that:
I found that:
Code: Select all
function gadget:Initialize()
-- This is executed first, just after gadget is loaded
end
function gadget:GamePreload()
-- This is executed BEFORE headquarters / commander is spawned
end
function gadget:GameStart()
-- This is executed AFTER headquarters / commander is spawned
end
Re: GamePreload vs. GameStart
GamePreload is pretty useless, it gets called while the LoadingScreen is visible. And in the case the widget/gadget is activated in that phase, it is called after Initialize() (if you enable the widget in a running game GamePreload won't get called again).
And GameStart is pretty similar to GameFrame == 1.
And GameStart is pretty similar to GameFrame == 1.
Re: GamePreload vs. GameStart
OK, that's pretty much what I was thinking.
Loading before the Commander is pretty important.
Loading before the Commander is pretty important.