Page 1 of 1

Any way to obtain the number of alive fighters from a hangar weapon?

Posted: Fri Mar 30, 2018 11:53 pm
by harpy eagle
Is there any way to count the number of destroyed fightercraft from a hangar weapon? "remaining()" will give you the amount of fightercraft the hangar mount can hold, while "missing" gives you the number of fighters that have sortied but these may still be alive.

Is there any way to obtain the tracking object launched from a hangar bay weapon?

Re: Any way to obtain the number of alive fighters from a hangar weapon?

Posted: Sat Mar 31, 2018 12:55 am
by sven
harpy eagle wrote:Is there any way to obtain the tracking object launched from a hangar bay weapon?


Not really. Though you could write one by iterating through all the tactical objects. What you're looking for, basically, is fighters with

Code: Select all

   fighter.src.weapons[fighter.launcher_i] == w

Though if you just want all fighters assosiated with a given ship, this check is simpler, as you could just iterate looking for

Code: Select all

   fighter.src==ship

Re: Any way to obtain the number of alive fighters from a hangar weapon?

Posted: Sat Mar 31, 2018 1:47 am
by harpy eagle
That does work, though searching through every object is a bit too cumbersome for what I want to do.

I guess I'll just stick to counting alive weapons and work around it.