Home   Help Search Login Register  

Author Topic: move task?  (Read 1606 times)

0 Members and 1 Guest are viewing this topic.

Offline Venom072

  • Members
  • *
move task?
« 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

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: move task?
« Reply #1 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 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.
"When 900 years YOU reach, look as good you will not!"

Offline Venom072

  • Members
  • *
Re: move task?
« Reply #2 on: 05 Aug 2012, 23:00:38 »
 ;)Thanx body ! Mission complete !