kronzky

Urban Patrol Script

172 posts in this topic

Any plans about a headlessClient version? There is one out for Arma2 edited from DetrimentalDave i think and it works good.

No plans on integrating that at this point. I'd rather wait a bit, and see how it develops, before jumping on that too soon...

Can you comment on the issue many have experienced where the enemy AI are in an instant state of agitation (combat behavior) even if they do not know and cannot possibly know that an enemy unit is on the map? It very easy to reproduce. In a previous version of your script, I was able to stop the behavior by commenting out a specific line, but I can't tell you which one right now because I don't have access to the script from where I'm at. Please advise if you can.

I would blame the engine for that, since these behavior modifications seem to come and go randomly (and change from build to build).

I'm not experiencing it in the current version (as you can see from the image above), but if you still do, please PM me a repro mission.

Edited by Kronzky

Share this post


Link to post
Share on other sites
The issue with deleting groups/group leaders, and your suggested test for {isNull _npc} shouldn't really be necessary, as the {!alive _npc} should already catch deleted leaders. Also, if the group is deleted, then the member count should be 0, and that is tested already as well. When I tried deleting groups and leaders from the outside, while UPS was running, it always stopped without any issues or errors.

If you still see problems when deleting stuff from the outside, see if you can give me a simple repro, and I'll have a look.

Hey, I can still repro this with your latest version, using the example mission included in the zip.

I changed one of the enemy squad leaders init to:

alpha = group this;

Along with a 3 line init.sqf file:

thread=[leader alpha,"AZ2","random","trigger"] execVM "ups.sqf";
waitUntil { scriptDone thread; };
hint "done";

When in-game, I tested with these two commands in the console:

{ _x setDamage 1 } forEach units alpha;
{ deleteVehicle _x } forEach units alpha;

Using deleteVehicle, the script thread never ended. The extra isNull workaround I posted still works in the latest.

In some cases in the larger scale mission I'm creating, deleted squads were still being assigned new waypoints every few seconds (with debug markers turned on).

Hope this helps. (this was repro'd using the dev build)

Share this post


Link to post
Share on other sites

As far as the error Pergor is reporting, I can't really reproduce that (perhaps it was a temporary issue that was fixed by the latest update).

And neither could I. ;)

Share this post


Link to post
Share on other sites

WIth version 2.2.0, I can't get the groups to patrol in Safe more with limited speed. This should be the default setting right? Instead the behavious is defaulted to Aware (or combat) and the run around patrolling even tho there is no enemy near.

Init used on group leader: nul=[this,"Power01","RANDOM","NOWAIT"] execVM "UPS.sqf";

Share this post


Link to post
Share on other sites
WIth version 2.2.0, I can't get the groups to patrol in Safe more with limited speed. This should be the default setting right? Instead the behavious is defaulted to Aware (or combat) and the run around patrolling even tho there is no enemy near.

Could it be that you are part of the patrolling side?

In that case you're probably in "Combat" mode yourself (rifle raised), and that will alert them.

Try putting {this setBehaviour "SAFE"} into the player's init line (so you start with the rifle lowered), and see what happens.

If you were just starting on the OPFOR side to observe them, then you can ignore this issue (it won't happen if you're of the other side). Or just spawn as a civilian or animal, and your behavior shouldn't affect theirs.

Edited by Kronzky

Share this post


Link to post
Share on other sites
Could it be that you are part of the patrolling side?

In that case you're probably in "Combat" mode yourself (rifle raised), and that will alert them.

Try putting {this setBehaviour "SAFE"} into the player's init line (so you start with the rifle lowered), and see what happens.

I was having the same issue, and while spawning as a civilian didn't work, the above line in the INIT line did.

Cheers!! :)

Share this post


Link to post
Share on other sites

I am having conflicts with module "site" OP opfor spawned AI firing on UPS patrolling opfor AI, anyone else having this issue?

Share this post


Link to post
Share on other sites
WIth version 2.2.0, I can't get the groups to patrol in Safe more with limited speed. This should be the default setting right? Instead the behavious is defaulted to Aware (or combat) and the run around patrolling even tho there is no enemy near.

Init used on group leader: nul=[this,"Power01","RANDOM","NOWAIT"] execVM "UPS.sqf";

Also have the same issue. UPS units start off and remain in Aware/Combat behavious mode. Is there anyway I can get them into safe mode manually? Adding the behaviour to the init did nothing.

Further testing:

