Jump to content

Determining if "fire at point" is finished


rikkles

Recommended Posts

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

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 ServerScripting 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

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

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

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 ServerScripting 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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...