Jump to content
  • 0

Markers in real time


juandayz

Question

Hi, i need to know how to set up a updated marker every 10 sec or X time...

try whit this but isnt work:

updatemark.sqf

if(isServer) then{
    [] spawn {
        While{not isNull <myunit>; sleep 0.5} do{
            "myunit" setMarkerPos getPos <myunit>;
        };
    };
};

then i call it from init.sqf at very bottom whit:

[] execVM "custom\updatemarker.sqf";

Here is the unit what i need to be marked every time:

Spoiler

_unit_11 = objNull;
if (true) then
{
  _this = _group_2 createUnit ["INS_Bardak_DZ", [2011.6644, 2244.1541, 2.8610229e-006], [], 0, "CAN_COLLIDE"];
  _unit_11 = _this;
  _this setVehicleVarName "myunit";
  myunit = _this;
  _this setUnitAbility 0.60000002;
  if (false) then {_group_2 selectLeader _this;};
};

**another thing.. i need my unit in not allow damage mode...  i try whit allowdamage false;  but isnt work. i guess its no work cuz allowdamage its for use in local. Thers another way¿? any god mode for  units in moves?

 

any idea?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

well can make this unit inmortal using hanndle damage. 

only needs an updated marker.. if anyone knows.....

here code for inmortal AI:

Spoiler

_unit_5 = objNull;
if (true) then
{
  _this = _group_2 createUnit ["US_Delta_Force_Undercover_Takistani06_EP1", [2012.5223, 2243.354], [], 0, "CAN_COLLIDE"];
  _unit_5 = _this;
  _this setDir 44.482033;
  _this setVehicleVarName "myunit";
  myunit = _this;
  _this addEventHandler ["handleDamage", {false}];
  _this setUnitAbility 0.60000002;
  if (true) then {_group_2 selectLeader _this;};
};

found a way to update marker. tnks anyway

Link to comment
Share on other sites

  • 0

setVehicleVarName is not Multiplayer syncronized. So you might have a scope issue in there, except from the fact, that you need to make sure  the Server actually loads the file AFTER the Unit and Marker has been created.

So for incidence:

 

juan_unit = _group createUnit [bla,bla,bla,bla];
juan_unit setDir 44.482033;
juan_unit setUnitAbility 0.60;
juan_unit removeAllEventHandlers ["handleDamage"];
juan_unit addEventHandler ["handleDamage", {juan_unit setDamage 0;}];
juan_unit allowDamage false;
_group selectLeader juan_unit;

juan_unit spawn {
	while {alive _this} do {
		"myMarker" setMarkerPos (getPosATL _this);
	};
};

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...