Jump to content
Sign in to follow this  
jw custom

Ultra Simple Patrol Script

Recommended Posts

Thank you very much for the example you made me earlier, and the spawning example here!

I'd have responded earlier but internet troubles are bugging me until the 6th. Anyway, thank you very much for being so helpful and for this script!

Share this post


Link to post
Share on other sites

Is there a way to adapt this, to add the units in the editor as normal then to respawn said units at a different location than the patrol area.

Basically, i want to have the units/groups patrol around. Then once killed, to respawn at a location defined by me. For example a nearby base, to simulate reinforcements coming in.

Thankyou for any help and for providing an alternative system.

Edited by Shadow.D. ^BOB^

Share this post


Link to post
Share on other sites
Is there a way to adapt this, to add the units to the editor as normal then to respawn the units at a different location than the patrol area.

Basically, i want to have the units/groups patrol around. Then once killed, to respawn at a location defined by me. For example a nearby base, to simulate reinforcements coming in.

Thankyou for any help and for providing an alternative system.

No not from editor, but yes if you spawn from a script then you can use this example here:

http://www.filefactory.com/file/a2he609/n/spawn2.utes.zip

All you have to do is to add a 2nd marker and change the 2nd marker name in the commandline to the name of your new added marker!

Share this post


Link to post
Share on other sites

Custom this sees a great little script..well done. I am putting into one of my missions now and I will be using the spawn2 version you showed above.

A quick question... I presume ifI want more than one group...I simply copy and paste the relevent bit,swapping grp1 for grp2 and so on...for however many groups I want?

It would be great if we could incorporate a respawn option into the command line for the future, that way they simply respawn at the start marker and head to the second marker...would save having to constantly edit the spawn.sqf.

Cheers

BD1

Share this post


Link to post
Share on other sites

Seems simple enough, i'll take a look.

The only reason i ask about it being implemented from the editor placed units, is that i like to add a full group into the system say a 12 man team. Then put everyone but the leader onto a 50% prob, it just mixes things up even more.

Would there be a possibility to do this with the creatgroup option in the spawn script?

Thanks for the quick reply...

Share this post


Link to post
Share on other sites
Custom this sees a great little script..well done. I am putting into one of my missions now and I will be using the spawn2 version you showed above.

A quick question... I presume ifI want more than one group...I simply copy and paste the relevent bit,swapping grp1 for grp2 and so on...for however many groups I want?

It would be great if we could incorporate a respawn option into the command line for the future, that way they simply respawn at the start marker and head to the second marker...would save having to constantly edit the spawn.sqf.

Cheers

BD1

If your using the respawn example you'll have to create a script for each group or write it differently. I'll make an examples for that tomorrow.

Maybe i'll add the respawn feature in a future update but it depends on if i find a proper way to do it.

The only reason i ask about it being implemented from the editor placed units, is that i like to add a full group into the system say a 12 man team. Then put everyone but the leader onto a 50% prob, it just mixes things up even more.

You can do that in the spawn script aswell, i'll make an example for that tomorrow.

Would there be a possibility to do this with the creatgroup option in the spawn script?

Yes, i'll make an example for that tomorrow.

Share this post


Link to post
Share on other sites

JW hi,

Here is what I did to create a secondary group. I created another file in this case spawn1.sqf and called it by a trigger activated by Blufor rather than cll it in the main game init file, that way it helps sever load slightly at game start for multiplayer.

The contents of the script are as follows:

if (!isServer) exitWith {};

_num = 0;


_grp4 = createGroup EAST;
"INS_Soldier_MG" createUnit [(getMarkerPos "ES4"), _grp4, "",0.3,"PRIVATE"];
"INS_Soldier_2" createUnit [(getMarkerPos "ES4"), _grp4, "",0.3,"PRIVATE"];
"INS_Soldier_1" createUnit [(getMarkerPos "ES4"), _grp4, "",0.3,"PRIVATE"];
"INS_Soldier_GL" createUnit [(getMarkerPos "ES4"), _grp4, "",0.3,"PRIVATE"];
"INS_Soldier_AR" createUnit [(getMarkerPos "ES4"), _grp4, "",0.3,"PRIVATE"];
"INS_Soldier_CO" createUnit [(getMarkerPos "ES4"), _grp4, "nul = [this, 50, 'ES4', 'Patrol1', 500, 'AWARE', 100, 'LIMITED', 'STAG COLUMN',0,0] execVM 'USPS.sqf'",0.5,"SERGEANT"];
hint "Insurgents near the CDF Heli base have radioed for help";

while{_num < 10}do
{
waitUntil{{alive _x} count units _grp4 < 1};
_grp4 = createGroup EAST; 
"INS_Soldier_MG" createUnit [(getMarkerPos "ES4"), _grp4, "",0.3,"PRIVATE"];
"INS_Soldier_2" createUnit [(getMarkerPos "ES4"), _grp4, "",0.3,"PRIVATE"];
"INS_Soldier_1" createUnit [(getMarkerPos "ES4"), _grp4, "",0.3,"PRIVATE"];
"INS_Soldier_GL" createUnit [(getMarkerPos "ES4"), _grp4, "",0.3,"PRIVATE"];
"INS_Soldier_AR" createUnit [(getMarkerPos "ES4"), _grp4, "",0.3,"PRIVATE"];
"INS_Soldier_CO" createUnit [(getMarkerPos "ES4"), _grp4, "nul = [this, 50, 'ES4', 'Patrol1', 500, 'AWARE', 100, 'LIMITED', 'STAG COLUMN',0,0] execVM 'USPS.sqf'",0.5,"SERGEANT"];
_num = _num + 1;
};

_grp5 = createGroup EAST;
"INS_Woodlander3" createUnit [(getMarkerPos "ES1"), _grp5, "",0.3,"PRIVATE"];
"INS_Villager3" createUnit [(getMarkerPos "ES1"), _grp5, "",0.3,"PRIVATE"]; 
"INS_Woodlander2" createUnit [(getMarkerPos "ES1"), _grp5, "",0.3,"PRIVATE"];
"INS_Woodlander1" createUnit [(getMarkerPos "ES1"), _grp5, "",0.3,"PRIVATE"];
"INS_Worker2" createUnit [(getMarkerPos "ES1"), _grp5, "nul = [this, 50, 'ES1', 'Patrol1', 300, 'AWARE', 100, 'LIMITED', 'STAG COLUMN',0,0] execVM 'USPS.sqf'",0.5,"SERGEANT"];


while{_num < 10}do
{
waitUntil{{alive _x} count units _grp5 < 1};
_grp5 = createGroup EAST; 
"INS_Woodlander3" createUnit [(getMarkerPos "ES1"), _grp5, "",0.3,"PRIVATE"];
"INS_Villager3" createUnit [(getMarkerPos "ES1"), _grp5, "",0.3,"PRIVATE"]; 
"INS_Woodlander2" createUnit [(getMarkerPos "ES1"), _grp5, "",0.3,"PRIVATE"];
"INS_Woodlander1" createUnit [(getMarkerPos "ES1"), _grp5, "",0.3,"PRIVATE"];
"INS_Worker2" createUnit [(getMarkerPos "ES1"), _grp5, "nul = [this, 50, 'ES1', 'Patrol1', 300, 'AWARE', 100, 'LIMITED', 'STAG COLUMN',0,0] execVM 'USPS.sqf'",0.5,"SERGEANT"];
_num = _num + 1;
};


_grp6 = createGroup EAST;
"INS_Soldier_MG" createUnit [(getMarkerPos "ES4"), _grp6, "",0.3,"PRIVATE"];
"INS_Soldier_MG" createUnit [(getMarkerPos "ES4"), _grp6, "",0.3,"PRIVATE"];
"INS_Soldier_2" createUnit [(getMarkerPos "ES4"), _grp6, "",0.3,"PRIVATE"];
"INS_Soldier_1" createUnit [(getMarkerPos "ES4"), _grp6, "",0.3,"PRIVATE"];
"INS_Soldier_AT" createUnit [(getMarkerPos "ES4"), _grp6, "",0.3,"PRIVATE"];
"INS_Soldier_AR" createUnit [(getMarkerPos "ES4"), _grp6, "",0.3,"PRIVATE"]; 
"INS_Soldier_GL" createUnit [(getMarkerPos "ES4"), _grp6, "",0.3,"PRIVATE"];
"INS_Soldier_AR" createUnit [(getMarkerPos "ES4"), _grp6, "",0.3,"PRIVATE"];
"INS_Soldier_CO" createUnit [(getMarkerPos "ES4"), _grp6, "nul = [this, 50, 'ES4', 'Patrol2', 500, 'AWARE', 100, 'LIMITED', 'STAG COLUMN',0,0] execVM 'USPS.sqf'",0.5,"SERGEANT"];


