Jump to content
Sign in to follow this  
Monsada

UPSMON - Urban Patrol Script Mon

Recommended Posts

@B00tsy

Typical basic usage would be like this: (init line of group leader)

nul=[this,"Alpha","MIN:",3,"MAX:",6] execVM "scripts\UPSMON.sqf"

Thus giving you a minimum of 3 groups and a max of 6. All identical to the original group. One thing worth noting, in the past this did not work with groups that include or are comprised of vehicles. (dunno if it's been updated to work or not recently)

Regards,

Gnome

Thanks a lot :)

---------- Post added at 12:00 AM ---------- Previous post was Yesterday at 11:56 PM ----------

I have noticed serious FPS loss on ACE 1.5 Operation Arrowhead with UPSMON from armaholic, I guess you should fix some features for better cooperation with Arrowhead, Monsada.

I tested the script a bit with about +200 AI walking around and I do not seem to lag more with the script, the only lag is the large amount of AI. Used it with AO vanilla.

Share this post


Link to post
Share on other sites

Yes, if you think you have "lag" from this script, try to run the same mission but instead of running the script, have all AI patrolling with waypoints. You should get about the same amount of "lag" (at least I did when I tried it with varying amounts of AI between 100 and 200 in and around Zargabad). Takistan seems to be a lot more forgiving but again having lots of AI can strain the CPU. When AI detect you inside an urban area things seem to get much worse, too, again regardless of whether they're patrolling with UPSMON or just waypoints.

Remember, scripts (at least "normal" ones such as this that don't use any dirty tricks) can only use so much CPU power. Th game simply will not let them use so much CPU that your FPS takes a noticeable hit. This can be easily seen by spawning a gazillion of infinite loops - FPS will remain the same.

Share this post


Link to post
Share on other sites

I'm having some problems with my mission. After we have seized Bastam (EAST surrendered), the mission should spawn some insurgents on the airfield, all remaining units are merged into one and then we attack the airfield/Insurgents. What happens is that the insurgents are spawned and then immediately surrenders. Furthermore, the squad merging doesn't work either and they don't attack the airfield. They just keep patrolling Bastam. And finally the trigger doesn't trigger either. Can anyone see anything wrong here?

if (!isServer) exitWith {};

playSound "radionoise1";
HQ sideRadio "Two_HQ";
HQ sideRadio "ThisIs_HQ";
HQ sideRadio "Base_HQ";
HQ sideRadio "NoHostiles_HQ";
HQ sideRadio "ContinueMission_HQ";
playSound "beep";

Platoon = createGroup WEST;
{[_x] joinSilent Platoon} forEach units Squad1; 
{[_x] joinSilent Platoon} forEach units Squad2; 
{[_x] joinSilent Platoon} forEach units Squad3; 
{[_x] joinSilent Platoon} forEach units Squad4; 
sleep 2;
Platoon setGroupID ["2nd Platoon"]; 
_leader = leader Platoon;


"Attack" setMarkerPos Airport_loc;
Airport_task = player createSimpleTask ["Seize the airport"];
Airport_task setSimpleTaskDescription ["Seize the airport", "Seize airport", "Seize airport"];
Airport_task setSimpleTaskDestination (getMarkerPos "Attack");
player setCurrentTask Airport_task;

Bastam_task setTaskState "Succeeded";
hint "We have seized Bastam!\nMission update received!";
BastamComplete = TRUE;
KRON_UPS_reinforcement=FALSE;

sleep 3; 
_leader sideRadio "Base_2";
_leader sideRadio "ThisIs_2";
_leader sideRadio "Two_2";
_leader sideRadio "SolidCopy_2";
_leader sideRadio "Out_2";
playSound "beep";

nul=[_leader,"Attack","Move"] execVM "scripts\upsmon.sqf";

Ins1 = Creategroup resistance;
Ins1 = [getMarkerPos "airp1", resistance, ["TK_INS_Soldier_TL_EP1","TK_INS_Soldier_3_EP1","TK_INS_Soldier_4_EP1","TK_INS_Soldier_AAT_EP1","TK_INS_Soldier_MG_EP1","TK_INS_Soldier_AR_EP1","TK_Soldier_Medic_EP1","TK_Soldier_EP1","TK_Soldier_AA_EP1","TK_INS_Soldier_TL_EP1","TK_INS_Warlord_EP1","TK_INS_Soldier_MG_EP1"]] call BIS_fnc_spawnGroup;
_leader1 = leader ins1;
[_leader1,"airp1","FORTIFY","SPAWNED"] execVM "scripts\upsmon.sqf";

Ins2 = Creategroup resistance;
Ins2 = [getMarkerPos "airp2", resistance, ["TK_INS_Soldier_TL_EP1","TK_INS_Soldier_3_EP1","TK_INS_Soldier_4_EP1","TK_INS_Soldier_AAT_EP1","TK_INS_Soldier_MG_EP1","TK_INS_Soldier_AR_EP1","TK_Soldier_Medic_EP1","TK_Soldier_EP1","TK_Soldier_AA_EP1","TK_INS_Soldier_TL_EP1","TK_INS_Warlord_EP1","TK_INS_Soldier_MG_EP1"]] call BIS_fnc_spawnGroup;
_leader2 = leader ins2;
[_leader2,"airp2","FORTIFY","SPAWNED"] execVM "scripts\upsmon.sqf";

Sleep 5;
trg=createTrigger ["None", getMarkerPos "AirportZone"];
trg setTriggerArea [150, 270, 330, True];
trg setTriggerActivation ["GUER", "NOT PRESENT", False];
trg setTriggerStatements ["this", "nul=[] execVM 'scripts\C-130.sqf'", ""];

HQ sideRadio works, _leader sideRadio doesn't (and I'm not _leader). Now for the trigger, I just looked at the wiki and it listed GUER as the alternative but I don't know if this has changed in A2? Either way, it seems like it should trigger anyways... And why on earth do my Insurgents surrender? They are their own side (not east). Per definition atleast...

