OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Venom072 on 05 Aug 2012, 01:12:25

Title: move task?
Post by: Venom072 on 05 Aug 2012, 01:12:25
Move my marker on the map but I would like the "simpletaskdestination" also moves.

(Briefing):

tskObj2=player createSimpleTask ["Detruire le T-34-76"];
tskObj2 setSimpleTaskDescription ["Pas evident a faire exploser ce ta de merde !.", "Detruire le T-34-76", "Detruire le T-34-76"];
taskObj2 setTaskState "Assigned";
tskObj2 setSimpleTaskDestination markerPos "mkr_AA4";

(init):

[] spawn {
while {not isnull AA4} do { "mkr_AA4" setmarkerpos getpos AA4; sleep 0.5; };
};


need help, thanx
Title: Re: move task?
Post by: Wolfrug on 05 Aug 2012, 10:29:59
It doesn't move by itself since all you really did with setSimpleTaskDestination was give it a set of coordinates. So all you need to do to make it move is update it the same as the other one:


[] spawn
{
while {not isnull AA4} do {"mkr_AA4" setmarkerpos getpos AA4; tskObj2 setSimpleTaskDestination markerPos "mkr_AA4"; sleep 0.5; };
};

Note though that you can use setSimpleTaskTarget (http://community.bistudio.com/wiki/setSimpleTaskTarget) instead of the initial setSimpleTaskDestination, which will automatically follow a unit (and is designed exactly for this kind of situation)

tskObj2 setSimpleTaskTarget [AA4, true];

Wolfrug out.
Title: Re: move task?
Post by: Venom072 on 05 Aug 2012, 23:00:38
 ;)Thanx body ! Mission complete !