TangerineDog Posted March 27, 2020 Share Posted March 27, 2020 Can the game crash because a long script is triggered twice in rapid succession? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted March 27, 2020 Share Posted March 27, 2020 Depends on what you mean by "long script". And it depends on what that script may be doing. If a script executing twice back to back causes the game to crash, there is probably something else wrong and that was just the straw that broke the camels back as it were. Not saying that there may not be room for improvement in the script. Just that when papyrus gets overloaded it should cause a stack dump where some things do not get processed like they should. Normally, it would not cause a crash. Link to comment Share on other sites More sharing options...
ReDragon2013 Posted March 27, 2020 Share Posted March 27, 2020 Switch on papyrus logging, inside the game open console "^" and use these commands to control registred updates and current stacks. dpu dpsBethesda coders have written (similiar) it is seriously a problem when two or more events (in the same script for the same object "self") try to run at the same time.Some events like OnHit(), OnTrigger(), ÓnTriggerEnter(), OnUpdate() should be protected with states to avoid overwhelming of script engine. Link to comment Share on other sites More sharing options...
maxarturo Posted March 27, 2020 Share Posted March 27, 2020 (edited) Just to add some more info on the posts made by IsharaMeradin and ReDragon. A script doesn't need to be big in order to cause CTD, it can easily cause it if for example. - If it tries to send an animation to an actor that is dying or it is dead. - If it sends an animation to an actor and at the same time "PushActorAway()", or if the script "Knock Down" the actor and at the same time or before the actor finishes the "Knock Down" animation tries to "PushActorAway()". - If the script is in a "While" loop affecting a specific actor and another one tries to affect the same actor, mostly if the scripts are trying to force the actor to do something or modify his stats simultaneously. This are just a few examples of scripts causing CTD. The examples above were tested to death by me and 80% of the times they do cause CTD, there are also a bunch of others. Always test your script to death and in every possible circumstance !, this is the only way to discover them. Edited March 27, 2020 by maxarturo Link to comment Share on other sites More sharing options...
NexusComa Posted March 27, 2020 Share Posted March 27, 2020 That's why you set flags. Could even use a global for this to control other scripts. int x = 0 ; the control flag event() if(x==0) x=1 bla, bla, bla bla, bla, bla x=0 endifendevent Link to comment Share on other sites More sharing options...
foamyesque Posted March 27, 2020 Share Posted March 27, 2020 (edited) Can the game crash because a long script is triggered twice in rapid succession? It can, but it doesn't have to. Depends a lot on what the scripts are doing and how they're trying to do it. If they're processing at the same time and accessing the same resources, but are each assuming they're the only one doing so, you can get very ugly results. Outright CTDs usually happen when those involve telling the game engine to do something it cannot do. Edited March 27, 2020 by foamyesque Link to comment Share on other sites More sharing options...
Recommended Posts