R Soul on 12/12/2013 at 00:51
I have some condition where a conv is triggered, and I'd like the AI (a guard) to abort the conv and become alert, including searching, if he sees a certain object. The exact trigger doesn't matter, for I can fake it if necessary, but seeing the object would be ideal. The conv is a simple set of steps (goto, play motion etc), but the guard doesn't behave in a way that makes sense to me.
The situation is that the player can take something from a chest, and I want the AI to be alert if the chest is left open.
If I try a 'MissingLoot' object, the guard plays the 'foundmissing' concept, but he carries on with some conv steps, and stops after a couple (face angle, goto object). There are a few more steps to perform, but the guard just stops. He's fully active, responding to me when I turn on AI awareness, or launch a noisemaker etc.
Another method I tried was to have a 'major anomaly' schema played. E.g. sg1diec, sg1atn, sg1lar etc. The guard reacts for a moment (playing the 'recoil' motion), but then the conv continues until the goto step mentioned above.
I even tried making a Good, non-hostile AI who uses an alert response to delete himself after a couple of seconds. The idea being that once the guard sees him, he'll then lose him and go into search mode. When the good AI vanishes, I can see that the conv has aborted properly but the guard immediately goes back to his normal patrol.
It seems that pseudoscripts do not like being interrupted by other pseudoscripts, so can anyone think of a way to make the guard react by doing a proper search?
darthsLair on 12/12/2013 at 02:12
Are you removing the aiconversationactor link ? If the link is removed, then the conversation should end. I haven't had any problems with what you describe using this method. When the conversation is interrupted, then it should end. Lgs does this, is where I learned it. I never noticed the conversation continuing in the om's either.
Example:
Step 00
Conversation Action 0 Remove link flavor
Argument1 AiConversationActor
Argument2 JohnDoeActor
Argument3 JohnDoeConv
I use this too:
Step 00
Conversation Action 1 Remove link flavor
Argument1 Control Device
Argument2 JohnDoeConv
Argument3 Button
R Soul on 12/12/2013 at 02:54
I'm afraid that didn't work. I checked with game_mode_backup at 0 and the link is being removed, but the results are no different. I noticed that it's the current step that finishes, so maybe AI makes a note of all actions for the current step, like copying data to the clipboard. I had to use step 01 to get all the actions in, but I can use custom scripts to handle the last few actions, so maybe the conv will release the AI.
Yandros on 12/12/2013 at 03:36
I was going to recommend a separate conv object for each step, but it sounds like you're about there. I've definitely seen pseudoscripts interfering with one another before. I believe an AI will fail to begin a conversation if he's in the middle of an AIWO script, for example (which has no abort conditions you can set).
R Soul on 12/12/2013 at 14:42
I tried whittling the conv down to one step, and for good measure, using the AIWatchObj link to remove the AIConversationActor link. Unfortunately it made no difference, but at least it gets me out of having to set up one conv for each step.
When setting up some previous convs in this mission I found the best way to end one conv and start another is for the first one to trigger some kind of timer (with a short delay) so the first conv can finish before the second is triggered.
R Soul on 13/12/2013 at 00:39
Double post and proud!
Things have improved somewhat. I'm now using an alarm whose schema plays a silent wav file. I've edited the archetype and added Schema > Attenuation Factor: 0.2 to limit the distance the sound can travel.
Without the existing conv I could use AIWatchObj, but I had to do things differently. I use TrigRoomObject so the guard triggers a RevertTrap when he enters the room. When the chest is open, a CD link is added from the RevertTrap to the alarm. And it's removed if the chest is closed. The RevertTrap has TrapControlFlags: NoOff so it won't turn on the alarm if the guard leaves the room. In other words the alarm is turned off after 10 seconds, unless the guard leaves the room and then comes back in, in which case he will be alert for a bit longer.
I can detect whether or not the chest is open using NVTweqMessages, which controls an NVRelayTrap. NVLinkBuilder is used for the links for the alarm.
But there's a snag. The conv situation is more complex than I let on, because it didn't seem necessary to go into much detail.
When the door is open, the guard frobs a button (via AIWatchObj) to begin the conv, but this is only the first one. The last steps change the button's CD link so it then goes to conv2. Conv2 finishes by setting things up for conv3.
conv1: Guard goes in, looks around, then leaves and closes the door.
conv2: Same, but the AI makes a comment while looking.
conv3: Same as conv2, but the AI stays in the room, guarding the chest.
That's if the chest is closed. This is where things become odd. When the chest is open, conv1 gets interrupted properly. If the chest is open when conv2 is played, the conv finishes before the guard starts searching. The same applies for conv3, though that's not too bad because it sets the guard's new idling origin to keep him in the room. But why would only the first conv be interrupted properly? All three have similar actions (goto, frob etc).
I've tried having each of the other two convs triggered first, but they still insist on finishing.
It might not be too bad. I see it as an error because it's not what I designed, but players may see it as the guard seeing something odd that only registers a few seconds later.
john9818a on 14/12/2013 at 16:11
Just a thought, what if you made two conversations, one triggered by an event and the chest closed, and the other triggered by the event and chest open? This way you can control how the guard behaves in each scenario.