LarryG on 22/9/2013 at 02:02
Quote:
CameraAlert
gen.osm 2
The different alert states of a camera are determined by a model tweq. On Alertness, the Shape\Model Name will be set to the appropriate value from Tweq\Models, unless the object has the meta-property M-AI-Stasis. TurnOn and TurnOff messages are sent along ControlDevice links when entering or leaving full alert. A TurnOff message is relayed when Slain. A mysterious CUSIC message is also sent. On TurnOff, the meta-property M-AI-Stasis is added to the object, the property AI\State\Current mode is set to Asleep, and AI\State\Current alertness is set to High. Any AIAwareness links are also deleted. On TurnOn, the mode is set to Normal and M-AI-Stasis is removed.
This script has a bug. While a camera is at full alert, it is supposed to check every 2 seconds if the time since last contact, as specified by AIAwareness links, is greater than the time in Script\Timing, and remove the link if it is. However, instead of checking every 2 seconds, the Timer is set for the number of seconds as the object ID.I haven't found that anyone has tackled this bug (emphasis mine). Perhaps a rewrite of this script using a modern framework is in order. Any takers?
EmperorSteele on 22/9/2013 at 02:29
...Ssssooo, what's that mean? That every 2 seconds, it's supposed to check and make sure it can still see you, and go into a lesser alert state if it doesn't, but instead just stays on alert 3 forever?
Yandros on 22/9/2013 at 02:55
Since most object numbers are in the range of 1-4000, and the Script > Timing property is in milliseconds, I don't imagine fixing this would make much difference in most cases. The exception being when an author wants to force a camera to stay alerted much longer than a few seconds since last seeing the player.
kdau on 22/9/2013 at 05:23
Two things to clarify: first, Telliamed's description is correct that CameraAlert reads the Script→Timing property in seconds, not milliseconds, so a high-numbered object might not have this check performed for over an hour. (The Timing property is extraordinarily inconsistent among the stock scripts, variously representing milliseconds, seconds, minutes, and percentages.)
Second, however, is that the camera (like any AI) still manages to stand down to its "minimum relax after peak" level (which is 0/None for cameras), in this case after about 30 seconds. The AIAwareness link to the player is still present, but this is true for any AI that has seen the player or any other AI in the semi-recent past, and it doesn't guarantee any alert level. The only thing accomplished by deleting the link early would be to have the camera stand down from alert almost immediately after the player is out of sight. That isn't the experience we're used to with the game.
My guess would be that the bug was never corrected because LGS decided against the originally intended behavior. Certainly someone would have investigated it if they actually wanted cameras to forget the player that quickly. Any camera with an object number over 30 would not be affected either way, so it's likely that no OM ever triggered this. If anything, we should probably look for a way to disable the original timer behavior so that low-object-numbered cameras don't stand down too soon.
As for a rewrite, I would consider it dubious for a script dealing with complex AI behaviors. I personally lack Tom's reverse-engineering skills, but extensive testing would be needed even with a much more detailed description of the original script's actions. If this particular bug is the only issue, and the two-second checks are really desired, it would be safer just to have some additional script generate the appropriate Timer message (timer name "Update") every two seconds (while at high alert) and let the original handle it. Trying to disable the timer on the original script would take some creative scheming, but that might be possible.