kdau on 26/7/2013 at 20:38
Quote Posted by sNeaksieGarrett
2.) When the AI dies, even with
TWTrapAIBreathStopOnKO="True"; the breath sticks around a bit longer than it should and you can see it appear in the wrong spot. I know you mentioned in the documentation that when they get KO'd, the particles can emit in the wrong spot, but I thought turning this on would completely eliminate it, however it still happens for like a second when the AI falls to the ground.
Unfortunately, the notice to scripts of an AI's braindeath doesn't come until after the crumpling motion has finished playing. (This is also why AIs take a few extra seconds to stop attacking dead opponents.) I don't think there's any reliable way of responding earlier than that. (One could theoretically change the gamesys to send the Knockout and KOGas stims to scripts, but there have been prior discussions about those being unreliable indicators.)
The Watcher on 26/7/2013 at 21:21
Quote Posted by sNeaksieGarrett
1.) When the AI detects Garrett his breath occurs more frequently, but when he returns back to his patrol, his breath is permanently in a faster state than it was before having detected Garrett.
Well, the breathing rate is changed when the AI's alertness changes. I'll do some checking; I've also realised I didn't stick a debug message in there, so there's no monolog update when it changes, I'll see about fixing that.
Quote Posted by sNeaksieGarrett
2.) When the AI dies, even with
TWTrapAIBreathStopOnKO="True"; the breath sticks around a bit longer than it should and you can see it appear in the wrong spot.
As kdau says, that's an issue with the way the engine notifies of brain death (specifically, the script only gets the AIModeChange message sent to it after the crumple has completed, potentially a little after that point). That said, the 'ShutUpYerDead" script (that gets added when the knocked out metaprop is added) sends a "IgnorePotion" message to the AI on knockout may be the answer. I will investigate and see about an update later.
The Watcher on 26/7/2013 at 21:54
Updated to v.2.0.6. It looks like the IgnorePotion message is a good indicator for knockout, so I've set up the script to use that (and the AIModeChange message too, just in case) to stop the breath clouds when the AI is knocked out and TWTrapAIBreathStopOnKO is true. In testing, the instant you knock the AI out, the breath clouds stop, so hopefully that'll do what you need.
As far as the rate issue is concerned, it does reduce - it just takes a lot longer than you might think. If you set TWTrapAIBreathDebug=true, alert the AI so that the breathing rate increases, and leave it for several minutes, you'll see the rate drop back down again. It's really just how long the AI stays at the higher alertness level that is the issue.
kdau on 26/7/2013 at 22:04
Quote Posted by The Watcher
...It looks like the IgnorePotion message is a good indicator for knockout...
Thanks for finding that! I'll start using it too.
sNeaksieGarrett on 27/7/2013 at 00:02
Ah okay, thanks The Watcher.;) I will download the new package.
I thought I saw it decrease after a bit while testing your demo, but when I looked at it in my mission and watched the guard it didn't seem to reduce. (Or most probably I didn't wait long enough.) Good to know though regardless. To be honest though, it'd be great if it returned to normal as soon as possible when he returns to his patrol. I dunno, maybe it's more realistic to have his breath higher because he was just running around moments earlier, but it looks kinda steam puffy to me when it goes that quick. (Ya know, more like a machine emitting something than a person breathing.)
Sorry, I know I'm being a PITA. I guess it's your call, after all you are writing the script.:) Anyways, that's just me, other people may feel differently or not be as picky as I am being.
Also, it's probably been said enough already but I want to thank you (and you too kdau) for writing scripts for us FM authors. It's great that we have folks like you extending/enhancing the life of the Thief games.
Update/edit: Works just fine when I knock him out.
sNeaksieGarrett on 27/7/2013 at 00:28
Okay, I waited for a few minutes after he went back on his patrol, and mono reports an awareness change from 2 to 1 and the new rate is set to 1500. (which previously had change from 3 to 2 with rate 1000.) After that, I don't see any new rate changes. Shouldn't it return to 3000? Am I not waiting long enough?
The Watcher on 27/7/2013 at 10:04
It should drop to the base rate eventually, as far as I know, but it could take a long time. Perhaps a better option is for me to replace the (
https://github.com/TheWatcher/twscript/blob/master/twscript/TWTrapAIBreath.cpp#L339) simple division calculation currently used with separate per-level rate controls, with Rate0 being taken from the tweq as currently, and the rest auto-calculated unless set in the design note:
Code:
TWTrapAIBreathRate1 = 3000; // Rate when alertness is Low (1)
TWTrapAIBreathRate2 = 2300; // Rate when alertness is Medium (2)
TWTrapAIBreathRate3 = 1200; // Rate when alertness is High (3)
As for the 'dropping the rate down as soon as the AI goes back on patrol', that's a lot trickier as no messages get sent to the AI when it switches from investigation back to patrol. There is an 'AIInvest' link added to the AI when it is investigating/attacking and I think that could potentially be used as a means of indicating whether to use the current AI alertness or one level below it (ie: if the AI is on high alert, and has an AIInvest link, use the High breathing rate, if the AI is on high but does not have an AIInvest link, use Medium instead). I'll fiddle with it and see what can be done.
sNeaksieGarrett on 27/7/2013 at 22:26
Great, thanks. If you can't get the breathing rate to return quickly after the guard goes back to patrol, or it turns out to be a large pain, don't worry about it. Now, it definitely should return back to 3000 eventually though. That new way you suggested for the rates instead of the division sounds good to me.
The Watcher on 28/7/2013 at 22:24
Okay, updated to 2.0.7 - I've made a Somewhat Significant change, in that the initial value you set for the Flicker Tweq is ignored (you still need the flicker tweq as specified in the instructions, but the rate you set is not used). Instead, it has been replaced by four new parameters (all of which are optional and fall back on defaults):
* TWTrapAIBreathRate0 - replaces the flicker tweq rate as the base breathing rate, defaults to 3000 if you do not set it.
* TWTrapAIBreathRate1 - sets the breathing rate when the AI is at alertness 1 (low), defaults to the value set for Rate0.
* TWTrapAIBreathRate2 - sets the breathing rate when the AI is at alertness 2 (medium), defaults to the value set for Rate0 divided by 2.
* TWTrapAIBreathRate3 - sets the breathing rate when the AI is at alertness 3 (high), defaults to the value set for Rate0 divided by 3.
In addition to these new settings, if the AI is at high alertness (so it would normally used Rate3), but is not actively searching for, pursuing, or attacking the player, the script will use the Rate2 breathing rate instead. This means that, if a guard is alerted, once it finishes searching and returns to patrol, the breathing rate will drop to the medium rate even if the AI's alertness is high.
LarryG on 28/7/2013 at 23:33
:thumb::thumb::thumb::thumb::thumb: