Warning: include(/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php): failed to open stream: No such file or directory in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Warning: include(): Failed opening '/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Notice: Undefined index: OFPEC in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152
    Home   Help Login Register  

Author Topic: move task?  (Read 4003 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 !