More information can be found on the Papyrus Threading Notes web page. Script instances are generally thread safe. No functions or events can run and no properties can be accessed concurrently. However, there is still a need for mutexes. While code cannot run concurrently a function may begin to execute and then perform a remote function call, allowing other code in the script to run before the function returns to what is was doing. Note that even functions such as Debug.Trace() will potentially unlock thread execution. If you have a need for a section of code to run to completion without other code interrupting it use mutexes. I will not add mutex code to DFW utility script as it does not make sense to unlock thread execution in order to lock thread execution. In general thread execution should be unlocked as infrequently as possible. You can add these functions to a private function section of your own script and use them. If adding to an already started game you will need to initialize global variables in the script's upgrade section. A reference to the Devious Framework Util quest script. Int Function iMutexCreate(String szName, Int iTimeoutMs=1000) Create an initial mutex for protecting the mutex list. Lock the mutex protecting the mutex list to protect creating two at once. If (0 iMutex) || (_iMutexNext = iTimeoutMs) AddXxxToArray() can unlock the thread allowing this function to run again. The ZaZ Animation Pack has a number of features that help co-ordinate mods keeping track of player slavery. There are three that I have learned about and I will describe them in this section with sample code. Whether there are more or not, I am not sure. Note: From what I understand there are two main ZaZ Animation Pack files for working with the player as a slave, zbfSlaveControl.psc, and zbfSlaveActions.psc. The slave control file focuses on identifying slaves and masters while the slave action file is more related to animations and applying restraints and devices. Note: If using the Devious Framework mod it will attempt to perform this registration automatically.
2 Comments
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |