Page 1 of 1

new function: isVTOLidle()

Posted: 15 Apr 2010, 15:02
by DylanDog
Hello

Would be nice to have a function to check if a single VTOL is idle or not. While you can do this with not VTOL droids by checking the order given, this is not possible with VTOLs.

isVTOLidle() should return true when:
  • The weapon is fully charged. If the VTOL is rearming should return false.
  • There are no orders assigned to it.
  • VTOL is not flying (this is just "nice to have").
If you know a way to check this without using a a new function let me know.

DD

Re: new function: isVTOLidle()

Posted: 15 Apr 2010, 20:39
by Zarel
Check the action. DACTION_NONE (doing nothing) or DACTION_DROIDREPAIR (auto-repairing) means "idle".

Re: new function: isVTOLidle()

Posted: 15 Apr 2010, 22:28
by DylanDog
Zarel wrote:Check the action. DACTION_NONE (doing nothing) or DACTION_DROIDREPAIR (auto-repairing) means "idle".
DACTION_NONE is missing in the scripting manual.

Do I check it with:

Code: Select all

if ( droid.action == DACTION_NONE){ do some stuff }
?

Re: new function: isVTOLidle()

Posted: 16 Apr 2010, 00:04
by Per
That should work. The droid.action stuff is somewhat recent, I think (ie not 1.10).

Re: new function: isVTOLidle()

Posted: 16 Apr 2010, 13:32
by DylanDog
thanks