Created a waypoint (on act 'nul=[this,"TechPatrol","NOWAIT","NOSLOW"] execVM "UPS.sqf";' // Behaviour: Safe // Speed: Limited)

No success, unit stays in Aware/Combat mode.

Version 2.2.0 / A3 v1.6

Edited by whiztler

Share this post


Link to post
Share on other sites

Hello, I was making a mission with this script and when i would see the enemy and start shooting at them. They would point their guns at me "aware of my position and knowing that i am an enemy" and they wont shoot at me. This also happens when i put the difficulty up. Any answers why this happens. My guess was the awareness time or they were set to Careless.

Share this post


Link to post
Share on other sites
Hello, I was making a mission with this script and when i would see the enemy and start shooting at them. They would point their guns at me "aware of my position and knowing that i am an enemy" and they wont shoot at me. This also happens when i put the difficulty up. Any answers why this happens. My guess was the awareness time or they were set to Careless.

What was your distance? I`m guessing somewhere in their logic they may think it too far to get a hit and not want to waste ammo. They may also think to flanking you and try to gain the advantage before opening fire. The buggers have done this to me and my friends a few times. Thought we killed all the group, later to find one of them had run off, circled back and shot us from behind!

Share this post


Link to post
Share on other sites
What was your distance? I`m guessing somewhere in their logic they may think it too far to get a hit and not want to waste ammo. They may also think to flanking you and try to gain the advantage before opening fire. The buggers have done this to me and my friends a few times. Thought we killed all the group, later to find one of them had run off, circled back and shot us from behind!

They were right in front of me. And they would just lay down and watch me for 5 min and do absolutely nothing

Share this post


Link to post
Share on other sites

Did anyone resolve the issue regarding units going into combat mode despite no hostile units being anywhere near the patrolling unit?

Share this post


Link to post
Share on other sites
Did anyone resolve the issue regarding units going into combat mode despite no hostile units being anywhere near the patrolling unit?

Did you read the suggestions here?

WIth version 2.2.0, I can't get the groups to patrol in Safe more with limited speed. This should be the default setting right? Instead the behavious is defaulted to Aware (or combat) and the run around patrolling even tho there is no enemy near.

Could it be that you are part of the patrolling side?

In that case you're probably in "Combat" mode yourself (rifle raised), and that will alert them.

Try putting {this setBehaviour "SAFE"} into the player's init line (so you start with the rifle lowered), and see what happens.

If you were just starting on the OPFOR side to observe them, then you can ignore this issue (it won't happen if you're of the other side). Or just spawn as a civilian or animal, and your behavior shouldn't affect theirs.

Share this post


Link to post
Share on other sites

Hey everyone, I tried to use this script on my mission but even though I've done everything it needs to be done, the AI won't move at all.

Here is what I did:

I put the .sqf in my mission's folder.

In-game I created a marker named "zone".

I put 4 OPFOR groups in the marker with this command in the init field of all leaders: nul=[this,"zone"] execVM "ups.sqf"

Am i missing something?

Share this post


Link to post
Share on other sites

IDK what you may be missing but we faced the exact same issue past night, you're not alone JD. Interested too by any enlightement.

Share this post


Link to post
Share on other sites

I have a problem with the cloning option. I have read the entire thread, searched the internet and have experimented in the editor for well over an hour but I cannot find the solution.

I have created a 50 x 150 meter rectangular marker ("ptrarea") and a three-man team to patrol it. I can make the team patrol the area, use random spawn locations, and use the nomove argument with no problems, but when I try to use the clone argument, something fails. I call the script using the following code in the team leader's init line:

nul = [this, "ptrarea", "random", "min:4/max:6"] execVM "UPS.sqf";

I have also tried "MIN:4/MAX:6", "4/6", "min 4/ max 6" but nothing works. I have also tried using a larger area in case there is some minimum distance needed to spawn multiple clones, but to no avail.

This seems like an excellent script which would help me endlessly in mission-crafting, but I could really use the cloning function... Any help is greatly appreciated!

Share this post


Link to post
Share on other sites

It's working well now but when I add this script to my mission there's a lot of lag and stuttering, when I remove it the game runs smoothly again, anyone has this problem?

Share this post


Link to post
Share on other sites
I have a problem with the cloning option. I have read the entire thread, searched the internet and have experimented in the editor for well over an hour but I cannot find the solution.

I have created a 50 x 150 meter rectangular marker ("ptrarea") and a three-man team to patrol it. I can make the team patrol the area, use random spawn locations, and use the nomove argument with no problems, but when I try to use the clone argument, something fails. I call the script using the following code in the team leader's init line:

nul = [this, "ptrarea", "random", "min:4/max:6"] execVM "UPS.sqf";

I have also tried "MIN:4/MAX:6", "4/6", "min 4/ max 6" but nothing works. I have also tried using a larger area in case there is some minimum distance needed to spawn multiple clones, but to no avail.

This seems like an excellent script which would help me endlessly in mission-crafting, but I could really use the cloning function... Any help is greatly appreciated!

nul = [this, "ptrarea", "random", "min:", 4,"max:", 6"] execVM "UPS.sqf";

I think that's the correct syntax.

Share this post


Link to post
Share on other sites
nul = [this, "ptrarea", "random", "min:", 4,"max:", 6"] execVM "UPS.sqf";

I think that's the correct syntax.

Remove the " to the last part

nul = [this, "ptrarea", "random", "min:", 4,"max:", 6] execVM "UPS.sqf";

Share this post


Link to post
Share on other sites

Hi, first of all thank you for your wonderful script.

I have a similar problem as some other that posted here.

(Nearly?) all the patrols start in combat mode. The patrols are on CSAT and civilians side, players are on NATO side. I am pretty sure the problem was already present without the civilians.

I used some other script (F3 and BTC revive) maybe there is some kind of conflict.

Edit : Here is the link to the mission, if it can help you

https://dl.dropboxusercontent.com/u/42129569/coop14_assault_on_syrta_v1-0.7z

Edited by VladTepes

Share this post


Link to post
Share on other sites

Placed markers where units will patroul are shown for me in the briefing section, i remember that this was not the case as i used this script for arma 2. am i doing something wrong?

Share this post


Link to post
Share on other sites

It is normal, you have to add some line to the init.sqf or use triggers instead of zones.

From UPS.Arma 3 Readme

• If you want to avoid the area marker to be seen during the pre-mission briefing,

you can add the following line to your init.sqf:

"markername" setMarkerPos [-(getMarkerPos "markername" select 0),-(getMarkerPos "markername" select 1)];

• You can use a trigger, instead of a markers, to designate the active area.

In that case the trigger should be named, and the script would be called with the

trigger object as the area parameter: e.g. nul=[this,citytrigger] execVM "ups.sqf"

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