FireFlickerFlak Posted October 31, 2014 Share Posted October 31, 2014 I recently saw a thread where someone said that the problem with someones script was that it had "nested" function which meant it was not threadsafe. My understanding is that basically different threads are different processing streams and that it is best to keep each thread focused on its own area of the code. I am not sure how this applies to papyrus though. My main concern is that I have a lot of function that I am storing in quest scripts and I am not sure when it is not safe to store function in a quest script and when it is safe. Should I not be storing any functions other than global functions in quest script? Link to comment Share on other sites More sharing options...
ryanshowseason2 Posted October 31, 2014 Share Posted October 31, 2014 The real question is what is calling the functions? Could two or more things be calling it at once? As in if it was a function being called by a spell any number of npcs could cast it at once, this could be a problem since they might be acting on the same data. I am also not well versed in papyrus though. Link to comment Share on other sites More sharing options...
lofgren Posted October 31, 2014 Share Posted October 31, 2014 Start here: http://www.creationkit.com/Threading_Notes_(Papyrus) Link to comment Share on other sites More sharing options...
FireFlickerFlak Posted October 31, 2014 Author Share Posted October 31, 2014 (edited) Most of the scripts are for spells, but each magic effect instance is uniquely generated by the game so the scripts should be fine I think in that case.Either way, isn't it fine for multiple scripts to call the same function at the same time as long as they are not manipulating the same objects at the same time? Or are quest functions not able to be used by more than one source at a time? Edit; Oh, didnt see that link, thanks! Edited October 31, 2014 by FireFlickerFlak Link to comment Share on other sites More sharing options...
lofgren Posted October 31, 2014 Share Posted October 31, 2014 I think you're fine. Where you would run into trouble is if you had a function that referred to an actor or a global variable that had the potential to change between checks. Link to comment Share on other sites More sharing options...
Recommended Posts