MSFD Safely starting global scripts- avoiding the main script
With the expansion, this issue is a problem no more – just add the script you want to start running to the list of "Start Scripts" by selecting Edit Start Scripts from the Gameplay menu. This script will now be automatically started when a game is loaded, just like the main script. For those without Tribunal/Bloodmoon:
Many modders like to add a line to the main script (the only script that is started by default when a new game is started, and always runs) to make sure a global script is started that is essential to their mod. For example:
StartScript "My_Script"
While this works, it might easily cause conflicts with mods that used the same approach – because only the changes of the last loaded plugin will be active in the game. There are some good alternatives to using the main script. Putting an (invisible) activator in the Seyda Neen census office with the following attached script will make sure the script is started during character creation (assuming no alternative char gen mods are used alongside your mod):
Begin Script_launcher
If ( ScriptRunning, My_Script == 0 )
StartScript, My_Script
; MessageBox "MyScript was activated" ; tell the player if you like
endif
End
To make sure a global script is started in an already running game you can use a similar method, and place activators in commonly visited cells. If you have one in Balmora, Vivec, Sadrith Mora, Dagon Fel, and Caldera and maybe the PC strongholds, I am sure it won't take long until the script is running. You can also use an object that is required for your mod anyway to start it. E.g. for Indestructibles excellent Bank mod, I made myself a version that attaches the above script to the banner of the bank and starts the "interest" script. That makes sure that that script is running before the PC ever sets foot inside the bank.