Jump to content

[LE] Script crash question


Recommended Posts

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

Switch on papyrus logging, inside the game open console "^" and use these commands to control registred updates and current stacks.

dpu
dps

Bethesda 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

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 by maxarturo
Link to comment
Share on other sites

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 by foamyesque
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...