juandayz Posted March 17, 2016 Report Share Posted March 17, 2016 Hello, i need set up an inmortal AI who moves around the map whit a updated marker. try calling in init at very bottom: [] execVM "custom\updatedmarker.sqf"; and into updatedmarker.sqf this code: Spoiler if(isServer) then{ [] spawn { While{not isNull <GUE_Worker2>; sleep 0.5} do{ "inmortalAI" setMarkerPos getPos <GUE_Worker2>; }; }; }; but dsnt work. any idea? here is my unit code: Spoiler _unit_3 = objNull; if (true) then { _this = _group_1 createUnit ["GUE_Worker2", [10256.297, 3207.6804, 1.5258789e-005], [], 0, "CAN_COLLIDE"]; _unit_3 = _this; _this setDir 107.50806; _this setVehicleVarName "inmortal"; trader = _this; _this setVehicleInit "inmortal allowDamage false"; _this setUnitAbility 0.60000002; if (true) then {_group_1 selectLeader _this;}; }; Link to comment Share on other sites More sharing options...
0 seelenapparat Posted March 17, 2016 Report Share Posted March 17, 2016 maybe try using objNull or alive. isnull doesnt work on a vehicle is guess. Link to comment Share on other sites More sharing options...
0 juandayz Posted March 17, 2016 Author Report Share Posted March 17, 2016 but this is not a vehicle, is an unit. any way i can use on vehicle too.. but dsnt works wtf, this is not arma2 q&a :S soryy Link to comment Share on other sites More sharing options...
0 Sp4rkY Posted March 18, 2016 Report Share Posted March 18, 2016 Every "OBJECT" in arma is categorized as an "vehicle", also units. This means, isNull is the correct one in this case. If the unit wouldn´t exist, it would be a nullobject. Assumed you created a marker before and named the marker "inmortalAI" you can try this: if(isServer)then{ [] spawn { waitUntil{!isNull "inmortal"}; while{true}do{ uiSleep .5; "inmortalAI" setMarkerPos (getPos "inmortal"); if(isNull "inmortal")exitWith{} } }; }; cheers juandayz 1 Link to comment Share on other sites More sharing options...
0 juandayz Posted March 21, 2016 Author Report Share Posted March 21, 2016 I found this way to make it 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 setVehicleInit "deleteopfor attachTo[myunit,[0,0,0]];"; myunit addEventHandler ["handleDamage", {false}]; _this setUnitAbility 0.60000002; if (false) then {_group_2 selectLeader _this;}; }; /////////////////////////////////////marker _this = createMarker ["marker-follow-myunit", [2011.6644, 2244.1541, 2.8610229e-006]]; _this setMarkerText "bluemarker"; _this setMarkerShape "ELLIPSE"; _this setMarkerType "mil_box"; _this setMarkerColor "ColorBlue"; _this setMarkerBrush "Solid"; _this setMarkerSize [50, 50]; _marker_0 = _this; ///////////////////////////////trigger _this = createTrigger ["EmptyDetector", [2011.6644, 2244.1541, 2.8610229e-006]]; _this setTriggerArea [5, 5, 0, false]; _this setTriggerActivation ["EAST", "PRESENT", true]; _this setTriggerTimeout [10, 10, 10, false]; _this setTriggerStatements ["this AND (getPosATL (vehicle player) select 2) < 3;", "{deleteVehicle _x} forEach thisList;", ""]; deleteopfor = _this; _trigger_0 = _this; Tnks a lot! Link to comment Share on other sites More sharing options...
Question
juandayz
Hello, i need set up an inmortal AI who moves around the map whit a updated marker.
try calling in init at very bottom:
[] execVM "custom\updatedmarker.sqf";
and into updatedmarker.sqf this code:
if(isServer) then{
[] spawn {
While{not isNull <GUE_Worker2>; sleep 0.5} do{
"inmortalAI" setMarkerPos getPos <GUE_Worker2>;
};
};
};
but dsnt work. any idea?
here is my unit code:
_unit_3 = objNull;
if (true) then
{
_this = _group_1 createUnit ["GUE_Worker2", [10256.297, 3207.6804, 1.5258789e-005], [], 0, "CAN_COLLIDE"];
_unit_3 = _this;
_this setDir 107.50806;
_this setVehicleVarName "inmortal";
trader = _this;
_this setVehicleInit "inmortal allowDamage false";
_this setUnitAbility 0.60000002;
if (true) then {_group_1 selectLeader _this;};
};
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now