Jump to content
Sign in to follow this  
Monsada

UPSMON - Urban Patrol Script Mon

Recommended Posts

Ok here is another problem i found. When i put the marker down. They will stand exactly where i put that marker when they are patrolling. I have to make the marker bigger for them to actually patrol. so for example this is what my markers look like:

http://s294.photobucket.com/albums/mm113/gobigred5/?action=view&current=arma2oa2010-11-2500-07-14-40.jpg

How do I make it them patrol without the marker being HUGE?

Make it rectangular or ellipse. :)

Share this post


Link to post
Share on other sites
Make it rectangular or ellipse. :)

ugh. I know this, but while we are on this topic, is it possible to make them so called "Invisible" to see on the map. As i dont want my teamates seeing it on the map and be able to pick the ambush or patrol location.

Share this post


Link to post
Share on other sites
ugh. I know this, but while we are on this topic, is it possible to make them so called "Invisible" to see on the map. As i dont want my teamates seeing it on the map and be able to pick the ambush or patrol location.

In upsmon.sqf there is at top this line

// showmarker = Display the area marker.

So by that area markers should always be turned off, tho it seems it doesnt work by defeault, you may try activate it, maybe its reverse, havent tested that myself.

nul=[this,"NNDL_fallujah_Ncity","RANDOMDN","respawn","showmarker"] execvm "scripts\UPSMON.sqf";

I solved showing markers in login area for players by editing mission with normal markers, and when i was done with mission i changed all my patrol areas to the icon empty(wich doesnt show on map for players, but are huge in editor) then i changed them back to rectangle in mission by using a trigger 2 min out ingame just incase.

I made a trigger on top of one of my bluefor units already placed in editor.

condition bluefor present, timeout 120 120 120.

in on activation field i had: nul = exeVM "change_markers.sqf";

change_markers.sqf

"NNDL_fallujah_Ncity" setMarkerShape "RECTANGLE";
"NNDL_fallujah_Ncity" setMarkerSize [1400, 2300];  //my empty icon is same size in editor
"NNDL_fallujah_Ncity" setMarkerDir 90;  //my empty icon is same direction(0-360) in editor
"NNDL_fallujah_Ncity" setMarkerText "";
"NNDL_fallujah_Ncity" setMarkerColor "Default";

Share this post


Link to post
Share on other sites

Demonized, are you sure the standard version doesn't work? I've played UPSMON in MP many times now, and they never show in the map screen if you do as follows:

In editor, make a game logic. In init, put

_anyName = [] execVM "scripts\markerAlpha.sqf" - so long as you have a folder with the script in it.

Make a markerAlpha.sqf with wordpad in the correct folder. In here, for each marker name, put

"markerName" setMarkerAlpha 0;

continue until all markers are done.

This seems to eradicate the problem whereby putting the same lines in the init.sqf, some markers still showed visible in some screens, for some time.

Edited by SCAJolly
changed "game" for "editor"

Share this post


Link to post
Share on other sites
Demonized, are you sure the standard version doesn't work? I've played UPSMON in MP many times now, and they never show in the map screen if you do as follows:

In editor, make a game logic. In init, put

_anyName = [] execVM "scripts\markerAlpha.sqf" - so long as you have a folder with the script in it.

Make a markerAlpha.sqf with wordpad in the correct folder. In here, for each marker name, put

"markerName" setMarkerAlpha 0;

continue until all markers are done.

This seems to eradicate the problem whereby putting the same lines in the init.sqf, some markers still showed visible in some screens, for some time.

Nice tip, ty will deff do that, saves alot of hassle :)

Edit: did the setmarkeralpha thing as SCAJolly said, worked nicely, oh man that saved me alot of work :yay:

Edited by Demonized

Share this post


Link to post
Share on other sites

Demon, I tried altering the stuff you mentioned. For some reason, I can't get this to work:

_sMarker = this select 0;

_sObj1 = this select 1;

_sObj2 = this select 2;

_sTrig = this select 3;

{

_sMarker setMarkerPos getMarkerPos _sObj1;

IF triggeractivated _sTrig THEN

{

_sMarker setMarkerPos getMarkerPos _sObj2;

};

};

With or without quotes around _smarker and _sobj, it doesn't want to work. That is, the SCRIPT works. The patrol, however, does not follow the marker to its new location.

Share this post


Link to post
Share on other sites

Demon, I tried altering the stuff you mentioned. For some reason, I can't get this to work:

_sMarker = this select 0;

_sObj1 = this select 1;

_sObj2 = this select 2;

_sTrig = this select 3;

{

_sMarker setMarkerPos getMarkerPos _sObj1;

IF triggeractivated _sTrig THEN

{

_sMarker setMarkerPos getMarkerPos _sObj2;

};

};

With or without quotes around _smarker and _sobj, it doesn't want to work. That is, the SCRIPT works. The patrol, however, does not follow the marker to its new location.

If i understand correctly, you are able to move the patrolmarkers, you have confirmed that with showmarkers or some other way, so you actually see marker has been moved?

Is sObj1 and 2 a marker or unit? if not a marker and a unit or object you need to do this:

marker to unit or object:

 _anymarker setMarkerPos getPos _anyObjectorUnit;

for marker to marker:

 _anymarker setMarkerPos getMarkerPos _anyothermarker;

Patrols should redirect to it since they are patrolling that exact marker, but there is a time until they assign new wp, shorter if in combat, 60 secs or 120 secs when not in combat i think.

Edit 2: group will complete last wp set by upsmon before moving to next wp(in the moved markerarea) so if you have a big marker and group is moving say 2000m they will move to next markerarea after they have moved their first original wp.

Edit: I did test on UPSMON on utes,

had a group with "showmarker" in params, so i could see the marker named airport move. then invicible h named test.

had a trigger with radio india with

"airport" setMarkerPos getPos test;

Started mission, watched ai start patrol on airport at placed position. then i activated radio india(moving marker) saw marker move on map, also ai entered nearby empty car and drove to new pos.... all worked ok as it should. think your error is in your execVM in editor. remember all "markers" and all objects/units note the " around marker name.

When defined in a script by _marker = _this select 0; the " is stored in _marker so no need for it there. only in scripts.

Its late, not sure if this makes any sense..

Edited by Demonized
did test

Share this post


Link to post
Share on other sites
Demonized, are you sure the standard version doesn't work? I've played UPSMON in MP many times now, and they never show in the map screen if you do as follows:

In editor, make a game logic. In init, put

_anyName = [] execVM "scripts\markerAlpha.sqf" - so long as you have a folder with the script in it.

Make a markerAlpha.sqf with wordpad in the correct folder. In here, for each marker name, put

"markerName" setMarkerAlpha 0;

continue until all markers are done.

This seems to eradicate the problem whereby putting the same lines in the init.sqf, some markers still showed visible in some screens, for some time.

This really needs to be put in a readme or in the wiki

Share this post


Link to post
Share on other sites
Alright then, the damned AI is still leaving it's patrol zone no matter what I do, I want them to patrol but I wish I could take a shot without every patrol, even those with nofollow and fortify rushing towards me. It is ruining the mission pacing.

"nofollow" did not work for me either - the AI left the zone.

"fortify" does work, however, the AI always seem slow to react - I found the RandomHouse patrol to be better, in fact, using RandomHouse patrol, with upsmon is even better (thanx for the advice Galzohar).

how to do it -

give the men patrolling the house the random patrol script in their init line, but make them invincible until they are engaged by or spot enemy (you) [i do this bcoz for some reason the AI tend to injure themselves walking around buildings].

also add upsmon "nowp" to their init line and make their marker zone the village they are in for example.

what happens is this -

1. they patrol the building randomly until they spot you or are fired on at which point they stop patrolling and engage you.

2. they will then radio in support from other AI.

3. at some point they will also leave their building and try to hunt you down.

4. once the firefight is over they will resume patrol of the house.

really solid script combination for AI.

Share this post


Link to post
Share on other sites

"nofollow" did not work for me either - the AI left the zone.

"fortify" does work, however, the AI always seem slow to react - I found the RandomHouse patrol to be better, in fact, using RandomHouse patrol, with upsmon is even better (thanx for the advice Galzohar).

how to do it -

give the men patrolling the house the random patrol script in their init line, but make them invincible until they are engaged by or spot enemy (you) [i do this bcoz for some reason the AI tend to injure themselves walking around buildings].

also add upsmon "nowp" to their init line and make their marker zone the village they are in for example.

what happens is this -

1. they patrol the building randomly until they spot you or are fired on at which point they stop patrolling and engage you.

2. they will then radio in support from other AI.

3. at some point they will also leave their building and try to hunt you down.

4. once the firefight is over they will resume patrol of the house.

really solid script combination for AI.

Very nice tip, was sure that i could not use housepatrol with upsmon, never thought of this way. will deffinetly try this out.

Share this post


