Jump to content
Sign in to follow this  
wolffy.au

Task Patrol / Random Group Demo - v1.2

Recommended Posts

Download:

http://creobellum.org/node/24

Addons Required:

None

Description:

This mission is to demonstrate the use of the taskPatrol function (Binesi's improved version).

screenshot_0.jpg

It includes random spawning of Infantry and Motorised groups, who patrol the areas displayed on the map (including inside buildings). Use the radio commands to use teleport and camera functions.

Created by: (AEF)Wolffy.au [2CAV]

Installation:

It comes with a mission as a demo version. Extract the folder to your ArmA2\other Profiles\Yournick\Missions and load it in the editor.

Usage:

Put the following in the INIT of a Game Logic object:

0 = [position this, "Infantry", 100] execVM "crB_scripts\crB_taskPatrol.sqf";

Where the first parameter is the position of the centre of the patrol.

The second parameter is the group type, "Infantry", "Motorized", "Mechanized", "Armored" or "Air".

The third parameter is the radius you wish them to patrol.

There is an optional fourth parameter, which is passed to crB_randomGroup script, which is a side of a faction (east, west, resistance or civilian), a single faction eg "ACE_USARMY" or an array of factions eg ["ACE_USARMY_DESERT", "ACE_USMC_DESERT"].

Change Log:

v2.0

- Added: crB_randomGroup.sqf v2.0

- Changed: The purpose to always create random groups for patrolling

- Changed: INIT.SQF to minimum requirements

- Removed: AI unit caching from demo

- Removed: Dependency on ACE

v1.2

- Added: Random group spawning to keep things interesting.

- Added: CEP Unit Caching and radio functions to demonstrate their use.

- Changed: Now using Binesi's BIN_taskPatrol.sqf v1.3 instead of BIS's BIS_fnc_taskPatrol function. This includes an updated version of Binesi's taskPatrol which will enter buildings as part of their patrols.

Thanks to:

Random Group Spawn code by Odin

Improved taskPatrol by Binesi

Visit us a http://creoBellum.org

Developer notes:

Here is a list of nifty components to be found in this mission.

Random Group Spawn code by Odin

- This piece of code has turned out to be the most important piece of my future mission making. Using GameLogic objects, this code will spawn random enemy groups of Infantry, Motorised, Mechanised, Armour and Air. In conjunction with Binesi's taskDefend and taskPatrol code, randomised mission making has never been simpler.

Improved taskDefend and taskPatrol by Binesi

- Binesi posted these improved BIS functions around the same time I was asking myself the same question. Placing patrols and defensive squads has never been simpler.

Edited by Wolffy.au

Share this post


Link to post
Share on other sites

Add a side parameter to the randomgroup.sqf? Enemy isn't always east. ;)

Share this post


Link to post
Share on other sites
Add a side parameter to the randomgroup.sqf? Enemy isn't always east. ;)

Yes, I've thought of this many times but am yet to make a mission with Insurgents! When I do, I'll definitely add it as its not a hard fix.

Also need to check if ACE adds anymore groups to choose from.

Share this post


Link to post
Share on other sites

Updated to v2.0

- Added: crB_randomGroup.sqf v2.0

- Changed: The purpose to always create random groups for patrolling

- Changed: INIT.SQF to minimum requirements

- Removed: AI unit caching from demo

- Removed: Dependency on ACE

Share this post


Link to post
Share on other sites

I really like this script, thank you for sharing.

I have used it a few times with success, and then tonight was banging my head against the wall trying to figure out what I did wrong, because it "wasn't working" for me. But then I just happened to notice that it says

waitUntil {!isNil "bis_fnc_init"};

and I realized that I had a game logic going on that uses this;

BIS_Effects_Burn = compile preprocessFile "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf"; nil = [helo1,4,time,false,true] spawn BIS_Effects_Burn;

(because I wanted the large smoke cloud from this to be a visual clue for where my guys needed to go.)

And sure enough, when I removed that ... this script started working for me again.

Does anyone know if it's possible to somehow make these two work together? Can I get the Random Group script to load first somehow, and still get the BIS_Effects_Burn kick in - all at mission start?

Share this post


Link to post
Share on other sites

That waitUntil line is checking for the Functions module existing in the editor. Drop a Functions module down and see if it fixes the issue.

If it doesn't, I'm not really sure how they're related.

Share this post


Link to post
Share on other sites

Hi.

Yes, I already had a functions module down, and was still struggling.

I just checked again, to be sure..., and the effect still seems the same. With my game logic for fire burn effects in place, I'm not seeing the random units pop up. Remove it, and they are there instantly.

I realize it may not be considered a very important issue, but I wanted to ask, just in case anyone had a tip I could use. Was really hoping to have both items at same time.

EDIT: Thank you for the reply Wolffy. I still don't understand what the "problem" is, it's certainly over my head. But I think I may have solved the issue by calling the burn effects game logic via a trigger. That way your bad guys get a chance to be loaded first, and then the game logic kicks in.

BTW - I've also used your random aerial patrol, and enjoy it very much. Thank you again for sharing.

Edited by R.Flagg

Share this post


Link to post
Share on other sites

is there a way to specify what type of unit, such as insergents or russians??

Share this post


Link to post
Share on other sites

There is an optional fourth parameter, which is passed to crB_randomGroup script, which is a side of a faction (east, west, resistance or civilian), a single faction eg "ACE_USARMY" or an array of factions eg ["ACE_USARMY_DESERT", "ACE_USMC_DESERT"].

Share this post


Link to post
Share on other sites

could u post the area i could find this im not to familiar with this kind of work, so if u can give me what the zone looks like where i should change the file,

};

} forEach _allfacs;

};

