RocketmanAL Posted November 10, 2020 Posted November 10, 2020 In testing a mission I put together I have an enemy flight entering an area where friendlies have been operating. I have the enemy flight set to active the en route task "CAP" if blue forces are still in an area, then deactivate it with the"CAP-x" task if they leave the area. I've done this successfully before in other missions, and I went back to double-check the scripting was correct. Now, the "CAP" task doesn't seem to cancel. Even after leaving the area, the enemy aircraft continues to follow and attempt to shoot me down. I have messages letting me know when the enemy plane changes state. I've also tried with the "Search and Engage in Zone" en route task, as well as a different airframe, with the same result. I also added the "Weapons Hold" ROE task and it ignores that as well. So it seems the "CAP" task is overriding the others and doesn't want to cancel out. Mission attached for reference, and latest log file.Syrian Campaign Mission 2_V1_test.mizdcs.log
Grimes Posted November 11, 2020 Posted November 11, 2020 The way you have it setup is not how you cancel an AI's task. You are pushing a deactivated new task, hence it does nothing. You have to add a "stop condition" to a given task and then make that condition occur. Easiest way is to set a flag value. The CAP task, and every task that is automatically assigned, will take precedence over any others that you add. Its basically the "search and engage" task with default settings. So if you had the default CAP task, then added a "search and engage in zone", the AI will just engage any aircraft that is detected regardless of whether it is in the zone or not because it was told to do that. Your ROE tasks are all in triggered actions and at least in that version of the miz they are not called. 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
Recommended Posts