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

A place for discussion of making game modifications.
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?

Postby harpy eagle » Fri Mar 30, 2018 11:53 pm

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?

Postby sven » Sat Mar 31, 2018 12:55 am

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?

Postby harpy eagle » Sat Mar 31, 2018 1:47 am

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.


Return to “Modding”

Who is online

Users browsing this forum: Google [Bot] and 20 guests