Jump to content

Recommended Posts

To create tasks I use a script that goes like this:


 

_myTaskIDs = ["Task01"];


_makeTask1 = [["Task01"],west,["Text","Title","Task01Pos"],getposATL Start,"ASSIGNED",3,true,true,"attack"];


_watchTask1 = [] spawn {

waitUntil {sleep 0.5;!alive target01};
["Task01", "SUCCEEDED",true] spawn BIS_fnc_taskSetState;

};

_makeTask1 call BIS_fnc_setTask;

Now the problem is that the getposATL Start shows the initial position of object Start. If the object moves the task continues showing the initial position. Due to that in a task I just changed it to objNull but for another mission I need the task position to be updated. So how can I do that please?

Share this post


Link to post
Share on other sites

You should be able to set the task target to the object you wish to follow and the task pos should update

 

Edit: Destination parameter that is , the fourth parameter of BIS_fnc_setTask

Edited by gc8
Destination
  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks it is the fourth parameter but I checked here too: https://community.bistudio.com/wiki/BIS_fnc_setTask

and still it does not say how to make the task follow the object. With what I have written it does not. In the page example it says [MHQ,false] which is for [object,precision] . I have to guess that precision is some sort of distance in meters between the target and the task icon and if that is the case then it still does not make the task marker to update. I will try with true to see if it works though.

Share this post


Link to post
Share on other sites
16 minutes ago, JohnKalo said:

Thanks it is the fourth parameter but I checked here too: https://community.bistudio.com/wiki/BIS_fnc_setTask

and still it does not say how to make the task follow the object. With what I have written it does not. In the page example it says [MHQ,false] which is for [object,precision] . I have to guess that precision is some sort of distance in meters between the target and the task icon and if that is the case then it still does not make the task marker to update. I will try with true to see if it works though.

 

I simply put there object and it works if I recall correctly. But I put that for child tasks not the parent...

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Just tested the new method. If I use getPosATL NameOfObject it does not update the position. By placing [NameOfObject,false] it does!

Thanks now only one thing remains. What does the true or false actually do. I do not get what this means exactly:

 

Quote

precisePosition: Boolean - use exact position of the target for map marker / HUD indicator instead of the position known to the owner of the task (depending on the knowledge about the target)

 

Share this post


Link to post
Share on other sites
31 minutes ago, JohnKalo said:

Just tested the new method. If I use getPosATL NameOfObject it does not update the position. By placing [NameOfObject,false] it does!

Thanks now only one thing remains. What does the true or false actually do. I do not get what this means exactly:

 

 

 

I believe it means is the task position always 100% correct on the object OR is it some kind of last known position thing

  • Like 2

Share this post


Link to post
Share on other sites

Well tried it with both and did not see anything different. Although the object was far away from the player it still worked.

Share this post


Link to post
Share on other sites

@JohnKalo,

I'm not quite sure I understand. You want the task marker to stay with the target? This is the simple setup I always use for tasks and they track with the target,
 

Spoiler

[true,["task1"],["Mission Objective","Mission","Target"],objNULL,1,3,false] call BIS_fnc_taskCreate; // create task
["task1","assigned"] call BIS_fnc_taskSetState; //assign and hide task
["task1",[target_obj,true]] call BIS_fnc_taskSetDestination; //set task to objective

 

Hope that helps.

Have fun!

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

@wogz187 The issue was that the task did not follow the moving chopper. Due to the GetPosATL NameOfObject command. I changed it to [NameOfObject,false] and it worked. Before making the campaign I used models which work with moving targets so I never had an issue. Now however that I use scripts the above happened. In your code though [target_obj,true] why true and not false? What does that section do please? 

Share this post


Link to post
Share on other sites

@JohnKalo,

As per the wiki,
 

Quote

[ Object, true ]: Task will be on exact object position, even if player doesn't know about the object

I set it false when the task is hidden at objNull. I don't actually know if that is necessary.

Have fun!

  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×