fanqi1234 Posted July 26, 2020 Posted July 26, 2020 Ultimately, I'm trying to use dynAdd to add an AI plane near the player, but I'm not sure how can I task this dynamically added AI plane to attack the player. The unit spawns, does nothing, and tries to land at nearest airport. I tried to use controller pushTask to push an "AttackUnit" task, but after that the controller:hasTask() still shows false. I suspect that's because the "core AI behaviour" determined by the group's Role isn't set, but I'm unable to figure out how to do that in the documents. So, is it a correct way to use pushTask to task a dynamically added air unit using mist.dynAdd? If so then why hasTask shows false after pushTask?
Grimes Posted July 27, 2020 Posted July 27, 2020 Sounds like you need to give it at least a basic route as you spawn it. AI ignore any new tasking given if they initiate their RTB procedures. You'd need to add a route parameter with a couple of waypoints. It basically is this: https://wiki.hoggitworld.com/view/DCS_task_mission But obviously not all of those entries are needed. IIRC it just needs x, y, alt, speed. Give it a couple waypoints and at least a decent distance. You can also embed the attack unit task into it directly if you want to. 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