Issue Data
|
Issue #26482: defaultOnEnter.psc script issues with trigger enable parent
This script depends on a targetCountTotal that is initialized OnInit().
Unfortunately, it is often used in a trigger that has an enable parent. There seems to be a timing issue, especially with defaultSetStageOnEnter, where OnInit() is not run. This usually leaves targetCountTotal = 0, and the script runs the event/quest, even though the actors are not yet present. They deliver their lines from where they are currently walking, and/or even though the player is not present (or close enough to hear them). Also, targetCountTotal is never initialized to 0. As a matter of good programming, assuming that OnInit() will run with 0 starting values might be a bad idea, especially as enable parents can toggle during the course of the game. This was a bear to debug. Because the number of actors is known at the time of setting properties, the Total could also be set by hand. But that would be a lot of triggers, and highly invasive to fix! Instead, we could re-write the script to set a separate flag (unused/unknown/present/absent) per actor/alias, and trigger when they are all present or unused. So far, I've not detected the problem in any other case than the trigger having an enable parent. However, that doesn't mean it is the only failure mode. This really isn't a good design. |
Related Issues: 30480
This script is in use on so many objects in so many places and in so many different ways that it cannot possibly be as broken as described or people would have noticed this YEARS ago.
Showing Comments 1 - 1 of 1