Tasks
Your character can be controlled by your script, and given actions that override manual control of the player. These actions are called
Now we can give tasks to the character by adding the
Game.Player.Character.Task
Finally we can specify what task to give the character by choosing a task from TaskInvoker list of possible actions.
Game.Player.Character.Task.Jump(); //Jump once
Game.Player.Character.Task.WanderAround(); //Wander around indefinitely
Game.Player.Character.Task.HandsUp(3000); //Hands up for 3 seconds
Game.Player.Character.Task.TurnTo(GameplayCamera.Position); //Turn towards the camera
Some of the tasks are temporary and get executed once or accept a time parameter (in milliseconds). Others are persistent, meaning they will keep being executed until the task is actively stopped. To stop all tasks you can use the
Game.Player.Character.Task.ClearAllImmediately();
TASK SEQUENCES
You can create a sequence of multiple tasks by using
TaskSequence mySeq = new TaskSequence();
mySeq.AddTask.Jump();
mySeq.AddTask.HandsUp(3000);
mySeq.Close();
Game.Player.Character.Task.PerformSequence(mySeq);