-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep main script to be executed before custom scripts. #235
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my gut feeling is that this is going to blow up, hoping that I'm wrong
This reflects exactly how script queue looks on startup in CLEO4. Hm after more thinking I'm not sure how and when scripts attached to map objects are spawned (like vending machines). This still needs to be checked. |
they load when the object is spawned on the map, object handle is passed to the new script |
cad89e8
to
800d78d
Compare
Ok in case of loading save game with original main scm it starts with multiple scripts already on list. |
@@ -941,7 +941,22 @@ namespace CLEO | |||
|
|||
GetInstance().ModuleSystem.LoadCleoModules(); | |||
LoadState(GetInstance().saveSlot); | |||
|
|||
// keep already loaded scripts at front of processing queue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it important to execute game scripts before custom ones? what does it solve?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handling save game pickup is done in main script. So any script that want to utilize 03D9
HAS_SAVE_GAME_FINISHED needs to be executed after it.
Due to multiple reload of scripts on game start it was already like that in CLEO4. Game adds any new script at head of the queue (which is weird), and game is reset few times on each session start.
Fix to keep scripts execution order same as in CLEO4. Changed due to fact the multiple scripts initialization behavior was fixed.
Tested with few custom scripts, main, mission and thread from main running at once.
Fixes #60