I was looking for a boolean condition that I could use in order to detect if an objective was completed so that a trigger would activate. So I found the answer from this webpage: http://forums.bistudio.com/showthread.php?137869-Check-if-task-succeeded.
Upon testing that though I noticed taskState doesn't work, and I don't think I'm doing anything wrong with the code. {F25074}
Description
Details
- Legacy ID
- 3279662234
- Severity
- None
- Resolution
- Open
- Reproducibility
- Always
- Category
- Scripting
1.) Open the editor.
2.) Spawn a Blufor unit.
3.) Create two triggers
4.) For the first trigger set Activation: Blufor, Once, Present.
Condition: this
5.) For the second trigger set Activation: None, Once, Present.
condition: taskState tskSomeTask == "Succeeded"
On Act: hint "It works!";
6.) Next, create a task using modules.
7.) Create a "create task" module and "set task state" module.
8.) Name the task ID in the create task module: tskSomeTask
9.) Set the task state to "SUCCEEDED". Then Sync up the set task state with the first trigger and the create task module. Also, sync the create task module to the player.
10.) Now preview the mission and walk into the first trigger's radius. The hint will not display meaning the trigger didn't fire.
Here's where I got the code from. It's an old post from 2012.
http://forums.bistudio.com/showthread.php?137869-Check-if-task-succeeded