Link to post
Share on other sites

"nofollow" seems to sometimes work and sometimes not. I think the main problem here is that while UPSMON will not give the group waypoints outside of the designated area, if the group leader spots an enemy he will still order his soldiers to engage that enemy and this will allow them to leave the zone. However if you're far enough from the patrolling group so that they do not detect you, they will stay in their zone regardless of what other groups you are engaging. At least that's what seems to be happening during my tests.

Setting their combat mode to not engage doesn't help, most likely because UPSMON changes it back at some point.

Share this post


Link to post
Share on other sites
"nofollow" seems to sometimes work and sometimes not. I think the main problem here is that while UPSMON will not give the group waypoints outside of the designated area, if the group leader spots an enemy he will still order his soldiers to engage that enemy and this will allow them to leave the zone. However if you're far enough from the patrolling group so that they do not detect you, they will stay in their zone regardless of what other groups you are engaging. At least that's what seems to be happening during my tests.

i think this sounds like it could be true based on my tests - its when they have seen me that they will move out to engage and flank - if that is the answer then thats cool - as long as we understand how it works we work with it.

i have tended to use "nomove" to prevent AI from abandoning the areas i want them to protect regardless of radio information passed from other AI. i will test "nofollow" some more and report my findings.

Share this post


Link to post
Share on other sites

"nomove" was never meant to do what you want. It just makes the AI not move until they have knowledge of enemy, and after that they also don't move as much as normal UPSMON squads. But they can change to a new position that can be pretty far away from their original.

Share this post


Link to post
Share on other sites

Hi,

Is there a way I can call UPSMON upon spawned units? I'm not really sure where to start. I've looked at Bsilenceds scripts and I'm still not sure. I will need to adapt this script to call UPSMON:

Infantry_US =
{
_attack = call random_ground;
_grp = createGroup west;sleep 0.05;

_unit = _grp createUnit [otherW select 0, _attack, [], 30, "FORM"];sleep 0.05;
_unit = _grp createUnit [otherW select 1, _attack, [], 30, "FORM"];sleep 0.05;
_unit = _grp createUnit [otherW select 2, _attack, [], 30, "FORM"];sleep 0.05;
_unit = _grp createUnit [call random_unitW, _attack, [], 30, "FORM"];sleep 0.05;
_unit = _grp createUnit [call random_unitW, _attack, [], 30, "FORM"];sleep 0.05;
_unit = _grp createUnit [call random_unitW, _attack, [], 30, "FORM"];sleep 0.05;
if(MoreAIs) then {
_unit = _grp createUnit [otherW select 5, _attack, [], 30, "FORM"];sleep 0.05;
_unit = _grp createUnit [call random_unitW, _attack, [], 30, "FORM"];sleep 0.05;
_unit = _grp createUnit [call random_unitW, _attack, [], 30, "FORM"];sleep 0.05;
_unit = _grp createUnit [call random_unitW, _attack, [], 30, "FORM"];sleep 0.05;
};

_grp allowfleeing 0;
_waypoint = _grp addWaypoint [[getmarkerpos "enemy_up" select 0,getmarkerpos "enemy_up" select 1,2], 0];
_waypoint setWaypointType "HOLD";
_waypoint setWaypointFormation "DIAMOND";
};

Thanks,

H

Share this post


Link to post
Share on other sites
Does this only work with the island Utes?

It works with any island afaik, i have tried several usermade islands and all the official ones, upsmon works.

@Hellfire257

for upsmon always make sure you add "spawned" into upsmon initline for spawned units: example:

nul=[this,"grppatrolmarker","move","spawned"] execVM "scripts\UPSMON.sqf";

also for your script i think maybe it will work if you just add this below your setWaypointFormation line

_waypoint setWaypointStatements ["true", "nul=[this,'patrolmarkername','spawned','move'] execvm 'scripts\UPSMON.sqf'"];

Anyhow, this below is scripts ive used and know works. 2versions, createunit and functions

this is what i used to spawn units with createunit and using upsmon

