Jump to content
Sign in to follow this  
jw custom

Ultra Simple Patrol Script

Recommended Posts

Ultra Simple Patrol Script v1.4 by JW Custom

Main features:

  • Random start placement of units/groups
  • Randomly unit/group patrolling

Usage:

Put the below line in a units init field, f your working with a group you only need to put it in the leaders init field.

nul = [this, 500, "patrolMarker", "patrolMarker", 500, "AWARE", 100, "LIMITED", "FILE",0,75] execVM "USPS.sqf";

In the above example the unit/group will be randomly placed within a radius of 500m of the center of marker "patrolMarker".

The unit/group will randomly patrol in a radius of 500m of the center of marker "patrolMarker".

The unit/group bevaviour will be set to AWARE and it's chance of existing is 100%.

The unit/group will patrol in "FILE" formation with speed set to "LIMITED" which is walking speed.

The unit/group will wait 0 seconds at every waypoint before moving on to next.

The unit/groups spawn height and fly height is 75m, so in this case we are dealing with a aircraft.

Parameters:

argument 0: The unit/group leader we are dealing with

argument 1: The radius size where to randomly place the unit/group within

argument 2: The marker representing the radius center of where unit/group will be randomly placed within

argument 3: The marker representing the center of the unit/group patrol

argument 4: The radius size where unit/group will patrol within

argument 5: The behaviour of the unit/group. Select between: "CARELESS", "SAFE", "AWARE", "COMBAT", "STEALTH" .

argument 6: Chance of unit/group existing in percentage. If set to 100 the unit/group will always exist.

argument 7: Movement speed of the unit/group. Select between: "UNCHANGED", "LIMITED", "NORMAL", "FULL". (LIMITED = walk)

argument 8: Group formation. Select between: "NO CHANGE", "COLUMN", "STAG COLUMN", "WEDGE", "ECH LEFT", "ECH RIGHT", "VEE", "LINE", "FILE", "DIAMOND".

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

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

Changelog:

v1.0

-initial release

v1.1

-added agument for chance of existing

-fixed a few errors

v1.2

-Using manual waypoint instead of BIS taskpatrol

-added argument for movement speed

-added argument for group formation

-added argument for wait time between waypoints

-minor tweaks

v1.3

-added alive check to stop waypoint loop when all units in group are dead

v1.4

-added support for land & air vehicles

-added argument for spawn/fly height

-fixed a marker error (thanks Mikey74 for reporting)

-fixed a few issues

Additional info:

Use large patrol radius for vehicles for best results.

Using script on grouped vehicles can give unwanted results!

Download script & demo v1.4:

http://arma2missions.webege.com/

Edited by JW Custom

Share this post


Link to post
Share on other sites

Pardon me if I'm wrong, but I fail to see how this is much different to Kronzky's UPS...

Share this post


Link to post
Share on other sites
Pardon me if I'm wrong, but I fail to see how this is much different to Kronzky's UPS...

I never claimed it was different ;)

This script is just simple and light so maybe someone like that.

Reason i made it was because UPS which i normally use seems to eventually cluster up units in center of a marker, might be a mod dealing with AI doing that though!

Share this post


Link to post
Share on other sites

Fair enough :) Was just curious!

Edit: Just re-read my previous post: sorry if it sounded harsh, was typing on my iPhone and so tend to omit unnecessary words/smilies :p

Edited by JamesF1

Share this post


Link to post
Share on other sites

Nice little script. It use the BIS_fnc_taskPatrol better :)

Put it on our scripts section at Assault Mission Studio.

dlicon.gif

Ultra Simple Patrol Script [1.4] by JW Custom

Edited by Imutep

Share this post


Link to post
Share on other sites

With Kronzkys UPS I always have the problem that after a while all patrols 'meet' in the center of the marker and patrol in a small circle around it.

It happens only in ArmA2, in ArmA1 and VBS2 the problem doesn't appear.

Might be caused by an older version of his script, but I always have that problem so I stopped using it. I give this one a try asap. :)

Share this post


Link to post
Share on other sites

Do you know if this "centering in the middle" effect is also seen in UPSMON?

Thanks. Best, Splicer.

Share this post


Link to post
Share on other sites

