custom global function tied up for each use?

Post » Wed Feb 01, 2017 10:43 pm

Will accessing a function from another script tie up that function until it is done for each script that calls it?




in other words...



is it better to repeat the same code in various actor magic scripts or have all those magic scripts all access the same function form the same quest script?



By "better" I mean what gets ALL of the scripts done all together as fast as possible when using the same lines of code such as:



Debug.SendAnimationEvent(Actor2, "Sprintstop")


Actor2.addtodaction(knockeddown)

Actor1.Pushactoraway(Actor2, 1.0)

User avatar
Amy Cooper
 
Posts: 3400
Joined: Thu Feb 01, 2007 2:38 am

Post » Thu Feb 02, 2017 12:19 am

I know in multithreading it doesn't get held up because you're inheriting the function through a separate script/thread.



i have no idea if papyrus uses some sort of semaphore model or first come first serve, i would imagine that it probably would hold it up if you were waiting on it mid function. but that's just a wild guess.

User avatar
Zosia Cetnar
 
Posts: 3476
Joined: Thu Aug 03, 2006 6:35 am

Post » Wed Feb 01, 2017 3:15 pm


Thanks marthgun!



Unless our friendly neighborhood Papyrus creator pops in to help (I still see him in here sometimes) or one of the papyrus gurus I guess I have to go with your guess as it is way more educated than my own.



On the other hand my guess was also that it would get held up and it is better to have it duplicated in the multiple scripts I need it in unless I am sure the functions I use are the kind that do not lock down while working (like math functions).

User avatar
Angel Torres
 
Posts: 3553
Joined: Thu Oct 25, 2007 7:08 am


Return to V - Skyrim