if (isServer) then {

//team 1
//CREATE GENERIC GROUP
nnEgrp13 = createGroup east;
//CREATE LEADER
_unit1 = "TK_INS_Soldier_TL_EP1" createUnit [getPos area4grp, nnEgrp13, "nnEgrp13=This",0.5,"Sergeant"];
_unit2 = "TK_GUE_Soldier_EP1" createUnit [getPos area4grp, nnEgrp13, "",0.4,"Corporal"];
_unit3 = "TK_GUE_Soldier_AT_EP1" createUnit [getPos area4grp, nnEgrp13, "",0.4,"Private"];
_unit4 = "TK_INS_Soldier_2_EP1" createUnit [getPos area4grp, nnEgrp13, "",0.4,"Private"];
_unit5 = "TK_INS_Soldier_EP1" createUnit [getPos area4grp, nnEgrp13, "",0.4,"Private"];
_unit6 = "TK_INS_Soldier_EP1" createUnit [getPos area4grp, nnEgrp13, "",0.4,"Private"];

//set their skill
//sleep 3;
{_x setSkill 0.6 + (random 0.4)} forEach Units Group nnEgrp13;

//start random placement and patrol
//sleep 3;
nul=[nnEgrp13,"spawnarea4","spawned","Ambush2"] execvm "scripts\UPSMON.sqf";
};
//END

this is what i used with BIS_fnc_spawnGroup, i added some help lines for you in script, also make sure you have the function module placed on map in editor and also here is link to info on BIS_fnc_spawngroup

http://community.bistudio.com/wiki/BIS_fnc_spawnGroup

_units = [];
_side = east;
waituntil {BIS_fnc_init};

if (isServer) then
{
   _random = floor(random 2);
   //select random from 3 editor placed units or objects, in this case invicible h´s
   _spawn = [spawn1, spawn2, spawn3] select _random;

   _group = floor(random 3);

   //select random line and 1st unit is spawned as leader, 45% chance to be spawned for rest of units in choosen array. array units can be added or removed but only East side can be spawned in east groups and same for west, guer, civ.
   switch (_group) do {
       case 0: {_units = ["TK_INS_Soldier_AA_EP1", "TK_INS_Soldier_AR_EP1", "TK_INS_Bonesetter_EP1", "TK_INS_Soldier_MG_EP1", "TK_INS_Soldier_2_EP1", "TK_INS_Soldier_EP1", "TK_INS_Soldier_4_EP1", "TK_INS_Soldier_3_EP1", "TK_INS_Soldier_AAT_EP1", "TK_INS_Soldier_AT_EP1", "TK_INS_Soldier_Sniper_EP1", "TK_INS_Soldier_TL_EP1", "TK_INS_Warlord_EP1"];};
       case 1: {_units = ["TK_INS_Soldier_AA_EP1", "TK_INS_Soldier_AR_EP1", "TK_INS_Bonesetter_EP1", "TK_INS_Soldier_MG_EP1", "TK_INS_Soldier_2_EP1", "TK_INS_Soldier_EP1", "TK_INS_Soldier_4_EP1", "TK_INS_Soldier_3_EP1", "TK_INS_Soldier_AAT_EP1", "TK_INS_Soldier_AT_EP1", "TK_INS_Soldier_Sniper_EP1", "TK_INS_Soldier_TL_EP1", "TK_INS_Warlord_EP1"];};
       case 2: {_units = ["TK_INS_Soldier_AA_EP1", "TK_INS_Soldier_AR_EP1", "TK_INS_Bonesetter_EP1", "TK_INS_Soldier_MG_EP1", "TK_INS_Soldier_2_EP1", "TK_INS_Soldier_EP1", "TK_INS_Soldier_4_EP1", "TK_INS_Soldier_3_EP1", "TK_INS_Soldier_AAT_EP1", "TK_INS_Soldier_AT_EP1", "TK_INS_Soldier_Sniper_EP1", "TK_INS_Soldier_TL_EP1", "TK_INS_Warlord_EP1"];};
       case 3: {_units = ["TK_INS_Soldier_AA_EP1", "TK_INS_Soldier_AR_EP1", "TK_INS_Bonesetter_EP1", "TK_INS_Soldier_MG_EP1", "TK_INS_Soldier_2_EP1", "TK_INS_Soldier_EP1", "TK_INS_Soldier_4_EP1", "TK_INS_Soldier_3_EP1", "TK_INS_Soldier_AAT_EP1", "TK_INS_Soldier_AT_EP1", "TK_INS_Soldier_Sniper_EP1", "TK_INS_Soldier_TL_EP1", "TK_INS_Warlord_EP1"];};
   };
   //[1,0.45] = [minimum_units_spawned,% where 1 is 100% and 0.60 is 60% of additional units spawned]
   _spawngroup = [getpos _spawn, _side, _units, [],[],[0.5,0.8],[],[1,0.45]] call BIS_fnc_spawnGroup;

   //set waypoint of spawned group, wich here is same location as the group was spawned, very close maybe 1 m.
   _wp = _spawngroup addWaypoint [getpos _spawn, 0];
   _wp setWaypointType "MOVE";
   _wp setWaypointSpeed "FULL";
   _wp setWaypointBehaviour "AWARE";
   _wp setWaypointFormation "LINE";
   //below is setting what happens when wp is done, what you would set in a waypoint in editor.
   //also note that for spawned units you need the "spawned" param in upsmon init line, and also note use of ' instead of " when inside command in below script line,
   [_spawngroup,1] setWaypointStatements ["true", "nul=[this,'NNDL_ao','spawned','move','RANDOM','reinforcement'] execvm 'scripts\UPSMON.sqf'"];
};

