Jump to content
Sign in to follow this  
bangabob

Created Markers for JIP players

Recommended Posts

Apparently markers created by dedicated servers using scripts are now JIP compatible as of Build 0.73.107682

Source: http://feedback.arma3.com/view.php?id=11190#c41837

I hope you are right as that would save so much time. They could just incorporate CBA into ArmA...

JIP is still one of the big F-ups in ArmA imho. Time is still not JIP synced.

Share this post


Link to post
Share on other sites

Will be a God-send if this finally works, though will completely nullify the system I wrote for I&A 3. :P

Share this post


Link to post
Share on other sites
Will be a God-send if this finally works, though will completely nullify the system I wrote for I&A 3. :P

oh did you? That'll save some trouble :D It's always a pain to port the selfmade changes.

Share this post


Link to post
Share on other sites
oh did you? That'll save some trouble :D It's always a pain to port the selfmade changes.

Aye - works perfectly in a dedicated server environment, supports dynamic marker names / settings and only requires one public array. I was even going to write a blog post about it, though that seems a bit pointless if it's now fixed.

Damn you, Bohemia Interactive! Damn you for being so damned productive and fixing important issues! Damn you to hell!

Share this post


Link to post
Share on other sites
Damn you, Bohemia Interactive! Damn you for being so damned productive and fixing important issues! Damn you to hell!

LOL pretty amusing :dance1:, yea, but I'm grateful that features and stuff is being addressed for the simple fact that it makes mission developers job much easier and i know for certain this will lead to a lot more awesome missions yet to come.

Share this post


Link to post
Share on other sites

Ok, so to get this clear.

Which Markers are updated to JIPs?

Markers created by player in-game?

Markers created and/or moved via script?

cheers

Share this post


Link to post
Share on other sites

They didn't fix this yet did they. I created a marker through a script at the start of the mission, when I reconnect it is gone. I need to use Mikies JIP marker technique to have it be there for JIP players.

Here's the code used for the marker:

_marker = createMarker ["vip_pos", _newPos];
"vip_pos" setMarkerShape "ellipse";
"vip_pos" setMarkerBrush "solid";
"vip_pos" setMarkerSize [30, 30];
"vip_pos" setMarkeralpha 0.5;
"vip_pos" setMarkerColor "ColorBlack";
"vip_pos" setMarkerPos _newPos;

Share this post


Link to post
Share on other sites
They didn't fix this yet did they. I created a marker through a script at the start of the mission, when I reconnect it is gone. I need to use Mikies JIP marker technique to have it be there for JIP players.

i think they only work for JIP only if the markers were made in init.sqf

i wanted to use this code for markers using if isserver but when i leave server and come back the markers are not there anymore i had to do a work around to fix this making the marker in init.sqf but im not entirely sure if the server was supposed to propagate the marker to all clients to begin with. i certainly thought so.

if (randOBJ  == 1) then 

{   
ObjectiveCrate setPos (getMarkerPos "Objective1");
ObjectiveCrate setDir 0;

Obj = getmarkerpos "Objective1";
ObjectiveMkr = createMarker [ObjectiveMkrName, Obj];
ObjectiveMkr setMarkerShape "ICON";
ObjectiveMkrName setMarkerType "mil_box";
ObjectiveMkrName setMarkerColor "ColorGreen";
ObjectiveMkrName setMarkerSize [0.9, 0.9];
ObjectiveMkrName setMarkerText (ObjectiveMkrName );


};

Share this post


Link to post
Share on other sites

Unfortunately the particular scenario I require is still not J.I.P. compatible.

Dedicated server creates a marker:

if(isDedicated) then
{
  _marker = createMarker [str(random 99999), getPos objectName];
  _marker setMarkerShape "ICON";
  _marker setMarkerSize [1,1];
  _marker setMarkerType "o_inf";
  _marker setMarkerText "Test";
}

If a client is connected whilst this marker is created, they see the red marker above the building named objectName.

However if a client joins the server AFTER the marker script is run; they do not see the marker.

This can be resolved by both the server and clients running @CBA_A3 alongside the use of CBA_fnc_setMarkerPersistent however this mod requirement causes most public clients to play elsewhere :(

Share this post


Link to post
Share on other sites

Just throwing this out there, Don't know if it works but it should work just like using CBA_fnc_setMarkerPersistent or at least I would assume it'd work, I'm not much into mission making but I do like creating tools for people to use so if they work, then they work.

JIP_fnc_markerCreate = 
{
private["_marker","_name","_pos","_type","_color","_text"];
_name = [_this,0,"",[""]] call BIS_fnc_param;
_pos = [_this,1,[],[[]]] call BIS_fnc_param;
_type = [_this,2,"",[""]] call BIS_fnc_param;
_color = [_this,3,"",[""]] call BIS_fnc_param;
_text = [_this,4,"",[""]] call BIS_fnc_param;
_size = [_this,5,[],[[]]] call BIS_fnc_param;

//Some checks and stuff
if(_name == "" OR count _pos == 0 OR _type == "") exitWith {};
if(_name in allMapMarkers) exitWith {};

if(!isServer) then
{
	_marker createMarkerLocal [_name,_pos];
	_marker setMarkerTypeLocal _type;
	if(_color != "") then { _marker setMarkerColorLocal _color; };
	if(_text != "") then { _marker setMarkerTextLocal _text; };
	if(count _size == 2) then { _marker setMarkerSizeLocal _size; };
}
	else
{
	_marker createMarker [_name,_pos];
	_marker setMarkerType _type;
	if(_color != "") then { _marker setMarkerColor _color; };
	if(_text != "") then { _marker setMarkerText _text; };
	if(count _size == 2) then { _marker setMarkerSize _size; };
};
};

JIP_fnc_queueSearch =
{
private["_find","_queue","_select","_ret"];
_find = [_this,0,"",[""]] call BIS_fnc_param;
if(_find == "") exitWith {-1};
_queue = bis_functions_mainscope getVariable "BIS_fnc_MP_queue";

for "_i" from 0 to (count _queue)-1 do
{
	_select = _queue select _i;
	if((_select select 2) == "JIP_fnc_markerCreate") then
	{
		if(_find in (_select select 1)) exitWith {_ret = _i;};
	};
};
if(isNil "_ret") then {_ret = -1};
_ret;
};

JIP_fnc_markerDelete =
{
private["_name","_index","_queue"];
_name = [_this,0,"",[""]] call BIS_fnc_param;
if(_name == "") exitWith {}; //Bad name

_index = [_name] call JIP_fnc_queueSearch;
if(_index == -1) exitWith {}; //No match
_queue = bis_functions_mainscope getVariable "BIS_fnc_MP_queue";
_queue set[_index,-1];
_queue = _queue - [-1];
bis_functions_mainscope setVariable["BIS_fnc_MP_queue",_queue,true];

deleteMarker _name;
};

Usage:

[["MyTestMarker2",getPos player,"mil_dot","ColorRed",name player,[1,1]],"JIP_fnc_markerCreate",nil,true] spawn BIS_fnc_MP;

That will create the marker and mark it as persistent for JIP clients to create it (if it isn't showing) and to delete the marker from the server & the queue (this must be ran by the server):

["MyTestMarker2"] call JIP_fnc_markerDelete;

And that should delete it and remove it from the BIS_fnc_MP queue, the only issue I see not working is the delete part, for clients that JIP in after the marker was created and then later deleted it may not remove it from them as they created it via createMarkerLocal, if it does then cool?

Confusion aside from what I've noticed and this has been like this since ARMA 2: OA 1.62 only player created markers are JIP ready, scripted markers (createMarker) are not. So if the engine is suppose to sync scripted markers then it is indeed not working.

Edited by Tonic-_-

Share this post


Link to post
Share on other sites

If a client is connected whilst this marker is created, they see the red marker above the building named objectName.

However if a client joins the server AFTER the marker script is run; they do not see the marker.

This can be resolved by both the server and clients running @CBA_A3 alongside the use of CBA_fnc_setMarkerPersistent however this mod requirement causes most public clients to play elsewhere :(

agree 100 percent. based on all my testing that is exactly the case

Share this post


Link to post
Share on other sites
... this has been like this since ARMA 2: OA 1.62 only player created markers are JIP ready, scripted markers (createMarker) are not. So if the engine is suppose to sync scripted markers then it is indeed not working.

Yeah this has always been the case in ArmA 2, however I rarely designed any missions without @CBA enabled due to it being a dependency of @ACE and as such never had the need for JIP marker functionality. Now with ArmA 3 being quite polished without any mods, it would be nice if this was provided without the need for @CBA or workarounds such as Tonic's shown above.

Share this post


Link to post
Share on other sites

Hi Karel Mořický,

Could we please get an update as to the status of this issue?

The development tracker ticket has been reassigned.

Although not super-urgent, it would be nice to know that this feature could be available on full release.

Kush.

Share this post


Link to post
Share on other sites

This may work as a temporary solution. Untested.

init.sqf

onplayerConnected {execVM "markerJip.sqf"};

markerJip.sqf

_markers = allMapMarkers; 
{_x setMarkercolor (getMarkercolor _x);} foreach _markers;

PV the marker(s) when it changes states or gets created and you should be all set. IE; Publicvariable "myMrk";

Edited by Iceman77

Share this post


Link to post
Share on other sites

This is what i came up with:

setMarkerJIP =
{
private ["_marker","_pos","_type","_size","_text","_color","_brush","_shape","_markerArray","_JIPArray"];
_marker = _this select 0;
_text = _this select 1;

_pos = getMarkerPos _marker;
_type = getMarkerType _marker;
_size = getMarkerSize _marker;
_color = getMarkerColor _marker;
_brush = markerBrush _marker; 
_shape = markerShape _marker; 

_markerArray = [_marker,_pos,_type,_size,_text,_color,_brush,_shape];

JIPArray = JIPArray + [_markerArray];
//server setVariable ["JIPMarks",_JIPArray,true]; 
publicVariable "JIPArray";

};


createMarkerJIP =
{
/* [_marker,_pos,_type,_size,_text]; */

private ["_array","_marker","_pos","_type","_size","_text","_color","_brush","_shape","_mrk","_unit"];
_unit = _this select 0;

if !(local _unit) exitWith {};
if (isNil "JIPArray") then 
{
 JIPArray = [];
};

  if (count jiparray == 0) exitWith {};

 for "_i" from 0 to ((count JIPArray) - 1) do
 {
  //_array = JIPArray select _i;
  _marker = (JIPArray select _i) select 0;
  _pos = (JIPArray select _i) select 1;
  _type = (JIPArray select _i) select 2;
  _size = (JIPArray select _i) select 3;
  _text = (JIPArray select _i) select 4;
  _color = (JIPArray select _i) select 5;
  _brush = (JIPArray select _i) select 6; 
  _shape = (JIPArray select _i) select 7;

  _mrk = createMarkerlocal [_marker,_pos];
  _mrk setMarkerTypelocal _type;
  _mrk setMarkerSizelocal _size;
  _mrk setMarkerTextlocal _text;
  _mrk setMarkerColorlocal _color;
  _mrk setMarkerbrushlocal _brush;
  _mrk setMarkershapeLocal _shape;  

 };



if (true) exitWith {}; 
};

called like:

[MARKERNAME,MARKERTEXT] call setMarkerJIP

and (in init.sqf):

if (!isServer && isNull player) then {isJIP=true;} else {isJIP=false;};

[player] call createMarkerJIP;

cheers!

Share this post


Link to post
Share on other sites
Can't you just BIS_fnc_MP the creation of the marker? With _isPersistent set to true?

You can but one issue people can and will face is what if they wanted to delete the marker? It may delete for current clients with deleteMarker but when a new person comes in it gets created again. You have to flush it from BIS_fnc_MP_packet which is attached to bis_functions_mainscope. The method which I posted does basically all of that but adds the option of deleting it and deleting it for JIP clients.

There is a lot of ways to handle markers for JIP players but it still would be nice if it was actually synced engine side instead of us having to do these extra means to correct something that should already be there.

Share this post


Link to post
Share on other sites
Can't you just BIS_fnc_MP the creation of the marker? With _isPersistent set to true?

Depends how many markers you are updating. BIS_fnc_MP causes immense lag

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  

×