the Sim Settlements forums!

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Management Quest Template

Scripts Management Quest Template Kinggath

This is the template script I use whenever I start building a new management script to handle various things.

It sets itself up to run startup code every time the player loads their game, and if you update the version number variable, it will run any code you place in the InstallModChanges function if it's detected that the player was using a previous version of your mod.

This ensures you can make changes to existing saves safely, so your players don't have to do clean installs each time they update your mod if you made a major adjustment.

The EditLock is something you can use to prevent race conditions. Running it at the start of a function will loop the code until the resource is free. That way you don't end up with two different calls to your quest overriding the same variables. After using EditLock, be sure to set bEditLock = false at the end of that function (or anywhere you return early).

The code will auto-clear the editlock when the player starts the game to make sure it doesn't ever get stuck permanently (which can happen if the engine fails to set the var due to a script crash or if YOU fail to set the var in your code...)
Author
GA_Darkerside
Downloads
243
Views
246
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from GA_Darkerside

Top