Jump to content
jw custom

Ultra Simple Patrol Script

Recommended Posts

Here's version 1.6 of USPS.

Ultra Simple Patrol Script v1.6 by JW Custom

Arguments:

argument 0: Unit/group leader - unit

argument 1: Chance of unit/group existing in percentage. If set to 100 the unit/group will always exist - number (0-100)

argument 2: The radius where to randomly place the unit/group within - number

argument 3: The marker representing the radius center of where unit/group will be randomly placed within - string "markername"

argument 4: The marker representing the center of the patrol area - string "markername"

argument 5: The radius where the unit/group will patrol within - number

argument 6: Randomly place place unit/group within the defined _spawnRadius - boolean (true/false)

argument 7: The behaviour of the unit/group - string ("CARELESS"/"SAFE"/"AWARE"/"COMBAT"/"STEALTH")

argument 8: Combat mode of unit/group. - string ("BLUE"/"GREEN"/"WHITE"/"YELLOW"/"RED")

argument 9: Movement speed of the unit/group. - string ("LIMITED"/"NORMAL"/"FULL")

argument 10: Group formation. - string ("COLUMN"/"STAG COLUMN"/"WEDGE"/"ECH LEFT"/"ECH RIGHT"/"VEE"/"LINE"/"FILE"/"DIAMOND")

argument 11: Wait time in seconds before moving on to next waypoint. Set to 0 and theres no wait time. - number

argument 12: Minimum distance between old and new waypoint. - number

argument 13: Altitude of unit/group. Unless unit/group are a air vehicle this should be set to 0. - number

argument 14: Search building arguments. If unit is a vehicle first argument in array should be false! - Array containing 5 arguments, see below...

Search Building arguments:

argument 0: Search buildings - boolean (true/false)

argument 1: Chance of seaching building - number (0-100)

argument 2: Building lookup radius - number

argument 3: Max building positions to walk - number

argument 4: Wait time on each positions - number

Usage example: null = [this, 100, 200, "patrol1", "patrol1", 200, true, "SAFE", "RED", "LIMITED", "FILE", 0, 30, 0, [true,35,25,3,1]] execVM "USPS.sqf";

Download from v1.6 filedropper

Edited by JW Custom
Script updated

Share this post


Link to post
Share on other sites

Hey JW Custom,

Thanks for the script. I have a question, I want to add the patrol script to a Module (Site>Opfor>firebase) to make them patrol as my tests they all are very static. Is this possible?

To remove the randomisation in the spawning do I just have to remove (the red part):

nul = [ this, 500, "spawnMarker", "patrolMarker", 500, "SAFE", "RED", 100, "LIMITED", "FILE", 0, 30, 0] execVM "USPS.sqf"

or are there parts within the USPS.sqf that need altering as well?

Skip

Edit: Just been speaking to a friend, if I remove those lines its going to change the order of the argument and break everything. So do you think setting them to "0" will mess with the modules ability to place the soldiers where it sees fit?

---------- Post added at 13:12 ---------- Previous post was at 12:16 ----------

ok, so I commented out lines from your USPS.SQF for men, air and vehicles and the module spawns the men, though I am not sure if they are running the script. They seem pretty content to stand still.

//{_x setPos _ranPos} forEach units _grp;

//{vehicle _x setPos [(_ranPos select 0) + random 50, (_ranPos select 1) + random 50, _flyInHeight]} forEach units _grp;

// {vehicle _x setPos [(_ranPos select 0) + random 25, (_ranPos select 1) + random 25, 0];} forEach units _grp;

from your USPS.SQF for men, air and vehicles and the module spawns the men, though I am not sure if they are running the script. They seem pretty content to stand still.

Skip

Edited by skipspence
New information

Share this post


Link to post
Share on other sites

How are you executing the script?

If needed i will provide some scripts manually spawning units with different options!

Share this post


Link to post
Share on other sites

I'm executing it through the initialization line on the module:

