init.lua is actually the first lua file loaded. I've had my log/bootstrap loading there since r182, but haven't shifted my settings system to that point since I still have a few dependencies on later scripts that I need to break.
But thanks for bringing it up, I can at least post the (rough) execution flow for exe vs scripts I've been meaning to for a while.
noting where exe is directly loading a script (as opposed to the loading scripts loading others), and the return to exe execution:
exe > init.lua > exe
exe > start.lua > Tpp.lua > TppDefine.lua >
This is where things are a bit fuzzy, even though execution isn't fully back to the exe because start.lua isn't done, Tpp.lua is done at this point and the exe loads all scripts listed in TppDefine.requires table in order.
I'm guessing (I should actually test to confirm) that Script.LoadLibraryAsync loads all of a requires table on the module it's loaded.
> TppVarInit.StartInitMission > Mission.LoadMission 1/init mission > exe (start.lua done)
exe various mission loady stuff for 1/init mission
Mission.LoadMission just seems to be and indicator from script to exe that a mission should be loaded, the exe only starts loading once the current lua thread is done/execution is returned to exe.
The exe mission load execution is roughly:
exe > TppMission.GetMissionPackagePath > exe
In exe : load ScripBlock lua scripts defined in the fox2 files in the fpk/ds in the missionpackagepath list.
exe > mission_main.OnAllocate (from the mission pack returned by GetMissionPackagePath) > TppMain.OnAllocate > exe
exe > mission_main.OnInit > TppMain.OnInit> exe
init.lua is actually the first lua file loaded. I've had my log/bootstrap loading there since r182, but haven't shifted my settings system to that point since I still have a few dependencies on later scripts that I need to break.
But thanks for bringing it up, I can at least post a (rough) execution flow for exe vs scripts, noting where exe is directly loading a script (as opposed to the loading scripts loading others), and the return to exe execution:
exe > init.lua > exe
exe > start.lua > Tpp.lua > TppDefine.lua >
This is where things are a bit fuzzy, even though execution isn't fully back to the exe because start.lua isn't done, Tpp.lua is done at this point and the exe loads all scripts listed in TppDefine.requires table in order.
I'm guessing (I should actually test to confirm) that Script.LoadLibraryAsync loads all of a requires table on the module it's loaded.
> TppVarInit.StartInitMission > Mission.LoadMission 1/init mission > exe (start.lua done)
exe various mission loady stuff for 1/init mission
Mission.LoadMission seems to be script > exe indicator that a mission should be loaded, the exe only starts loading once the current lua thread is done/execution is returned to exe.
Engine mission load execution is roughly:
exe > TppMission.GetMissionPackagePath > exe
In exe : load ScripBlock lua scripts defined in the fox2 files in the fpk/ds in the missionpackagepath list.
exe > mission_main.OnAllocate (from the mission pack returned by GetMissionPackagePath) > TppMain.OnAllocate > exe
exe > mission_main.OnInit > TppMain.OnInit> exe
Each game frame:
exe > mission_main.OnUpdate > TppMain.OnUpdate > exe
Edit: Might as well dump my log with my various logging turned on from session start to continued to acc even though there's a bunch of IH specific stuff mixed in:
https://mega.nz/#!7B0T1Rob!mvu2ePcBV_ay ... 5n3vuAF70k
Most of this logging is manual, need to run a proper debug trace at some point, but the potential brutality of output on top of not having io write append has held me off.