Jump to navigation Jump to search
- Creates a new Task and adds it to the Diary.
- The task effect is local, it will only exist on the client it was added.
- unit createSimpleTask [name, parentTask]
- unit: Object - Unit to add this new task
- name: String
- parentTask: Task - (Optional, taskNull) - The new task will be a sub task of the parent task
- Return Value:
- Task - The new task
- Example 1:
- Example 2:
- See also:
- simpleTasks removeSimpleTask setSimpleTaskDescription setSimpleTaskDestination setTaskState setTaskResult taskState Tasks Briefing
- Posted on Jul 02, 2011 - 11:45 (UTC)
- Creating child will position the new task just under the parent task.
- Creating another "normal" (parent) task will create a new line above the others. Think of it if you want ordered objectives.
- Succeeding parent task will automatically succeed childs, whatever their taskState was set to. (I.E. If a task is set as a child to another, it will be completed when its parent is complete.. no matter if the child task really was or not).
- This command has to be executed again for it to be applied for JIP players - no server sync
Step 1: create a new simpleTask
Step 2: task destination
variable/pointer-to-your-task setSimpleTaskDestination some-position. That's it.MySimpleTask setSimpleTaskDestination _destination;
Step 3: task descriptionAgain, no magic involved here. You take your task, the command setSimpleTaskDescription an pass an array with three strings in it. The first string is the long description text, the second is the name/title of the task and the last one will show up on-screen on the waypoint in cadet mode.
Step 4: set and update task statesAnd that's it. Here a minimal working example:MySimpleTask setTaskState "CREATED";And then later in the mission:If you want to keep the player in the loop about the status of tasks, you may always do this:MySimpleTask setTaskState "SUCCEEDED";