-
First Sergeant
Random House Patrol script v1.1
This script will allow you to have a unit patrol a house, randomly.
All you need to do is place a unit close to a building and init the script on it.
The script will then check how many available building positions there are in
the closest building of the unit, and place him randomly at one.
Then he will start patrolling the building.
Every time the unit reaches it's waypoint inside the house it will stay and
wait for a short while, before moving to the next point. The amount of time
the unit waits is random. So you'll never really know how long the unit will
stand still.
It works in Multiplayer as well as Singleplayer.
>> ARMAHOLIC DOWNLOAD <<
HOW TO USE:
* Just put this: guard = [this] execVM "HousePatrol.sqf"
in the init field of a unit and put it next to or on a house.
OPTIONAL SETTINGS:
* You may also set the behaviour of the unit by putting the
preferred behaviour in the array.
Like this: guard = [this,"COMBAT"] execVM "HousePatrol.sqf"
You may put any of these five:
* "CARELESS"
* "SAFE"
* "AWARE"
* "COMBAT"
* "STEALTH".
If you don't put anything the default "SAFE" will be set.
* There is also an option to set the maximum amount of time (in seconds)
that the unit will wait before moving to the next waypoint.
To use this option the behaviour option must be set too.
Example: guard = [this,"SAFE",50] execVM "HousePatrol.sqf"
If you don't put anything the default value of 30 will be set
Use 0 as value if you want the guard to patrol continuesly.
VERSION HISTORY:
v1.1:
* Optimized the code for better performance and no error codes.
* Added a workaround for a game bug where some buildings are missing data.
v1.0
* First release for Arma 2
KNOWN ISSUES:
Sometimes ArmA2 has some problems with pathfinding and getting units to
report if they have finished or failed a task. To get around any such
problems the guard will be given a new command if it takes more than 90
seconds to finish the last command. Some houses seem to be more difficult
for the AI to sort out.
Some buildings are not able to be identified, due to a bug in ArmA 2.
A unit placed close to such a house will be put in the nearest identified house.
Some buildings are missing building positions, this is a game bug.
When a unit it place close to a building it can not patrol, it will stay where you put it in the editor and a chat message will tell you about the problem.
If the unit is given a name you will be told which unit that can't patrol the given house.
/// Tophe of Östgöta Ops [OOPS], Sweden
Last edited by Tophe; Jul 20 2010 at 15:59.
Reason: updated version
-
OFP slut
-
First Sergeant
Nice to see someone using it.
On this one, you don't need the server Logic.
I hope it will work smoothly.
-
Master Gunnery Sergeant
Nice to see this script now in ArmA2. Thx Tophe 
Put it on our scripts section at Assault Mission Studio

Random House Patrol [1.1] by Tophe
Last edited by Imutep; Jul 15 2009 at 19:11.
Assault Mission Studio -
German Mission Editing && Scripting Website
-
First Sergeant
-
great script. is there an option for them to exit the house after a certain time or once all waypoints are patrolled and commence patrolling another house? be great for evasion type action.
-
First Sergeant
Good idea.. I'll see if I can look into that option in the future. Right now it's not in the script.
-
Captain
Random? I was never a fan of randomness. I made a script like this for some of my missions in ArmA and made the observasion that random = unrealistic. So I went through the trouble of making patrol 'waypoints' (an array of buildingPos's) for each unit, as well as 'instructions' (another buildingPos) on what to do upon contact with the enemy (one thing I absolutely cannot stand is patrols that don't 'break' when attacked). I used it extensively; to the point where whenever I need any AI unit to enter a building I'd use it.
Perhaps I'll post it later. Maybe some of these features would be useful for you to implement yourself.
-
First Sergeant
Sounds really interesting... However in this script the unit will break, as on any waypoint when it sees an enemy unit. I've never experienced randomness itself as unrealistic, only perhaps bad implementation of it.
This script will basically just put a unit in a house and have it walk around inside, and sometimes stop for a while. Don't really see anything unrealistic about it.
But you seem to have some good points, so it would be nice to see you scripts. Maybe some good ideas there for the next version of this one.
-
Master Gunnery Sergeant
I can check this off my own to-do list! 
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules