Jump to content
kronzky

Urban Patrol Script

Recommended Posts

Hello

I was hoping I could get some help. (I'm not a coder so you might have to spell this out for me.)

What I'm trying to do:

I'm trying to created groups of AI that will spawn at certain locations, patrol, then re-spawn after they are killed. (ie like bandits/soldier ai in dayz epoch) I'm trying to use Kronzy's script with an ai re-spawn script that supposed to work with UPS (armaholic dot com/page.php?id=6540) (sorry can't post links yet)

Mission set up:

BlueFor/OpFor for players and independents as AI.

Issues

The respawn script says to post this in the group leader init:

nul = [this, 3, 10, "E_Spawn","East_Patrol"] execVM "AI_respawn_UPS\AI_respawn_UPS_init.sqf";

Kronzy's script says to post this in the group leader init:

nul=[this,"East_Patrol","NOWAIT","NOSLOW"] execVM "ups.sqf"

(yes I want to use the nowait and noslow commands, otherwise they stand around until enemy's come by)

So how do I go about doing this?

Any help would be really appreciated. Thanks.

Share this post


Link to post
Share on other sites

This is awesome man, use it all the time and credits in my mission.

One bug i'm sure its probably been mentioned but if not:

The RANDOMDN script doesnt seem to work. It spawns the units outside of houses and has them do a regular portal just lke RANDOM does. This would be helpful if fixed so i dont have to place units inside house manually :)

Share this post


Link to post
Share on other sites

Just chiming in to say that the combat/aware thing is still happening. I have two patrols who instantly go into combat, but the others appear to work fine. I think they're spawned slightly too close to the enemy, but moving them further didn't seem to do anything.

I do have a mix of sides patrolling, if that's any help. Independent is friendly to everyone, OPFOR and BLUFOR are hostile.

Share this post


Link to post
Share on other sites
Hey L3,

Is it possible to spawn your groups one at a time, and before the enemy enters their patrol marker area? I have this experienced this a lot and did some minor testing I posted about on Armaholic.

http://www.armaholic.com/forums.php?m=posts&p=155371#155371

I could, but that's really more of a PITA than it's worth. No enemy enters the zone for a while.

I do have a couple of overlapping zones.

It looks like you have to make sure to put *every* unit that's in a zone to setBehaviour "SAFE" or make them a UPS patrol even if they're not intended to be patrolling. With a bit of creative "NOMOVE" things work out pretty well.

Share this post


Link to post
Share on other sites

The script seems to not work when I use CAF Aggressors, is this just for me or does this script only work for CSAT forces?

Share this post


Link to post
Share on other sites

has anyone been able to use this with headless client?

Share this post


Link to post
Share on other sites

At first I want to say thanks Kronzky for this great script.

The script seems to not work when I use CAF Aggressors, is this just for me or does this script only work for CSAT forces?

I am using this with CAF Agressors 1.5 and it works actually quite well, only thing I am figuring is that cloned units dont recieve the same equipment as the parent unit. If I assign a NV Goggle to the original unit so the clones wont have some...how can I fix that?

EDIT:

in the script there´s the part where the clones are getting created (line 469 and around), but they dont recieve the NVGoggles although the actual unit get one. What do I have to do to become the clones equipped with NVGoggles as well?

I tried this but it doesnt work:

{
		_c=_c+1;
		if (_c>1) then {
			_newunit = _grp createUnit [typeof _x, getpos _x, [],0,"form"];
			KRON_cloneindex = KRON_cloneindex+1;
			_newunit setVehicleVarName format["%1%2",_nameprefix,KRON_cloneindex];
			call compile format["%1%2=_newunit",_nameprefix,KRON_cloneindex];
			_newunit setBehaviour _orgMode;
			_newunit setSpeedMode _orgSpeed;
			_newunit setSkill skill _x;
			[b][color="#FF0000"]_newunit addWeapon "NVGoggles"; [/color][/b] [color="#0000FF"]I also tried this: _newunit addWeapon {NVGoggles}; [/color]
			//_newunit setVehicleInit _initstr;
			[_newunit] join _grp;
		};

any advices in this matter?

Edited by MemphisBelle

Share this post


Link to post
Share on other sites

NVGoggles are now a linked item, ie. you need to linkitem

e.g.

//Give Unit Essential items
{_newunit linkItem _x} forEach ["ItemWatch", "ItemGPS", "ItemRadio", "ItemCompass", "ItemMap", "NVGoggles"];_newunit addweapon "Binocular";

However, NVGoggles are also now side dependant.

where side = linkitem name

for

Opfor it's "NVGoggles_OPFOR"

Independant it's "NVGoggles_INDEP"

BluFor it's "NVGoggles"

therefore you'd need to add something like this.

N.B. This will remove NVGoggles if it's daylight hours and only assign them at night, or if night is approaching.

if ("NVGoggles" in assignedItems _x) then {_x unlinkitem "NVGoggles";_x removeitem "NVGoggles";};
if ("NVGoggles_OPFOR" in assignedItems _x) then {_x unlinkitem "NVGoggles_OPFOR";_x removeitem "NVGoggles_OPFOR";};
if ("NVGoggles_INDEP" in assignedItems _x) then {_x unlinkitem "NVGoggles_INDEP";_x removeitem "NVGoggles_INDEP";};
if ((date select 3) < 6 or (date select 3) > 18)
then {
	if (side _newunit == EAST) then {_newunit linkitem "NVGoggles_OPFOR";};
	if (side _newunit == WEST) then {_newunit linkitem "NVGoggles";};
	if (side _newunit == RESISTANCE) then {_newunit linkitem "NVGoggles_INDEP";};
	};

Edited by Beerkan

Share this post


Link to post
Share on other sites
....

Thanks for this, do I simply put this right into the code block like this?

{
_c=_c+1;
if (_c>1) then {
_newunit = _grp createUnit [typeof _x, getpos _x, [],0,"form"];
KRON_cloneindex = KRON_cloneindex+1;
_newunit setVehicleVarName format["%1%2",_nameprefix,KRON_cloneindex];
call compile format["%1%2=_newunit",_nameprefix,KRON_cloneindex];
_newunit setBehaviour _orgMode;
_newunit setSpeedMode _orgSpeed;
_newunit setSkill skill _x;
//Give Unit Essential items
       [color="#FF0000"]{_newunit linkItem _x} forEach["ItemWatch", "ItemGPS", "ItemRadio", "ItemCompass", "ItemMap", "NVGoggles"];
       _newunit addweapon "Binocular";  
       if (side _newunit == EAST) then {_newunit linkitem "NVGoggles_OPFOR";};
       if (side _newunit == WEST) then {_newunit linkitem "NVGoggles";};
       if (side _newunit == INDEP) then {_newunit linkitem "NVGoggles_INDEP";};  
[/color]//_newunit setVehicleInit _initstr;
[_newunit] join _grp;
		};

Share this post


Link to post
Share on other sites

Well the following lines were just showing an example of how to use the new linkitems on a unit.

If you're going to add my suggestion into the code, then don't use these lines

{_newunit linkItem _x} forEach["ItemWatch", "ItemGPS", "ItemRadio", "ItemCompass", "ItemMap", "NVGoggles"];
_newunit addweapon "Binocular";

Share this post


Link to post
Share on other sites

If you want to account for daylight hours, change the lines as below. With this change NVGoggles will now be assigned only during night time, or if night time is approaching. They will be removed during daylight hours.

Put this code in

if ("NVGoggles" in assignedItems _x) then {_x unlinkitem "NVGoggles";_x removeitem "NVGoggles";};
if ("NVGoggles_OPFOR" in assignedItems _x) then {_x unlinkitem "NVGoggles_OPFOR";_x removeitem "NVGoggles_OPFOR";};
if ("NVGoggles_INDEP" in assignedItems _x) then {_x unlinkitem "NVGoggles_INDEP";_x removeitem "NVGoggles_INDEP";};
if ((date select 3) < 6 or (date select 3) > 18)
then {
	if (side _newunit == EAST) then {_newunit linkitem "NVGoggles_OPFOR";};
	if (side _newunit == WEST) then {_newunit linkitem "NVGoggles";};
	if (side _newunit == RESISTANCE) then {_newunit linkitem "NVGoggles_INDEP";};
	};

Note the change of INDEP to RESISTANCE.

Edited by Beerkan

Share this post


Link to post
Share on other sites

Hi all,

I'm trying to use UPS in one of my missions.

All is going well, the units I want are patrolling the area, however as soon as I place an enemy unit they go out of "safe" mode and start acting like they are taking contact.

The enemy troops I am placing are over 1km away and through tree lines so there is no way they can be seen.

Any ideas or suggestions on what I'm doing wrong?

I've made no amendments to the script and am using the below in the unit Init line

nul=[this,"Alpha"] execVM "ups.sqf"

The marker is name Alpha

Thanks

Share this post


Link to post
Share on other sites
Hi all,

I'm trying to use UPS in one of my missions.

All is going well, the units I want are patrolling the area, however as soon as I place an enemy unit they go out of "safe" mode and start acting like they are taking contact.

The enemy troops I am placing are over 1km away and through tree lines so there is no way they can be seen.

Any ideas or suggestions on what I'm doing wrong?

I've made no amendments to the script and am using the below in the unit Init line

nul=[this,"Alpha"] execVM "ups.sqf"

The marker is name Alpha

Thanks

I have the same problem.

Are you using the latest UPS Script?

UPS v2.2.0 for ArmA3.zip

Yes, the problem persists.

Share this post


Link to post
Share on other sites

I am also having that problem with the AI constant in combat when patrolling. When I delete all OPFOR from the map, it will worked fine. As soon as I put 1 bluefor person on the map doesn't matter where at. The AI will change to combat/weapons up while hes running.

Share this post


Link to post
Share on other sites

Hi Kronsky

Thanks for the script.

I have 3 questions actually.

1; im curious why this script is under user missions tab and not mission editing and scripting?wouldnt that be better?

2;Does this script interfere with bcombat or vice versa?

3;Is it ok to set patrolling groups to show/hide in the editor without any side effect?

Thanks again for extremely good tool for mission making

---------- Post added at 12:53 ---------- Previous post was at 12:02 ----------

Also having the problem with enemy in combat mode whenever other faction in map

Share this post


Link to post
Share on other sites

Is there way to use this script with the Spawn AI Module in the editor? (Modules/Misc/Spawn AI) I really would like to use this script with the module, but I just can't get the hang of it.

Share this post


Link to post
Share on other sites
Is there way to use this script with the Spawn AI Module in the editor? (Modules/Misc/Spawn AI) I really would like to use this script with the module, but I just can't get the hang of it.

There's an initialisation line in the module, you can call UPS from there.

(Not at my A3 PC, so I can't tell you in detail)

Share this post


Link to post
Share on other sites

Was not able to identify this issue thrugh the 15 pages.

Really enjoy this script, and it has worked well for lan games. That being said, my friends are taking it to a new level with a server and this script is not working on our server atm. Thoughts?

Share this post


Link to post
Share on other sites

I have the combat mode issue too. Units patrol fine as long as they are on their own. But as soon as they see any other unit, be it friendly or civilian, they go into combat mode. However they don't react that way to the player or other UPS patrols. Makes this nice scripts quite useless :(

Edited by Raptor4223

Share this post


Link to post
Share on other sites

Kron, Thanks for this.

LOVED it in every iteration of Arma.

Thanks for this great work.

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

×