Jump to content
Sign in to follow this  
Spriterfight

HELP Check if unit is in position

Recommended Posts

i want a script that checks if the unit is in formation ,when a unit is is ready they say ready to fire,is there a way to check this when they say that?

Share this post


Link to post
Share on other sites

Try this to check if unit is following his formation:

_isInFormation = (expectedDestination _unit select 1) isEqualTo "DoNotPlanFormation";

You can check overall "Ready" status by using:

_isReady = unitReady _unit;

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

unitReady page doesn't reflect its locality, but be aware it should be run where the unit being checked is local.

 

My own testing in the past showed the unitReady command only gave an accurate return on the machine where the unit was local.  When the command was run on a machine where the unit was not local, it always returned true, regardless whether the unit was ready or not ready.  And that caused scripts and fsm's which were relying on it to jump the gun, advancing instead of waiting.

  • Like 1

Share this post


Link to post
Share on other sites

 

1 hour ago, Spriterfight said:

i want a script that checks if the unit is in formation ,when a unit is is ready they say ready to fire,is there a way to check this when they say that?

By the way, notice that the words "Ready to fire" do not mean that the unit follows the formation. Units say this when their combat mode prohibits them from opening fire (blue, green and white combat modes).

  • Like 2

Share this post


Link to post
Share on other sites
34 minutes ago, opusfmspol said:

unitReady page doesn't reflect its locality, but be aware it should be run where the unit being checked is local.

 

My own testing in the past showed the unitReady command only gave an accurate return on the machine where the unit was local.  When the command was run on a machine where the unit was not local, it always returned true, regardless whether the unit was ready or not ready.  And that caused scripts and fsm's which were relying on it to jump the gun, advancing instead of waiting.

When does ready fires actually?When a unit is at his position?

Share this post


Link to post
Share on other sites

I don't know the exact answer to that.  I suspect the behavior is controlled by internally used .fsm's, but could be wrong.

 

From observation, they report "Ready" when a command is given and they complete the command.  (Or maybe a better way to say it is that an action gets commanded, and they complete the action, because not every command will provoke a response of "Ready" from them.)  They report "Ready to fire" when restricted from firing, but are given a target and they have acquired the target in their sights (regardless whether they are in formation).

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×