guard stucks on his patrol. How to avoid? - by schleicher
schleicher on 13/10/2015 at 20:46
Hi
I have a problem with a patrol: The route of a guard leads him
amongst others into a locked room. The key for that door is on
his belt. His patrol is set to "random".
But since I stole his key, he stucks, because he cannot open the
door. He goes as long as the next randomly choosed TrolPt is not
the one in the locked room. Otherwise he stucks on his current
position.
How can I achieve, that he targets the rest of not blocked TrolPts ?
Yandros on 13/10/2015 at 21:46
There's no simple solution. Here are some options.
1. Give him another copy of the key and link him to it via Contains, but don't set it to his belt. The player won't be able to steal it and he will continue to be able to go through the door even if they steal the key on his belt. That's not realistic, but it's a simple solution that avoids his patrol halting.
2. Have a second patrol route similar to the original, but which doesn't include the TrolPt inside the locked room. When the key is taken off his belt, you could change his patrol to the alternate route.
Someone else may know of a more clever or elegant way around this, but if it were me I'd do #2.
LarryG on 13/10/2015 at 21:48
One solution is to give him a second key to the room which is not pickable. That doesn't do exactly what you want, but the guard will no longer get stuck on the door. (Edit: Yandros beat me to it)
There's probably some clever scripting approach which can be used to remove the trollpt in the locked room from the chain of trollpts, probably involving multiple copies of NVLinkBuilder or a converstation or A/R stuff (to delete the old forward and back links and to add in new forward and back links that skip the troublesome trollpt). Seems like a lot of work to me. But hey, it's your time not mine.
Zontik on 14/10/2015 at 07:48
It is possible just to teleport some TrolPts from behind the door to the "accessible" area.
Anyway, I think it won't look natural if he doesn't even try to open the door. How he could know?!
schleicher on 14/10/2015 at 09:53
I would then prefer, to let 2 guards patrol in this area. The one has the key
on the belt, but this guard follows his own patrol, that doesn't lead into
the room. The other guard has the key in his inventory and follows the "with
locked room"-patrol.
So I would have then two patrols in this area. But how can I link TrolPts to
certain beings ?
As far as I know, TrolPts affect every patrolling being.
Yandros on 14/10/2015 at 11:47
When the mission starts, any AI with the Does Patrol property set to True will find the nearest TrolPt and use its route as their patrol, and ignore others. The way you can choose which route each AI uses is to create an AICurrentPatrol link from the AI to a TrolPt on the route you want them to use, and then they will honor that.
schleicher on 14/10/2015 at 12:28
Quote Posted by Yandros
When the mission starts, any AI with the Does Patrol property set to True will find the nearest TrolPt and use its route as their patrol, and ignore others. The way you can choose which route each AI uses is to create an AICurrentPatrol link from the AI to a TrolPt on the route you want them to use, and then they will honor that.
Based on this Idea:
You suggested earlier:
"2. Have a second patrol route similar to the original, but which doesn't include
the TrolPt inside the locked room. When the key is taken off his belt, you
could change his patrol to the alternate route."
This is the best solution, I think. And it behaves realistic.
How can I send or link another patrol to an being, and remove the old one?
voodoo47 on 14/10/2015 at 18:08
NVscript can catch the event of the key being lifted, and delete/create links accordingly. you will have to read a lot of documentation to find out how to work with it, but it's well worth it.
schleicher on 15/10/2015 at 21:20
Quote Posted by voodoo47
NVscript can catch the event of the key being lifted, and delete/create links accordingly. you will have to read a lot of documentation to find out how to work with it, but it's well worth it.
Thanks. I will explore that script-commands.
It seems, the "default"-environment doesn't offer the ability, to switch patrols.
john9818a on 15/10/2015 at 21:34
Quote Posted by Zontik
It is possible just to teleport some TrolPts from behind the door to the "accessible" area.
Anyway, I think it won't look natural if he doesn't even try to open the door. How he could know?!
I have used this method to re-route AIs before and it works quite well. One problem I see with this is that if the door is left unlocked the guard will still not patrol that room anymore. I like the 2 key method better.
If you have the TrolPts in a loop you could make just that one room as an alternate and have that TrolPt destroyed when the key is taken.