Jump to content
cool=azroul13

UPSMON Updated to ArmaIII

Recommended Posts

Hello everyone,

i want to share with you my solution for the following problem:

If the headless client is controlling his owned units with upsmon and the headless client crashes/disconnects, his units will correctly tranfered back to the server, but the instance of upsmon on the server is not aware of this new units.

I wrote a little module, that reinitialises the "new" units with upsmon on the server.

@Cool=Azroul13: Feel free to use this code for your project, if needed. It is not perfect. It will only works with just ONE headless client (not multiple) and you need to sets its name (of the HC modul in the editor) in the Init_UPSMON.sqf manually.

What i did:

modules\Upsmon\Init_UPSMON.sqf

50  UPSMON_EAST_HM = 100;
51  UPSMON_GUER_HM = 100;
52
53  [color="#00FF00"]// Name of the Headless Client to monitor (name of the HC Modul!)[/color]
54  [color="#00FF00"]UPSMON_HC = "headlessclient";[/color]
55
56  //////////////////////// ////////////////////////////////////////////
57
58  //Height that heli will fly this input will be randomised in a 10%

[...]

209  _m setMarkerBrush "Solid";
210  _m setmarkerAlpha 0;
211
212 [color="#00FF00"] ///////////////////////////////////////////////////////////////////////////////////////////[/color]
213 [color="#00FF00"] // Initialise the Headless Client fail-safe solution[/color]
214 [color="#00FF00"] ///////////////////////////////////////////////////////////////////////////////////////////[/color]
215 [color="#00FF00"] if(isServer)then{[/color]
216     	[color="#00FF00"][] execvm "modules\Upsmon\UPSMON\MODULES\HC_FAIL_SAFE\initServer.sqf";[/color]
217  [color="#00FF00"]};[/color]
218  [color="#00FF00"]if(!hasInterface && !isServer)then{[/color]
219    	[color="#00FF00"][] execvm "modules\Upsmon\UPSMON\MODULES\HC_FAIL_SAFE\initHC.sqf";[/color]
220  [color="#00FF00"]};[/color]
221
222  //Initialization done
223  UPSMON_INIT=1;

New file "modules\Upsmon\UPSMON\MODULES\HC_FAIL_SAFE\InitHC.sqf

//**********************************************************************************
//** Scripted by DasMaeh		v1.0
//**********************************************************************************
//** Giving the Server the information needed to take over all the groups covered by
//** the Headless Client in case of a disconnect by the Headless Client.
//** Send an array of all groups controlled by HCsUPSMON with its init parameter
//**********************************************************************************
//** Arguments:
//**		- none -
//**********************************************************************************

while {true} do {
UPSMON_NPCs_HC = [];
UPSMON_Civs_HC = [];
{
	_UPSMON_PARAMETER = _x getVariable "UPSMON_Ucthis";
	if (!(isNil "_UPSMON_PARAMETER")) then {
		UPSMON_NPCs_HC = UPSMON_NPCs_HC + [_UPSMON_PARAMETER];
	};
}foreach UPSMON_NPCs;
{
	_UPSMON_PARAMETER = _x getVariable "UPSMON_Ucthis";
	if (!(isNil "_UPSMON_PARAMETER")) then {
		UPSMON_Civs_HC = UPSMON_Civs_HC + [_UPSMON_PARAMETER];
	};
}foreach UPSMON_Civs;

publicVariableServer "UPSMON_NPCs_HC";
publicVariableServer "UPSMON_Civs_HC";

sleep 30;
};

New file "modules\Upsmon\UPSMON\MODULES\HC_FAIL_SAFE\InitServer.sqf

//**********************************************************************************
//** Scripted by DasMaeh		v1.0
//**********************************************************************************
//** OnDisconnect of the HC, re-init his units
//**********************************************************************************
//** Arguments:
//**		- none -
//**********************************************************************************