Edit: Oh yeah and the rpt-file isn't saying anything either.

Edited by Rekrul

Share this post


Link to post
Share on other sites

I've been playing around with it a bit, by making a radio-trigger for the above script. So I run it after upsmon is done initializing. Now since I'm the squadleader (so I can use the radio-trigger) UPSMON basically ignores me. Sort of...

First of, all squads except mine are merged into platoon so that part works in the start but not later (?). Another issue I see is that the squads has their own upsmon-identity. When I merge the groups a new identity is created for platoon, but the old ones aren't deleted. I think I'm confusing the script and the AI by doing this so the AI gets two orders - patrol the area with the first identity and then patrol another area with the other identity (?). When I play the mission as normal, it won't merge the units and when UPSMON initialize it, it just says no alive members of the identity that was created for Platoon (even though there are alive members in the squads). So why won't they joinSilent later in the mission, but they can do it in the start?

Secondly, the insurgents/resistance are spawned as well, but in debug-mode I see that they are spawned as EAST in UPSMON. If I spawn as a UN-guy, then it counts it as INS. But I can't exactly have US soldiers fighting UN soldiers over a airfield. :) I assume my creatGroup Resistance is wrong, but side should I pick for OA?

Finally, why isn't my trigger working?

Edited by Rekrul

Share this post


Link to post
Share on other sites

Is there a way to fire a trigger on the event of the enemy force surrendering?

Share this post


Link to post
Share on other sites

Well upsmon is bound to have a variable for when they surrender so you could use that as a condition for trigger but I don't know what that variable is unfortuneately...

Share this post


Link to post
Share on other sites

Is there a way to get a squad not to retreat? I have a situation where I am assaulting a town and as the groups approach the town,they see the enemy ahead and retreat becuase enough of their back up forces aren't in the vacinity yet for them to be brave enough to advance. Therefore they plot retreat waypoints. I would like to turn off retreating for the attacking side.

Thanks for the help!

RR

Share this post


Link to post
Share on other sites

i want to ask is there updated&fixed version of UPSMON ?

(first using latest UPS as base, second fixed all the errors and issue it had)

Share this post


Link to post
Share on other sites

No, I think 5.0.7 is the latest one as Monsada doesn't have time to work on it anymore.

Another thing I just realized is that in OA AI never uses smoke from vehicles. When I was playing around in A2 they kept shooting out the smoke screen when they saw AT threats. In OA they never fire smoke, does anyone know why?

Share this post


Link to post
Share on other sites

I read quite a few posts here with people having problems with spawned units going into "surrender mode", I find myself with the same problem. Apart from using the "spawned" command which makes no difference I haven't been able to find an answer to this problem.

This works when placed in a units init.

null = [leader mygroup,"town","fortify","delete:",600,"template:",2,"respawn"] execVM "scripts\upsmon.sqf";

This when placed in a scipt after a group has spawned it just sends them into a surrender with or without "spawned" being used

null = [leader _name,"town","SPAWNED","fortify","delete:",600,"template:",2,"respawn"] execVM "scripts\upsmon.sqf";

