Jump to content
Grovesy57

Unconscious Markers

Recommended Posts

G'day guys,

I'm trying to build my own script for creating 3d Markers when a player goes unconscious, similar to domination. I've tried to combine the example from domination with an example I found in an old forum post, but can't seem to get this to work. Feel out of my comfort zone with 3Dmarkers. I'm also trying to add this to Liberation, with ACE Medical.

 

int_client.sqf:

player addEventHandler ["ace_unconscious", {execVM "..\TARF\EventHandlers\3dMarker.sqf"}];

 

3dMarker.sqf:

_unit = _this select 0;
_state = _this select 1;

if ("UnconMarkers" call BIS_fnc_getParamValue == 1) then {
	_icons = addMissionEventHandler ["Draw3D", {
		{
			if ((_x distance _unit) < 100 && {_unit getVariable "ACE_isUnconscious", false}) then {
				drawIcon3D ["a3\ui_f\data\map\MapControl\hospital_ca.paa", [0.6,0.15,0,0.8], _x, 0.5, 0.5, 0, format["%1 (%2m)", name _unit, ceil (_x distance _unit)], 0, 0.02];
			};
		} forEach allPlayers;
	}];
};

 

I've been tweaking and re-uploading onto the server, but yet to have any luck with the markers appearing. Hoping someone here can help me get this ironed out, I'm probably doing something silly as I'm still figuring out remote execs and MP scripting. Plus I've not had experience with 3dMarkers before.

Share this post


Link to post
Share on other sites

i'm not sure is the what that you are looking for but there is a script version too 

Share this post


Link to post
Share on other sites

The "ace_uncounscious" event doesn't work like that addEventHandler only works with arma 3 vanilla events. Ace events use Cba event system  

  • Like 1

Share this post


Link to post
Share on other sites
15 hours ago, zukov said:

i'm not sure is the what that you are looking for but there is a script version too 

 

The script may be a place to start, but it only handles vanilla, and not ACE Unconscious, which may be a slight issue. 

 

11 hours ago, Mr H. said:

The "ace_uncounscious" event doesn't work like that addEventHandler only works with arma 3 vanilla events. Ace events use Cba event system  

 

Right. Cheers. I've not fiddled with cba event handling before.. Will swapping out the addEventHandler line for a CBA_fnc_remoteEvent work as intended? Or will I need to somehow edit the ace_unconscious event before I can use it?

 

--Or... Could I change the ace_unconscious event to the vanilla Hit event, and have it check to see if the player has entered unconscious state after being hit? 

Share this post


Link to post
Share on other sites
5 hours ago, Grovesy57 said:

Will swapping out the addEventHandler line for a CBA_fnc_remoteEvent

they are very different things, addEventHandler adds a... eventhandler. remoteEvent triggers a event, thats the opposite end of the pipeline.

I assume you want to add a handler for the CBA event, CBA_fnc_addEventHandler.

https://github.com/CBATeam/CBA_A3/wiki/Custom-Events-System#registering-a-handler-for-custom-events

Share this post


Link to post
Share on other sites

Sorry internet's been dropping in/out. Given me time to figure some stuff out since I last posted, and I'll share where I am now. 

 

init_client.sqf:

grov_unconMarkers = {
	
	params [_unit, _state];
	if (("UnconMarkers" call BIS_fnc_getParamValue) == 1) then {
		[_unit, _state] execVM "..\TARF\EventHandlers\3dMarkers.sqf";
	};
	
};

 

3dMarkers.sqf:

_unit = _this select 0;
_state = _this select 1;

_icons = addMissionEventHandler ["Draw3D", {
	{
		if ((_x distance _unit) < 100 && {_unit getVariable "ACE_isUnconscious", false}) then {
			drawIcon3D ["a3\ui_f\data\map\MapControl\hospital_ca.paa", [0.6,0.15,0,0.8], _x, 0.5, 0.5, 0, format["%1 (%2m)", name _unit, ceil (_x distance _unit)], 0, 0.02];
		};
	} forEach allPlayers;
}];

 

Hoping this will work. But looking back over the examples I'm using, I'm having some doubts. Mainly in the forEach statement. I'm still wrapping my head around scripting for MP.

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

×