UPSMON_HC_DISCONNECT = ["UPSMON_HC_DISCONNECT1", "onPlayerDisconnected", {
if (_name == UPSMON_HC) then {
	{
		_Group_Leader = leader (_x select 0); 
		_group = _x select 0;
		_parameter = _x;
		_parameter set [0,_Group_Leader];
		nul = _parameter execVM "modules\Upsmon\UPSMON.sqf";
	} forEach UPSMON_NPCs_HC;

	{
		_Group_Leader = leader (_x select 0); 
		_group = _x select 0;
		_parameter = _x;
		_parameter set [0,_Group_Leader];
		nul = _parameter execVM "modules\Upsmon\UPSMON.sqf";
	} forEach UPSMON_Civs_HC;
};
}] call BIS_fnc_addStackedEventHandler;

Share this post


Link to post
Share on other sites

Hi,

having a bit of trouble with the Ambush part.

Context: I placed a group of infantry near a road on the edge of a forest and used this line for the SL:

nul = [this, "para_ambush", "AMBUSH2", "AMBUSHDIR:",SOUTHEAST, "AMBUSHDIST:",25] execVM "scripts\UPSMON.sqf";

Now, first of all not 100% if I wrote it correctly (the ini line); please correct me if I'm wrong.

Secondly, I always have at least one "wanna-be" prone on the road instead of hiding( as in, prone directly on or by the ambush marker). This part, not sure if something to do with the map (one of the All in Arma Terrain pack), or just from a mistake(s) in the line.

Thanks for any help :)

Edited by ElectroEsper

Share this post


Link to post
Share on other sites

I'm working on the last (I hope) big updates of UPSMON and I would need some help to testing each parts of it.

PM if you're interested and have some spare time.

thanks in advance,

Aze

Share this post


Link to post
Share on other sites

Is it possible to use this in the AI Spawn Module (Modules>Misc>Spawn AI)? The passed arguments are <group><module><groupdata>.

Share this post


Link to post
Share on other sites
I'm working on the last (I hope) big updates of UPSMON and I would need some help to testing each parts of it.

PM if you're interested and have some spare time.

thanks in advance,

Aze

sounds awesome. cant wait. I may have a few that can help.

Share this post


Link to post
Share on other sites

I'm interested in the "UPSMON_REMOVE"-feature, you have implemented in v6.0.8. to quit an instance, but I can't get it to work.

I placed a unit, named it a1, wrote in it's init: nul = [this,"area0","SAFE","LIMITED"] execVM "scripts\UPSMON.sqf"; a1grp = group this; and it's patroulling the area.

Then I tried the command written in the changelog.txt via trigger and debug-console with both, the unit's name and the unit's group name, unfortunately without success.

a1 setvariable ["UPSMON_Remove",true];

a1grp setvariable ["UPSMON_Remove",true];

-You can remove a group from UPSMON control via _grp setvariable ["UPSMON_Remove",true];

Am I doing it wrong?

Regards.

p.s. Also, if you still need testers, I would be glad to help.

Share this post


Link to post
Share on other sites

First of all thanks for your hard work : )

Are you planning to make some userfriendly UPSMON teamplates to show the full potential of this script to the ones a bit new to editor and scripting ?

Share this post


Link to post
Share on other sites
There will be a demo mission with the next update ;)

Ye because I already use UPSMON but I don't know If I'am using it in its full potential or in the right way so something like teamplates is welcome, looking forward for next update : )

thanks

cheers

Share this post


Link to post
Share on other sites

I've been hassled by this for a few days now. I've put down a marker, which is perfectly square (it was a rectangle to begin with but I changed it to a square which made no difference). I am spawning units using a trigger with this code:

_marker1 = toLower( _this select 1 );

_pos1 = getMarkerPos _marker1;

hint format [ "Marker name: %1", _marker1 ];

_side1 = EAST;

_units1 = [ "CAF_AG_AFR_P_AK47", "CAF_AG_AFR_P_RPK74" ];

_spawngrp1 = [ _pos1, _side1, _units1 ] call BIS_fnc_spawnGroup;

sleep 3;

_leader1 = leader _spawngrp1;

