Urban Patrol Script
Credits to Kronzky. More information here.
Urban Patrol Script basically generate patrol waypoints in a specific area that you specify for AIs to randomly patrol in. This is nice for making big city patrols and you don't want to place waypoints yourself and rather have the script do it for you. If you don't want to use the script, simply delete the UPS.sqf.
To use this script, go in the editor, place a rectangle or ellipse marker and name it something. (Let's call it town for example)
Urban Patrol Script basically generate patrol waypoints in a specific area that you specify for AIs to randomly patrol in. This is nice for making big city patrols and you don't want to place waypoints yourself and rather have the script do it for you. If you don't want to use the script, simply delete the UPS.sqf.
To use this script, go in the editor, place a rectangle or ellipse marker and name it something. (Let's call it town for example)
Now create a group of infantries, vehicle, or whatsoever. Go to the init of the group's leader (you don't have to place the commands in all the units in the group, just the leader). Put nul=[this,"town"] execVM "scripts\ups.sqf"; or nul=[this,"town"] execVM "ups.sqf"; if the UPS.sqf is in the same place as the mission.sqm.
The format of what to put in is defined like this...
nul=[UNIT NAME, "MARKER's NAME"] execVM "scripts\UPS.sqf"; OR
nul=[UNIT NAME, "MARKER's NAME","OPTIONAL PARAMETERS"] execVM "scripts\UPS.sqf";
To see what kind of optional parameters there are, open up your UPS.sqf with notepad++ and you'll see what they are and descriptions of what they do.
An example of what to put in a unit's init for the optional parameters would be something like nul=[this,"town","nomove"] execVM "scripts\ups.sqf"; these units will stay in their position until you are detected because of the nomove parameter.
nul=[UNIT NAME, "MARKER's NAME"] execVM "scripts\UPS.sqf"; OR
nul=[UNIT NAME, "MARKER's NAME","OPTIONAL PARAMETERS"] execVM "scripts\UPS.sqf";
To see what kind of optional parameters there are, open up your UPS.sqf with notepad++ and you'll see what they are and descriptions of what they do.
An example of what to put in a unit's init for the optional parameters would be something like nul=[this,"town","nomove"] execVM "scripts\ups.sqf"; these units will stay in their position until you are detected because of the nomove parameter.
You can also modify how the AI react with UPS script by changing the numbers for
#define SAFEDIST 75
#define CLOSEENOUGH 10
#define SHAREDIST 100
#define ALERTTIME 180
The numbers are how many meters away. The script should specify what each #define means. Adjust to fit the mission's setting.
#define SAFEDIST 75
#define CLOSEENOUGH 10
#define SHAREDIST 100
#define ALERTTIME 180
The numbers are how many meters away. The script should specify what each #define means. Adjust to fit the mission's setting.
It is advised that you go into your init.sqf and on top of the init, put in
"town" setMarkerAlpha 0;
If the marker you used for UPS name is not town and is something else, replace town with that name to hide the marker in the beggining of the mission. This will prevent other people to know exactly where the AI will patrol around the map, making your mission more predictable.
"town" setMarkerAlpha 0;
If the marker you used for UPS name is not town and is something else, replace town with that name to hide the marker in the beggining of the mission. This will prevent other people to know exactly where the AI will patrol around the map, making your mission more predictable.