while{_num < 10}do
{
waitUntil{{alive _x} count units _grp6 < 1};
_grp6 = createGroup EAST; 
"INS_Soldier_MG" createUnit [(getMarkerPos "ES4"), _grp6, "",0.3,"PRIVATE"];
"INS_Soldier_MG" createUnit [(getMarkerPos "ES4"), _grp6, "",0.3,"PRIVATE"];
"INS_Soldier_2" createUnit [(getMarkerPos "ES4"), _grp6, "",0.3,"PRIVATE"];
"INS_Soldier_1" createUnit [(getMarkerPos "ES4"), _grp6, "",0.3,"PRIVATE"];
"INS_Soldier_AT" createUnit [(getMarkerPos "ES4"), _grp6, "",0.3,"PRIVATE"];
"INS_Soldier_AR" createUnit [(getMarkerPos "ES4"), _grp6, "",0.3,"PRIVATE"]; 
"INS_Soldier_GL" createUnit [(getMarkerPos "ES4"), _grp6, "",0.3,"PRIVATE"];
"INS_Soldier_AR" createUnit [(getMarkerPos "ES4"), _grp6, "",0.3,"PRIVATE"];
"INS_Soldier_CO" createUnit [(getMarkerPos "ES4"), _grp6, "nul = [this, 50, 'ES4', 'Patrol2', 500, 'AWARE', 100, 'LIMITED', 'STAG COLUMN',0,0] execVM 'USPS.sqf'",0.5,"SERGEANT"];
_num = _num + 1;
hint "Radio message intercepted from ChDKZ HQ reinforcements on the way";
};


_grp7 = createGroup EAST;
"RUS_Soldier1" createUnit [(getMarkerPos "ES3"), _grp7, "",0.3,"PRIVATE"];
"RUS_Soldier_GL" createUnit [(getMarkerPos "ES3"), _grp7, "",0.3,"PRIVATE"];
"RUS_Soldier_Marksman" createUnit [(getMarkerPos "ES3"), _grp7, "",0.3,"PRIVATE"];
"RUS_Soldier3" createUnit [(getMarkerPos "ES3"), _grp7, "",0.3,"PRIVATE"];
"RUS_Soldier1" createUnit [(getMarkerPos "ES3"), _grp7, "",0.3,"PRIVATE"];
"RUS_Soldier_TL" createUnit [(getMarkerPos "ES3"), _grp7, "nul = [this, 50, 'ES3', 'Patrol4', 500, 'AWARE', 100, 'LIMITED', 'STAG COLUMN',0,0] execVM 'USPS.sqf'",0.5,"SERGEANT"];


while{_num < 10}do
{
waitUntil{{alive _x} count units _grp7 < 1};
_grp7 = createGroup EAST; 
"RUS_Soldier1" createUnit [(getMarkerPos "ES3"), _grp7, "",0.3,"PRIVATE"];
"RUS_Soldier_GL" createUnit [(getMarkerPos "ES3"), _grp7, "",0.3,"PRIVATE"];
"RUS_Soldier_Marksman" createUnit [(getMarkerPos "ES3"), _grp7, "",0.3,"PRIVATE"];
"RUS_Soldier3" createUnit [(getMarkerPos "ES3"), _grp7, "",0.3,"PRIVATE"];
"RUS_Soldier1" createUnit [(getMarkerPos "ES3"), _grp7, "",0.3,"PRIVATE"];
"RUS_Soldier_TL" createUnit [(getMarkerPos "ES3"), _grp7, "nul = [this, 50, 'ES3', 'Patrol4', 500, 'AWARE', 100, 'LIMITED', 'STAG COLUMN',0,0] execVM 'USPS.sqf'",0.5,"SERGEANT"];
_num = _num + 1;
};


_grp8 = createGroup EAST;
"ZSU_INS" createUnit [(getMarkerPos "ES2"), _grp8, "",0.3,"PRIVATE"];
"BMP2_INS" createUnit [(getMarkerPos "ES2"), _grp8, "nul = [this, 50, 'ES2', 'Patrol3', 500, 'AWARE', 100, 'LIMITED', 'LINE',0,0] execVM 'USPS.sqf'",0.5,"SERGEANT"];


while{_num < 5}do
{
waitUntil{{alive _x} count units _grp8 < 1};
_grp8 = createGroup EAST; 
"ZSU_INS" createUnit [(getMarkerPos "ES2"), _grp8, "",0.3,"PRIVATE"];
"BMP2_INS" createUnit [(getMarkerPos "ES2"), _grp8, "nul = [this, 50, 'ES2', 'Patrol3', 500, 'AWARE', 100, 'LIMITED', 'LINE',0,0] execVM 'USPS.sqf'",0.5,"SERGEANT"];
_num = _num + 1;
};

As you can see this is the second group... I had groups 1-3 spawn at game start and this second wave groups 4 to 8, arrive when Blufor enters the trigger area.

In this case, the forces are Insurgent. I also messed around with the hints a bit.

Share this post


Link to post
Share on other sites

In your example your still only handling 1 group at the time in same script :)

Share this post


Link to post
Share on other sites
Not sure if you missed my edit but is it possible to spawn vehicles the same way. :)