nul = [this, 0, "spawnMarker", "patrolMarker", 0, "SAFE", "RED", 100, "LIMITED", "FILE", 0, 30, 0] execVM "USPSnoplacement.sqf"

Which I guess is executed when the module is activated at the beginning of the mission.

I commented out the three lines above and saved the SQF as USPSnoplacement.sqf.

The main reason I'm trying this module is because it nicely places soldiers within buildings and guard towers for me. Been testing it most of the afternoon, they gave me a run for my money when I assaulted them, but when ever I spawn myself as OpFor just to have a look at what they are up to they tend to do very little.

Skip

Share this post


Link to post
Share on other sites

Thats not the correct way to execute it.

nul = [this, 0, "spawnMarker", "patrolMarker", 0, "SAFE", "RED", 100, "LIMITED", "FILE", 0, 30, 0] execVM "USPSnoplacement.sqf"

argument 0 points at the unit/group which the script will handle, in your case thats a module and not a unit/group.

Why you wanna use a patrol script then, i mean if you want people inside buildings you might wanna check out house patrol script instead!

Share this post


Link to post
Share on other sites

The reason I wanted to use it was, when you place the module you can set the building occupation between 0.0 & 1. I have it set to 0.5, so half are inside and half are outside, also kind of hoping they would patrol into and out of the building..

So because the module only spawns units and is not a unit itself, the USPS.sqf will not handle any of the troops spawned? I was of a thought that maybe the module would apply the line to any soldiers it spawns initialization line.

Any thoughts on how I should be executing it?

Tom

Share this post


Link to post
Share on other sites

@JW Custom can you provide a sample mission, or provide a link to one you know uses this script? I would like to see what makers and naming convention are used.

Thanks,

Nate

Share this post


Link to post
Share on other sites

Yes i will add some sample missions, with on the fly spawn, ambush etc.

I will also add a function for patrols to enter and patrol inside buildings based on arguments.

@skipspence

I have no idea how the spawn module works so i can't help you there.

Share this post


Link to post
Share on other sites

Thanks for all the help JW Custom, learnt a considerable sum from looking through your SQF. and discussing it.

Must say I found particuarly useful you listing the arguments, so thanks for that!

Skip

Share this post


Link to post
Share on other sites

JW Custom thanks! i always use your script! and i have a mission on arma 3 using the old one for arma 2 and is working!

Share this post


Link to post
Share on other sites
JW Custom thanks! i always use your script! and i have a mission on arma 3 using the old one for arma 2 and is working!

No v1.4 does not work correctly in some instances, neither in arma3 or arma2!

I will try update the script with the "search building" feature + add some example missions today when i get home from work.

Share this post


Link to post
Share on other sites

just like the old one the markers "spawnMarker", "patrolMarker" could be the same right? "patrolMarker", "patrolMarker"

Share this post


Link to post
Share on other sites

Hello there. The script is good, clean and simple to set up so thank you for making it. Now im wondering if there is a way to respawn the patrol if it's killed?

Share this post


Link to post
Share on other sites

Hey,

i use this skript in my first mission and i love it !!!:yay:

Share this post


Link to post
Share on other sites

Hi,

i saw that some A2 weapons with sound suppressor have less effect on the AI. Is it possible to adapt it to A3 when using suppressor ?

thx

Share this post


Link to post
Share on other sites

I am new to using scripts etc so please bear with me if this is a noob question.

I am making a search , destroy and rescue mission and want a patrol script hence using this. my questions are do I just drag the folder with the script into the mission folder ie ArmA3\other Profiles\Yournick\Missions\mymission\USPS15 or do i just drag the USPS script file in to the mission folder? Also will this allow me to place units in buildings

Thanks in advance

Share this post


Link to post
Share on other sites

Hi, What do the colors mean exactly? "BLUE","GREEN","WHITE","YELLOW","RED"

Blue = ??

Green = careless?

White = safe?

Yellow = Aware?

Red = Alert?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×