Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: wistler on August 26, 2020, 06:38:03 am

Title: Count number of bombs destroyed
Post by: wistler on August 26, 2020, 06:38:03 am
Hi all, is there a way of counting the number of bombs (or type of bomb) that have been destroyed in a mission?
The bombs are created using the create-weapon event (1 event per bomb) and no other bombs are used anywhere else in the mission.
Title: Re: Count number of bombs destroyed
Post by: 0rph3u5 on August 26, 2020, 07:12:24 am
Two ways, I can think of right away:

a) you can count up the weapons fired by checking ammo-count of the secondary banks of bombers. Which then can add to a variable, to which you can also add with the event that does the weapon-create. This as downside as it would not work for turrets unless you table in an ammo count for each turret.
Problem is then to confirm the destruction of a bomb before impact ... which can be managed with armor values and precise damage values.

b) Axem's Markbox-script has a handy collection of lua-sexp for the exact purpose:
https://github.com/AxemP/AxemFS2Scripts/tree/master/MarkBox/data
with it you can count up the ammount of a specific secondary weapon fired in a mission (lua-mark-weapon & lua-count-weapon), and also run a distance check of a specific weapon type (lua-get-weapon-distance) to check for impacts.

b) is much simpler and probably exactly what you want.
Title: Re: Count number of bombs destroyed
Post by: wistler on August 26, 2020, 09:02:04 am
Great I'll have a look at both options, much appreciated 0rph3u5
Title: Re: Count number of bombs destroyed
Post by: Colonol Dekker on August 26, 2020, 12:59:29 pm
Bomb destroyed count?
My mind went to how we/tolwyn and I did the skipper missiles in WCS (OG years before saga).   What we did was make a dedicated new ship class and give it the kamikaze flag with attack orders.  Easily countable in any number of ways.

But if Axem has a script, more power to ya  ;) :yes: