shnicklefritz Posted August 11, 2019 Share Posted August 11, 2019 (edited) Quick question: I have a unit with several waypoints and a run script command at some of those waypoints as well as lua predicates. Are those scripts and predicates evaluated every second, or only when/if the unit reaches that waypoint? Edit: Also, what happens to the scripts if the unit, for example a AWACS, is shot down? Any help is appreciated. Thank you. Edited August 11, 2019 by shnicklefritz Link to comment Share on other sites More sharing options...
Grimes Posted August 11, 2019 Share Posted August 11, 2019 They get executed as a unit arrives at a waypoint in the order of the tasks. Same with predicates. So with 2 tasks each with a predicate condition it would go something like: Eval Predicate 1 Do Task 1 Eval Predicate 2 Do Task 2 Some tasks however "take time" and basically prevent the next tasking to occur. For instance if you had an Orbit task followed by a Do Script. The script would only be called once the orbit is complete. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum Link to comment Share on other sites More sharing options...
shnicklefritz Posted August 11, 2019 Author Share Posted August 11, 2019 Awesome, thank you for the information! Link to comment Share on other sites More sharing options...
pacastro Posted July 28, 2020 Share Posted July 28, 2020 They get executed as a unit arrives at a waypoint in the order of the tasks. Same with predicates. So with 2 tasks each with a predicate condition it would go something like: Eval Predicate 1 Do Task 1 Eval Predicate 2 Do Task 2 Some tasks however "take time" and basically prevent the next tasking to occur. For instance if you had an Orbit task followed by a Do Script. The script would only be called once the orbit is complete. Lua Predicates in conditions of advanced waypoints actions start to get executed once the unit arrives at the waypoint, and continue to get evaluated every second or so until the condition is met and then the action gets triggered. Its like they are pushed into a run once trigger with the condition you set. I have had waypoints actions get executed hours after the unit reached the waypoint that had them because the lua predicate condition was met hours after that waypoint was passed. Not sure if this as intended or a bug. Check the attached small mission, I have set 1 unit with a waypoint action (text output in Do Script) at startup waypoint that has a lua predicate condition (flag 11 = 2), in mission triggers I start with flag 11 set to 1, and 30 seconds into mission I set it to 2. Unit moves to waypoint 2 (20 seconds onto mission) and there it has another waypoint action that outputs "test 3" text without conditions.... 10 seconds later the flag is changed to 2, the lua predicate condition for first waypoint action is met and "test 1" and "test 2" are outputted.condition_bug2.miz Link to comment Share on other sites More sharing options...
Recommended Posts