rikkles Posted May 10, 2018 Share Posted May 10, 2018 Hello, I'm having trouble determining when a "fire at point" task is finished. There's no way to set a flag at the conclusion of a task, and if I do a hasTask() it always returns TRUE even before firing (maybe because the unit had moved through waypoints before the firing task). If I could see the list of active tasks for a group controller it would work, but I don't know if we have access to that table. The docs certainly don't show an API for that. Thanks! Link to comment Share on other sites More sharing options...
rikkles Posted May 17, 2018 Author Share Posted May 17, 2018 Revisiting the above. One kludgey solution I found is to add another movement task after the fire at point task, which then triggers a zone flag. But that's really ugly. Link to comment Share on other sites More sharing options...
Grimes Posted May 17, 2018 Share Posted May 17, 2018 Count the shot events for that unit/group. Or use Unit.getAmmo() and count rounds that way. If you assign a mission task for it then you could have the first task be fireAtPoint and the 2nd task be a do script call for a function or setting a global value to something. 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...
rikkles Posted May 17, 2018 Author Share Posted May 17, 2018 Count the shot events for that unit/group. Or use Unit.getAmmo() and count rounds that way. If you assign a mission task for it then you could have the first task be fireAtPoint and the 2nd task be a do script call for a function or setting a global value to something. Thanks for the idea to count the shots or ammo. The problem I had with the mission tasks is that there is no script task, only a script command, and script commands are executed instantly (from what I can tell). I would have easily solved the problem with a script task that would be pushed onto the stack and executed serially after the fireAtPoint command. Link to comment Share on other sites More sharing options...
rikkles Posted May 18, 2018 Author Share Posted May 18, 2018 Thanks Grimes, I ended up counting the shot events for the group. However one really weird thing I found was that when the paladins stop firing and end the task, they revert to the waypoint tasks from the ME, starting at WP 0. Maybe it's because I created the Fire at Point task in a script, with pushTask(). The only way I found to get the paladins to finish firing, stay in position and await new orders is to turn off the controller at the end of the fire task, and turn it back on when I push a new task on the stack later. Link to comment Share on other sites More sharing options...
Grimes Posted May 18, 2018 Share Posted May 18, 2018 If they are stationary anyways the setTask() will essentially write over their previous tasking. AI driving back to their initial WP after a push task was complete should have been fixed with 2.5.1. 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...
Recommended Posts