In UPSMON this don't happens, IA's may meet each others but is ocasionally, they patrol all the marker.

Share this post


Link to post
Share on other sites

Hi Monsada,

Thanks for letting us know! That is great!

Best, Splicer.

Share this post


Link to post
Share on other sites
With Kronzkys UPS I always have the problem that after a while all patrols 'meet' in the center of the marker and patrol in a small circle around it.

It happens only in ArmA2, in ArmA1 and VBS2 the problem doesn't appear.

Might be caused by an older version of his script, but I always have that problem so I stopped using it. I give this one a try asap. :)

Notice that as well. And another thing with Kronzkys is that i cant get them up on random roofs/balconys etc anymore since ARMA2. Using the "RANDOMUP". Worked flawlessly in ArmA1.

Thanks for the script JW will test it out. :)

Share this post


Link to post
Share on other sites

Just a suggestion...it'd be very nice if you could include version info in the script, in a README file within the ZIP download and in your post itself. Doing so makes it much easier to tell if one has the latest and greatest version.

Thanks for a very helpful script!

Share this post


Link to post
Share on other sites

What prevents the script from placing units in "illigal" places? Keep in mind that placing an AI (not player) unit in a way that makes it clip with another object can result in death or injury of that AI unit.

Also is this really much different than just placing the unit with placement radius and then giving it a bunch of waypoints with a placement radius?

Share this post


Link to post
Share on other sites

I used this script in a mission I'm working on and noticed that the AI seems to be straying significantly beyond the radius that I'm setting for them. The radius I'm setting is 50 metres, is this lower than the script is intended for? Also, I don't quite understand the difference between the functions of the "centerMarker" and the "patrolMarker" from their descriptions in the readme.

Share this post


Link to post
Share on other sites
I used this script in a mission I'm working on and noticed that the AI seems to be straying significantly beyond the radius that I'm setting for them. The radius I'm setting is 50 metres, is this lower than the script is intended for? Also, I don't quite understand the difference between the functions of the "centerMarker" and the "patrolMarker" from their descriptions in the readme.

When using a low patrol radius it's not being forced very well.

The centerMarker is the center spawn radius and the patrolMarker is the patrol radius center marker. You can use same marker for both. You can also let them spawn around one marker and then place the other marker further away and then they will move towards that marker and start patrol around it.

Share this post


Link to post
Share on other sites

ok cool. Another thing, will this script work if I use a trigger to initiate it on a unit during the course of a mission, or does it have to be initiated on the unit at the start of the mission only?

Share this post


Link to post
Share on other sites
ok cool. Another thing, will this script work if I use a trigger to initiate it on a unit during the course of a mission, or does it have to be initiated on the unit at the start of the mission only?

You have to put it on the unit.

---------- Post added at 03:46 PM ---------- Previous post was at 02:35 PM ----------

Updated script to v1.1.

Share this post


Link to post
Share on other sites

What stops you from calling the script from elsewhere, as long as the appropriate parameters are used?

Share this post


Link to post
Share on other sites

JW Custom,

Thanks for the script. Will try it when I get a chance.

EDIT:

OK, working. - How would I get it to work with, say, elipse markers of 950x450 @35 deegrees?

EDIT:

Well, I just set the init line at 1000/1000. - When I use this, we are at the unit/s location, then we all disapear and go to a random spawn point. What can I delay. or do, to stop 'seeing' that?

Can I set things such as the squad formation?

Edited by CyOp

Share this post


Link to post
Share on other sites

Thanks for this.

I take it you had ACEX running and used ace soldiers when you made the demo mission as you seem to have created an addon dependency?

Share this post


Link to post
Share on other sites
Thanks for this.

I take it you had ACEX running and used ace soldiers when you made the demo mission as you seem to have created an addon dependency?

Yeah that is a mistake thanks for reporting, will fix that on next update :)

Share this post


Link to post
Share on other sites

hehe, guess I'm the only person in this thread who doesn't have ace installed. :p

Share this post


Link to post
Share on other sites

Thx for new version. Updated link on Assault Mission Studio. :)

dlicon.gif

Ultra Simple Patrol Script [1.1] by JW Custom

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
Sign in to follow this  

×