Yes :)

Share this post


Link to post
Share on other sites
Yes :)

Thats great, maybe im being dumb but how? I tried changing the class name in the script and put create vehicle instead but I cannot get it to work :confused:

Share this post


Link to post
Share on other sites
Thats great, maybe im being dumb but how? I tried changing the class name in the script and put create vehicle instead but I cannot get it to work :confused:

You'll have to edit things a bit, you can use createVehicle or BIS_fnc_spawnVehicle.

If you use createVehicle you will have to create the crew aswell and put them in the vehicle. BIS_fnc_spawnVehicle creates a vehicle with crew, you need to add the functions module to your mission though.

I dont have time now but as i said i'll make some more examples tomorrow :)

Share this post


Link to post
Share on other sites

A quick question... I presume ifI want more than one group...I simply copy and paste the relevent bit,swapping grp1 for grp2 and so on...for however many groups I want?

Example:

http://www.filefactory.com/file/a2h7h4h/n/spawn3.zip

The only reason i ask about it being implemented from the editor placed units, is that i like to add a full group into the system say a 12 man team. Then put everyone but the leader onto a 50% prob, it just mixes things up even more.

Example:

http://www.filefactory.com/file/a2h7h60/n/spawn4.zip

I'll add more examples later...

---------- Post added at 05:02 PM ---------- Previous post was at 03:15 PM ----------

Example of using script with spawned vehicles spawned by createVehicle and BIS_fnc_spawnVehicle:

http://www.filefactory.com/file/a2h76hc/n/spawn5.zip

Share this post


Link to post
Share on other sites
In your example your still only handling 1 group at the time in same script :)

Yeah mate...I figured when only one squad respawned in our mission tonight..lol.... the guys found the spawn point and it became a massacre...lol

I'll try your example... thanks again. Complete idiot here when it comes to scripting!

Edited by BD1

Share this post


Link to post
Share on other sites

Very many thanks for all your help on this JW...I think it now works perfectly for my DarkStar Rising mission.. will test tonight.

Cheers

BD1

EDIT....works a treat! Spot on! Thanks again.

Edited by BD1

Share this post


Link to post
Share on other sites
You'll have to edit things a bit, you can use createVehicle or BIS_fnc_spawnVehicle.

If you use createVehicle you will have to create the crew aswell and put them in the vehicle. BIS_fnc_spawnVehicle creates a vehicle with crew, you need to add the functions module to your mission though.

I dont have time now but as i said i'll make some more examples tomorrow :)

Hi, JW Custom. I dont mean to hassle you but I just wondered if you managed to get time to do an example of the BIS_fnc_spawnVehicle.

Thanks...

Share this post


Link to post
Share on other sites
Hi, JW Custom. I dont mean to hassle you but I just wondered if you managed to get time to do an example of the BIS_fnc_spawnVehicle.

Thanks...

Already did:

Example:

http://www.filefactory.com/file/a2h7h4h/n/spawn3.zip

Example:

http://www.filefactory.com/file/a2h7h60/n/spawn4.zip

I'll add more examples later...

---------- Post added at 05:02 PM ---------- Previous post was at 03:15 PM ----------

Example of using script with spawned vehicles spawned by createVehicle and BIS_fnc_spawnVehicle:

http://www.filefactory.com/file/a2h76hc/n/spawn5.zip

Share this post


Link to post
Share on other sites

Really sorry I missed that. Many thanks. :)

BTW have you ever come across this situation:

Using the scripts to spawn a squad in chenogorsk, on them spawning half the squad are swimming through the roads. It looks really wierd and I have never seen this before lol

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. :)

I wasn't aware that there was an issue with my UPS script (feel free to email me if you come across stuff like that), but I've looked into it now, and it seems to be related to larger markers.

Once they get over a certain size, it can happen that the AI gets "confused", and sort of collects around the center of the patrol area.

I've uploaded a new version (2.0.5) to my site, that should not show this behavior anymore.

Sorry JW, for hijacking your thread, but I think it's only fair, considering you hijacked my script name... ;)

Share this post


Link to post
Share on other sites

still no joy in getting this to work with a trigger ?

i got a working base and the chopper transporting me to base will drop me off and pickup a small delta team then drop them off at a location where i want them to start patroling so if trigger support could be added i would love you as much as i love my wife if not i will include you in my signature :biggrin_o:

Share this post


Link to post
Share on other sites

JW - The links for the scripts that spawn groups as needed are dead. Would you mind reposting them again as I would like to use it.

Share this post


Link to post
Share on other sites

hey guys i need help with the patrol script for some wierd reason when i enter the script it says "script USPS.sqf not found :( im probably doing somethig stupid

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  

×