instead of using waypoints in BIS_fnc_spawnGroup, you can simply use this line instead of adding wp in script

_leader = leader _spawngroup ;  //get leader of group.

nul=[_leader,_grppatrolmarker,"spawned","move","reinforcement"] execvm "scripts\UPSMON.sqf";  // start upsmon for leader _grp (whole grp)

Edit: Always make sure you have declared a side in mission,

easiest way is to place 1 unit of each side units you will be using in editor, and set their probability slider to 0, then these will never be in mission, but sides is created for spawned units upon mission start.

i add 1 of west,east,civ,guer to my missions, then all sides are covered and if and when i change mission during editing, this is never a problem i need to find out about.. :)

Edited by Demonized
corrected personal scriptuse in first initline example, it was groupeject.sqf when it should be upsmon.sqf

Share this post


Link to post
Share on other sites

I have made a script for AI to use flares, and it works perfectly together with upsmon.

Idea to using this together with UPSMON stems from Lightspeed_aust previous post about using housepatrol together with UPSMON.

Update: flare now gives actual light so AI will see in the dark while flare is on the sky.

here is my thread with info how too and scripts:

http://forums.bistudio.com/showthread.php?p=1804029#post1804029

Also a suggestion to UPSMON creator, could you make AI use flares, either by this script or something similar, Carl Gustafa has posted some very useful info, and more complex on this matter aswell.

Edited by Demonized
Added credits to Lightspeed_aust - post updated

Share this post


Link to post
Share on other sites

There's no point of AI using flares as they do not benefit from them. The only one who benefits from flares are human players. When it comes to lighting conditions, AI detection seems to be strictly dependent on date and time of day (and island).

Share this post


Link to post
Share on other sites
There's no point of AI using flares as they do not benefit from them. The only one who benefits from flares are human players.

And "realism". Guards with flares who think they have detected someone would pop flares. Not using them in a mission because the computer doesn't care is kinda silly.

Share this post


Link to post
Share on other sites

But then again enemy helping you win isn't realistic either. Maybe as an option, but definitely not something I would like to see as default behavior.

Share this post


Link to post
Share on other sites

IIRC, the AI does make use of lighting, since some patches.

€dit Lighting, not lightning lol (god AI ftw)

Share this post


Link to post
Share on other sites

Regarding my previous post 1 page back:

Have edited post.

I was not aware of thet flares didnt give AI light as it appeared so from player POV.

Silly BIS.. :)

In my script now, flares are giving AI actual light, AI will see in the dark now when a flare is up on the sky., using EH.

Flare is no longer just eye candy for players.

Also added optional line to include in init.sqf so that any player firing a flare will also give AI light while flare is in the air.

Tnx to info and example scripts from Carl Gustafa.

Link to forum post with script 1 page back

Share this post


Link to post
Share on other sites

After someone claimed a recent patch have affected AI's reaction to lighting, I re-did the test which went as follows:

- Place AI facing each other at night without nightvision for either. See if they shoot eachother. If they do, move them further away and test again. If they don't, move them closer together. Repeat until they are just a tad further than the largest distance at which they shoot.

- Place yourself as a civilian with a grenade launcher with flares. Fire a flare. See that the AI are totally lighted up yet still don't shoot at eachother.

- Conclusion: Even though they were just a tad too far to spot eachother, meaning even the tiniest boost to spotting ability should have allowed them to spot eachother, a flare still did absolutely nothing, therefore AI are most likely completely unaffected by flares.

Of course, I need to repeat this test with 1.56...

Will definitely check out that script of yours. Looks good and may be something that won't be too difficult to integrate into UPSMON.

Edited by galzohar

Share this post


Link to post
Share on other sites

Just wondering if this can be used for OA? The files say utes, am not 100% if thats compatible.

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  

×