nul = [ _leader1, "_marker1", "SPAWNED", "DELETE", 300 ] execVM "scripts\UPSMON.sqf";

The units spawn in as they are supposed to and I've hinted that the correct marker is firing the script as well, although they won't move and this is generated in my RPT:

19:20:53 Error in expression <rivate ["_sum"];

_sum = ((_dstX * _dstX)/(_sizeX * _sizeX)) + ((_dstY * _dstY)/(>

19:20:53 Error position: </(_sizeX * _sizeX)) + ((_dstY * _dstY)/(>

19:20:53 Error Zero divisor

19:20:53 File C:\Users\BillGaming\Documents\Arma 3 - Other Profiles\SGT%2e%20Triton\mpmissions\7-75_No_Idea_Yet.Altis\Scripts\UPSMON\Get_pos\UPSMON_pos_fnc_isinellipse.sqf, line 48

To begin with, I'm perplexed as to why an ellipse is being called as I'm not even using an ellipse. Once the units spawn, they just stand there which is obviously not the behavior I'm looking for. in past versions by default, these units would patrol if I'm not mistaken. I'm using the latest version.

Any ideas?

Late edit: I should also mention that if I throw in the Random parameter, all of the spawned units move to the lower left (0,0) of the map (after spawning at the correct marker location) which means something is definitely awry.

Edited by Tritonv8

Share this post


Link to post
Share on other sites
What is "_this select 1" ?

"_this select 1" is from an array of markers in the trigger that I'm passing to the script above. I have made sure the names in the array are correct with the markers in the editor as well. They do spawn to the marker called, it's just they won't patrol and the call to the ellipse function seems to me to probably be what's causing it to not work as intended.

Share this post


Link to post
Share on other sites

So your array is like this: ["mk1","mk2",...], so "_this select 1" is equal to "mk2".

When you add your _marker1 to UPSMON you do not have to wrote :"_marker1" but just _marker1.

_marker1 = "mk2";

"_marker1" = ""mk2"";

Share this post


Link to post
Share on other sites
So your array is like this: ["mk1","mk2",...], so "_this select 1" is equal to "mk2".

When you add your _marker1 to UPSMON you do not have to wrote :"_marker1" but just _marker1.

_marker1 = "mk2";

"_marker1" = ""mk2"";

Yes, the array is exactly like that and yes, I am aiming for the second position in the array with an index of "1". I will try removing the parenthesis and see if that makes the difference in the UPSMON call.

As an aside to this, the script is placing multiple units using "FORTIFY" as well. Those units seem to be behaving as expected. It's just the units spawned not using an optional placement parameter. I have disabled all other calls to pinpoint this issue and make sure nothing else is influencing this behavior. If the removal of parenthesis works for this, I'll remove it in the other calls to UPSMON so the parenthesis aren't getting doubled up.

Thank you and I'll advise with the results later today. Thank you for porting this script to Arma 3, it adds some great features and is a welcome addition to A3.

Thank you Cool, removing the parenthesis in the UPSMON call did the trick. They now patrol as I wanted without any spam to the RPT. Well done.

Edited by Tritonv8
Author solution fixed the issue

Share this post


Link to post
Share on other sites

i use "reinfocement" command and AI try paradrop.

but all most all AI fall down.

because AI can not Properly equipped with a parachute.

Do I have something wrong?

please check it.

I'm sorry my bad english.

Share this post


Link to post
Share on other sites

Thanks for the report, I'm aware of it, it seems that since the last patch there was a change in the time units take to getout. It is corrected.

Share this post


Link to post
Share on other sites

Hey everyone,

I got a problem, when i create a Tank with Crew as a template and i want to spawn it with a trigger i got this message in my RPT.

18:05:43 "UPSMON 'UPSMON_fnc_setVehicleInit': O Alpha 1-3:4"

18:05:43 Cannot create non-ai vehicle ,

18:05:43 Error in expression <(_x select 2) select 1]

};

};

} foreach _crews;

} foreach _vehicletypes;

_para>

