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

A place for discussion of making game modifications.
Post Reply
User avatar
harpy eagle
Posts: 296
Joined: Sat Mar 10, 2018 3:25 am

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

Post 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?
User avatar
sven
Site Admin
Posts: 1621
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

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

Post 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
User avatar
harpy eagle
Posts: 296
Joined: Sat Mar 10, 2018 3:25 am

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

Post 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.
Post Reply