//hint str _facs;

// if single faction

if(typeName _fac == "STRING") then {

_facs = [_fac];

_fac = nil;

};

// if multiple factions

if(typeName _fac == "ARRAY") then {

_facs = _fac;

_fac = nil;

};

if(isNil "_fac" && !isNil "_side") then {

_s = switch(_side) do {

case resistance: {"Guerrila";};

case civilian: {"Civilian";};

default {str _side;};

is it somthing with that?

---------- Post added at 02:38 AM ---------- Previous post was at 02:30 AM ----------

nvm i figured it out, i didnt understand how to do this it took me a couple minutes to understand how to edit this

Share this post


Link to post
Share on other sites
nvm i figured it out, i didnt understand how to do this it took me a couple minutes to understand how to edit this

You shouldn't need to edit anything - its just a 4th parameter.

0 = [position this, "Infantry", 100, ["BIS_TK","BIS_TK_INS"]] execVM "crB_scripts\crB_taskPatrol.sqf";

Share this post


Link to post
Share on other sites

Is there any way to determine the amount of enemies or friendlies that patrol an area? Maybe I'm not quite up to speed on this yet, is that is what's random? Because it seems to me that it's kinda preset that a certain faction will be patrolling the area i designate.

Share this post


Link to post
Share on other sites

The random part is the squad make-up, as it is selected from the preset groups you find in the Mission Editor (F2 Groups).

Share this post


Link to post
Share on other sites

So, what would I do to spawn USMC or WEST? I can only spawn from the EAST pool.

Share this post


Link to post
Share on other sites

There is a side parameter in there, for which side you want to spawn.

Share this post


Link to post
Share on other sites

0 = [position this, "Infantry", 100, ["west","USMC"]] execVM "crB_scripts\crB_taskPatrol.sqf";

Not working, I know I'm doing it wrong.

Share this post


Link to post
Share on other sites
0 = [position this, "Infantry", 100, "USMC"] execVM "crB_scripts\crB_taskPatrol.sqf"; 

Share this post


Link to post
Share on other sites

Figured out the problem.. Doesn't work if unit is OPFOR around spawn area. Changed OPFOR to BLUFOR in example mission and all is well.

Share this post


Link to post
Share on other sites

Quick Question How can i call on the Gamelogic when i want to?

Or can I call this code:

0 = [position this, "Infantry", 100] execVM "crB_scripts\crB_taskPatrol.sqf";

from a Trigger?

Thanks in advance,

-bigshot

Share this post


Link to post
Share on other sites

Yes, just put that line in your Activation Field. Not sure if 'position this' works, but its worth a try.

Share this post


Link to post
Share on other sites

Ok thanks, I'll definitely change the position to an empty marker just to be safe since the trigger is somewhere else.

Thanks for the quick reply!

-Bigshot

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  

×