18:05:43 Error position: <_crews;

} foreach _vehicletypes;

_para>

18:05:43 Error Nicht definierte Variable in Ausdruck: _crews

18:05:43 File C:\Users\Name\Documents\Arma 3 - Other Profiles\User\mpmissions\missionname\modules\Upsmon\UPSMON\MODULES\UPSMON_spawn.SQF, line 145

18:05:43 "UPSMON 'UPSMON_fnc_setVehicleInit': O Alpha 1-2:5"

18:05:43 "UPSMON 'UPSMON_fnc_setVehicleInit': O Alpha 2-3:4"

18:05:43 "UPSMON 'UPSMON_fnc_setVehicleInit': O Alpha 1-1:5"

18:05:43 Error in expression <(_x select 2) select 1]

};

};

} foreach _crews;

} foreach _vehicletypes;

_para>

18:05:43 Error position: <_crews;

} foreach _vehicletypes;

The Problem is he spawns an empty tank and the crew dont spawn into the tank. Also they didn't enter the tank they walk around like normal units.

hope you can fix this

Share this post


Link to post
Share on other sites

Hello. I am having a bug with the creategroup script. I am attempting to spawn a group from a radio trigger. When I activate the trigger, with debug enabled, I get a hint, "UPSMON: Unit not defined!" No units spawn. Here is the only section of the .rpt I could find related to UPSMON:

 
3:55:08 Error in expression < to _cnt do {
_indx = floor random _rnd % _cnt;
_el2 = _this select _indx;
_this>
3:55:08   Error position: <% _cnt;
_el2 = _this select _indx;
_this>
3:55:08   Error Zero divisor
3:55:08 File C:\Users\Wayner\Documents\Arma 3\missions\Sourgao.saru\Scripts\UPSMON\COMMON\Core\fnc\UPSMON_arrayShufflePlus.sqf, line 20

And this is the trigger:

_grp = [getmarkerpos "bieucp",EAST,[O_Soldier_F],[1,1],1,["bieucp","SAFE","COLUMN"]] call UPSMON_CreateGroup;

"bieucp" is an ellipse over a town.

Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites

@Frostie12345

The error is corrected.

@ColonelHartigan

The error is corrected, thanks for the report.

If you add an unit class in the array, the error should be gone.

Share this post


Link to post
Share on other sites

Would ne nice if there could be an array for "minimum distance for the next waypoint".

Especially for cars it´s a bit annoying if they turn around (overdrive some soldiers in the meantime or destroying the car while turning) and turn around 10 meters away because next waypoint is reached.

Share this post


Link to post
Share on other sites

Hi, I got AI infantry controlled by UPSMON 6.0.9.5 leaving their patrol area for engaging players, and they have "nofollow" command in init. They left the area for several meters 50/100Mt and more.

I try to explain better, I have a factory closed by walls with two gate, north and south, inside the walls I have 2 big group of 5 AI, 2 group of 3 AI and 4 empty Pickups vehicles.

I have area01 for the big groups and in the Init of each leader I have:

nul = [this,"area01","random","safe","wedge","noveh", "nofollow"] execVM "scripts\UPSMON.sqf";

I have two other smaller areas for the 2 smaller group, to patrol the 2 gates, area02 and area03, and I have this code inside the leaders:

nul = [this,"area02","random","safe","wedge","noveh", "nofollow"] execVM "scripts\UPSMON.sqf";

nul = [this,"area03","random","safe","wedge","noveh", "nofollow"] execVM "scripts\UPSMON.sqf";

I also have an armed Pickup patrolling around the factory, patrol is done only with waypoints.

When we played the mission, we attacked the pickup and after a while we where attacked by infantry 100mt away from the factory.

After killing all of them we found the factory empty, and all the empty pickups moved from they original position so the "noveh" and "nofollow" command where absolutely ignored.

With debug function I verify that the infantry correctly patrol inside the walls (patrol area01 is smaller than the area surrounded by the walls).

How am I supposed to use "noveh" and "nofollow" commands?

Tnx

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

×