The group exits and I can send them to waypoints but I can't get them to use UPSMON correctly..

Can Anyone help on this one please?

.

Share this post


Link to post
Share on other sites
I read quite a few posts here with people having problems with spawned units going into "surrender mode", I find myself with the same problem. Apart from using the "spawned" command which makes no difference I haven't been able to find an answer to this problem.

This works when placed in a units init.

null = [leader mygroup,"town","fortify","delete:",600,"template:",2,"respawn"] execVM "scripts\upsmon.sqf";

This when placed in a scipt after a group has spawned it just sends them into a surrender with or without "spawned" being used

null = [leader _name,"town","SPAWNED","fortify","delete:",600,"template:",2,"respawn"] execVM "scripts\upsmon.sqf";

The group exits and I can send them to waypoints but I can't get them to use UPSMON correctly..

Can Anyone help on this one please?

.

That bottom code where you see leader _name thats the name of a group spawned with BIS_fnc_spawngroup.

I dont know how F2k Sel gets the problem related to surrendering, but it works fine for me (see my post http://forums.bistudio.com/showthread.php?t=107435&page=2) Thanks very much for helping out with that F2k Sel.

I cant be sure if it's a random problem, so i'll keep testing this out.

Share this post


Link to post
Share on other sites

As I had no enemy units on the map it looks like that triggers the surrender mode when they spawn, to test that I placed a group of enemy units on the map at mission start.

Now I get initialization aborted

I have it working now, turns out I need to use this

call {[(units _name) select 0 ,"town","SPAWNED","fortify","delete:",600,"template:",2,"respawn"] execVM "scripts\upsmon.sqf";};

or

call {[leader _name ,"town","SPAWNED","fortify","delete:",600,"template:",2,"respawn"] execVM "scripts\upsmon.sqf";};

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Do you understand what that code is doing? If so is it ok for you to explain it if possible? Just in case any of us run into any problems in the future.

Share this post


Link to post
Share on other sites

lol no worries :P Can anyone else help us understand it.

Im not sure if i should include it in the mission if it seems to be working fine... i always wanna take precautions.

Share this post


Link to post
Share on other sites
spawned = use only with squads created in runtime, this feature will add squad to UPSMON correctly.

How to create a squad during the game?

Share this post


Link to post
Share on other sites

Here's what I did in my mission and posted above:

Ins1 = Creategroup resistance;
Ins1 = [getMarkerPos "airp1", resistance, ["TK_INS_Soldier_TL_EP1","TK_INS_Soldier_3_EP1","TK_INS_Soldier_4_EP1","TK_INS_Soldier_AAT_EP1","TK_INS_Soldier_MG_EP1","TK_INS_Soldier_AR_EP1","TK_Soldier_Medic_EP1","TK_Soldier_EP1","TK_Soldier_AA_EP1","TK_INS_Soldier_TL_EP1","TK_INS_Warlord_EP1","TK_INS_Soldier_MG_EP1"]] call BIS_fnc_spawnGroup;
_leader1 = leader ins1;
[_leader1,"airp1","FORTIFY","SPAWNED"] execVM "scripts\upsmon.sqf";

Ins2 = Creategroup resistance;
Ins2 = [getMarkerPos "airp2", resistance, ["TK_INS_Soldier_TL_EP1","TK_INS_Soldier_3_EP1","TK_INS_Soldier_4_EP1","TK_INS_Soldier_AAT_EP1","TK_INS_Soldier_MG_EP1","TK_INS_Soldier_AR_EP1","TK_Soldier_Medic_EP1","TK_Soldier_EP1","TK_Soldier_AA_EP1","TK_INS_Soldier_TL_EP1","TK_INS_Warlord_EP1","TK_INS_Soldier_MG_EP1"]] call BIS_fnc_spawnGroup;
_leader2 = leader ins2;
[_leader2,"airp2","FORTIFY","SPAWNED"] execVM "scripts\upsmon.sqf";

@F2kSel:

I noticed the same thing in my mission. I had some EAST units and then I spawned some Insurgents (as seen in this post). They were friendly to EAST but when spawned, they immediately surrendered so I had to set the surrender to 0. Also, don't used the "SPAWNED" parameter for units you have placed in the editor. Do that for units that you spawn through scripts (like above).

Edited by Rekrul

Share this post


Link to post
Share on other sites

Cheers Rekrul I'll try what you have later, I think had Something close but close isn't always good enough.

Share this post


Link to post
Share on other sites

In the UPSMON_Init.sqf file I can see this line:

KRON_UPS_MG_WEAPONS = ["MG36","M249","M240","MK_48","PK","PKm","Pecheneg","M249 Para","M249 Para M145","M240G M145","M60"];

however I'm guessing this isn't updated for OA so I looked here: http://forums.bistudio.com/showthread.php?t=73241 and added OA MGs to this:

KRON_UPS_MG_WEAPONS = ["MG36","M249","M240","MK_48","PK","PKm","Pecheneg","M249 Para","M249 Para M145","M240G M145","M60","MG36_camo","m240_scoped_EP1","M249_EP1","M249_m145_EP1","M249_TWS_EP1","M60A4_EP1","Mk_48_DES_EP1","RPK_74"];

Am I using the right names here? I haven't checked what this variable does but I'm assuming it's used for suppressive fire or something.

A funny thing is that I didn't know that there was a M249 with TWS. :)

Share this post


Link to post
Share on other sites
Is there a way to fire a trigger on the event of the enemy force surrendering?

Hi alleycat,

to force surrendering put the variable you need to true:

KRON_UPS_WEST_SURRENDED = true;

KRON_UPS_EAST_SURRENDED = true;

KRON_UPS_GUER_SURRENDED = true;

for any issue you have please register it in devheaven, so I can work on it

http://dev-heaven.net/projects/upsmon

Share this post


Link to post
Share on other sites

Hey Monsada, is there a way to make a unit first go to one marker and then a second? I've tried both moving the marker and issuing another upsmon-command but neither helped (the last one just gave them another grpid so now they get one waypoint around marker1 and their other id gives them a waypoint to marker2). Is there a way to delete a groupid?

Share this post


Link to post
Share on other sites

well after much messing about i have reinforcement working well enough even if its not technically the right way -

i have the group called 'reinforce1' doing a regular upsmon patrol then set a trigger for reinforce which says:

KRON_UPS_reinforcement1 = true; null=[reinforce1,"test","nowait", "safe","reinforcement:",1] execVM "scripts\upsmon.sqf"; 

they will leave the current marker and head to the new zone to patrol - don't know if it's right but it works and nothing else seems to.

Share this post


Link to post
Share on other sites
Yes, if you think you have "lag" from this script, try to run the same mission but instead of running the script, have all AI patrolling with waypoints. You should get about the same amount of "lag" (at least I did when I tried it with varying amounts of AI between 100 and 200 in and around Zargabad). Takistan seems to be a lot more forgiving but again having lots of AI can strain the CPU. When AI detect you inside an urban area things seem to get much worse, too, again regardless of whether they're patrolling with UPSMON or just waypoints.

Remember, scripts (at least "normal" ones such as this that don't use any dirty tricks) can only use so much CPU power. Th game simply will not let them use so much CPU that your FPS takes a noticeable hit. This can be easily seen by spawning a gazillion of infinite loops - FPS will remain the same.

Is it better to run the script 5 times with larger squads or does it not matter if you use the script with 15 smaller squads, only the absolute number of AI on the map...?

Share this post


Link to post
Share on other sites

It's not about the script, it's about the AI load. The answer would be the same as if you would ask if you should make more small groups vs less but bigger groups that patrol with waypoints.

Last time I tested was in the little city I spawned on the NW airfield in Chernarus, when I let the guys patrol in 1-man groups they would seem to eat up less CPU than if I grouped them together. This wasn't using UPSMON either, just a random patrol script that tells them to move to a random building position and continue to another a few seconds after the position was reached. Max AI I could place that way on a top-end server without FPS dropping under 20 was 75, on less powerful PCs more like 35, so the CPU power the AI units require really depend on the area they are in (and seems also affected by the area the enemies they know about are in).

In the end the number of script instances that run has no real effect on FPS, for reasons already mentioned. The only thing that truly matters is the actual number of AI units and what they're doing.

Share this post


Link to post
Share on other sites
well after much messing about i have reinforcement working well enough even if its not technically the right way -

i have the group called 'reinforce1' doing a regular upsmon patrol then set a trigger for reinforce which says:

KRON_UPS_reinforcement1 = true; null=[reinforce1,"test","nowait", "safe","reinforcement:",1] execVM "scripts\upsmon.sqf"; 

they will leave the current marker and head to the new zone to patrol - don't know if it's right but it works and nothing else seems to.

Thanks very much for this :) It's very cool and adds so much more functionality to UPSMON. I've been experimenting with using multiple triggers to move patrolling units onto new zones. It's pretty good. You can patrol with units and use different kinds of triggers to move your AI friends along (while you patrol with them of course), digging in occasionally and then moving on.

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  

×