nhivanye on 22/3/2005 at 12:05
It's possible to connect a patrol point to multiple destination patrol points. If you do this the AI will choose one of the points at random and make for it. This could make it harder for the player to work out any pattern (since there basically isn't any). By default each destination is equally likely but this can be changed by properties relativeChancePath1 ... relativeChance Path8 in PatrolPoint section of properties.
It should in theory be possible to tweak these properties via triggerscripts so for different difficulties one could change the probabilities of different paths.
scumble on 22/3/2005 at 13:00
Have you given it a good testing?
nhivanye on 22/3/2005 at 18:39
I've tried it out with the default probabilities and this seems to work OK. The first trial with setting the probabilities didn't seem to pic the ones I'd made more probable but I need to do a proper test in a simplified situation.
The trigger scripts seem to let you change properties of objects linked to the object running the script.
One thing I'm not sure of is whether all scripts with "When map loaded ... " conditions run regardless of which object they're connected to or only when the player comes into contact with them. More experimentation is needed when I get the time.
Krypt on 22/3/2005 at 20:05
Yes, you can create random patrol paths by linking to multiple PatrolPoints from one PatrolPoint. It can be hard to manage if you get a really complex jumble of paths going, and it can be hard to test because you might have to wait 20 mins for an AI to take a particular path. The easiest way I've found to make a really random perpetual patrol path with many directions is this: Place one PatrolPoint that will be the "center" of your path. Now link it to 4 PatrolPoints (or however many you want) and create a patrol path going from each of those, then put a ChangeDirectionPoint at the end of each of the branches. With this setup, the AI will walk down to the end of a path, turn around and go back, then when he hits the center PatrolPoint he'll pick a random path.
You could in theory change the probabilities in script, but I never tried it before so no guarantees. For the example above you might want to set it up so the AI doesn't pick the branch of the path he just came from again when he reaches the center. I would do this by placing a script on each of the ChangeDirectionPoints with the condition "When AI reaches this patrol point" and then action to send a trigger message that is unique to each path (ReachedPath1 - ReachedPath4 for example) and a "Reset script conditions and actions" so it works more than once. Then put 4 scripts on the central PatrolPoint that listen for each of the messages and change the probability of the current path to 0% and each of the other ones to 33%, respective to each branch of the path. Put a reset on each of those as well to make the whole thing work for as long as the AI is on the path.
Quote Posted by nhivanye
One thing I'm not sure of is whether all scripts with "When map loaded ... " conditions run regardless of which object they're connected to or only when the player comes into contact with them. More experimentation is needed when I get the time.
Scripts run only under the exact conditions specified. In order for it to run when the player comes in contact with it there would have to be a volume there and a condition "When volume is breached by [object_Player]" When map loaded will always trigger when the map loads, unless it is paired with some other condition that isn't true when the map loads. So basically, whatever the conditions say is what will trigger it, there are no hidden conditionals.
nhivanye on 23/3/2005 at 10:20
Thanks very much, Krypt. :) I was hinking of using scripts to change probabilities on load so for 'easy' the Ais would have fixed patrol paths getting more random as you went towards 'expert'. Alternatively one could use this to chnage patrol paths when Garrett has been spotted or has reached his objective to make getting out harder but that would be more difficult to organise.
SneaksieDave on 23/3/2005 at 17:21
Wow, they're easy to use, and work great! :thumb:
A change in paradigm.