Jump to content
Sign in to follow this  
wildman

Help - dedicated server EventHandler Killed issue

Recommended Posts

Within my mission i'm using EOS and i added this line so a script would run everytime a unit died/

_unit addEventHandler ["killed", {[_this select 0] ExecVm "Scripts\EOSUnitDeath.sqf"}];

EOSUnitDeath.sqf

_personOne = _this select 0;

// EOS UNIT KILLED
// copyToClipboard faction _personOne 

if (faction _personOne == 'mas_med_opfi_hd') then 
	{
	// ENEMY EOS UNIT KILLED
	_rng = random 100;
	if (_rng < 5) then {
		_veh = createVehicle ["suitcase", getpos _personOne, [], 0, "NONE"]  ;
		[[_veh, ["Collect evidence","scripts\collect.sqf"]],"addAction",true,true] call BIS_fnc_MP;
		}
	}
else 
{
	// NONE ENEMY EOS UNIT KILLED
	CivKilltally = CivKillTally + 1;
	if (CivkillTally == 5) then
		{
			"end1" call BIS_fnc_endMission;
		}
	else 
	{
		hint format ["Warning Civilians Killed = %1 of 5 %2", CivKillTally];
	};
};

This seems to work on a locally hosted server and in the editor but I dont have regular access to the dedicated server our group uses so I'm not able to run any tests.

 

Additionally this used to work on a previous version where EOS unit death was simply

_rng = random 100;

if (_rng < 5) then {

_personOne = _this select 0;
hint 'intel spawned';
_veh = createVehicle ["suitcase", getpos _personOne, [], 0, "CAN_COLLIDE"]  ;
[[_veh, ["Collect evidence","scripts\collect.sqf"]],"addAction",true,true] call BIS_fnc_MP;


} else {};

Also the global variable CivKillTally is definied in the init as

CivkillTally = 0;

any help would be appreciated and if need be i can provide more info 

Share this post


Link to post
Share on other sites

You can run a dedicated server on the same PC as your client to test locality issues (just use the Arma3server from steam tools)

Share this post


Link to post
Share on other sites

Ah, thx will do brb

 

edit - Ok this is a little more complex then i expected

Share this post


Link to post
Share on other sites

If you use ACE3 there are something has impact on the vanilia killed eventhandler.

Share this post


Link to post
Share on other sites

Ok update time,

 

So the problem is simple, EventHandler Killed is local and i need it to be global

 

Couldn't get the local dedicated server working w/ mods but i had some time on our server to figure out the issue

 

 

EDIT - Well, it pays to read the event handler wiki a bit more lol

 

New version of the eventhandler uses MPKilled so it should work on dedicated servers now :D

 

EDIT - Working now

_unit addMPEventHandler ["MPkilled", {[_this select 0] ExecVm "Scripts\EOSUnitDeath.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
Sign in to follow this  

×