Jump to content
Sign in to follow this  
dreadedentity

Dread's Simple Patrol Script

Recommended Posts

Simple Patrol Script



By: DreadedEntity

Last night, I looked through my old scripts and completely rewrote this. None of the original remains. If you used this before, I guarantee you you want to download the updated version. Check the below post for the updated features/implementation

Version: 2.0

Stable in: Current release of Arma 3

Hello all,

I have just finished writing a simple script to help you create missions to play with your friends, faster and easier. This script allows you to quickly and easily create random groups on the map that patrol in a trigger area.

The script takes 6 parameters. You must use a trigger with this script. Here are the parameters and usage:

/*
USAGE: _handle = [triggerObject, classnameArray, numberOfGroup, group, respawn, timeInMinutes] execVM "DE_simplePatrol.sqf";
triggerObject: OBJECT - Must be a trigger. If calling the script from an editor-placed trigger use "thisTrigger".
classnameArray: ARRAY - An array of STRINGS, the classnames of the units you want to spawn.
numberOfGroup: SCALAR (number) - The amount of units to spawn.
group: SIDE - A group will be created for the side you specify.
respawn: BOOLEAN - True enables infinite respawns, false will only create the units once.
timeInMinutes: How many should pass until you want units to respawn.

EXAMPLE: 0 = [thisTrigger, ["B_Soldier_F","B_Officer_F"], 5, west, true, 2] execVM "DE_simplePatrol.sqf";
*/

Features:

Choose units to spawn and randomly patrol an area.

Now with vehicles. Helicopters, tanks, MRAPS, boats and more! (set a large trigger area)

Implementation:

Add the script to your mission folder and refer to above for implementation.

Known Issues:

Vehicles sometimes jam up and don't patrol properly if your trigger area is too small.

Units prioritize side over group. Spawning units of a different side will cause them to fire on each other, despite being in the same group.

Download (Dropbox)

All persons are free to use and modify these scripts to fit their needs, provided the original credit remains intact or I am credited somewhere in the modified script.

I hope some of you can find a use for this. Enjoy.

Edited by DreadedEntity

Share this post


Link to post
Share on other sites
..... The script takes 6 parameters (all are required at the moment :( )
Change to this and populate with your defaults as required

_trigger = _this select 0;
_unit = if ( count _this > 1 ) then { _this select 1 } else {"O_Soldier_F"};
_number = if ( count _this > 2 ) then { _this select 2 } else {3};
_side = if ( count _this > 3 ) then { _this select 3 } else {"EAST"};

etc etc...

Share this post


Link to post
Share on other sites

Thanks guys, I'll look into adding those. Larrow, do you know where the code for randomPosTrigger is? I'm having trouble getting it integrated and I want to take a look at the actual script. I already have a pbo manager to decompile.

Share this post


Link to post
Share on other sites

Load up the editor, click on functions. It's all in there.

Share this post


Link to post
Share on other sites
Load up the editor, click on functions. It's all in there.

I already checked there but there are no BIS_fnc function's in the editor, so I thought I'll have to go searching and extract a pbo to get access to those scripts.

EDIT: Nevermind, derp.

Share this post


Link to post
Share on other sites

All the functions in the function viewer are BIS_fnc_# functions. If you look at the top above the code the black bar tells you their full name and what there path is in the unpacked PBO's.

BIS_fnc_randomPosTrigger comes under the Map category.

Edited by Larrow

Share this post


Link to post
Share on other sites
Guest

Release frontpaged on the Armaholic homepage.

================================================

You are not registered on Armaholic, or at least not that we are aware of. In the future we offer the possibility to authors to maintain their own pages.

If you wish to be able to do this as well please register on Armaholic and let me know about it.

This is not mandatory at all! Only if you wish to control your own content you are welcome to join, otherwise we will continue to follow your work like we have always done ;)

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites
Guest

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means soon you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Cool script.Can you add a new parameter to script for controlling spawned ai behavior,speed while patroling?

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  

×