Modding, Mission Design, and Coding > The FRED Workshop

Count number of bombs destroyed


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.

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:
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.

Great I'll have a look at both options, much appreciated 0rph3u5

Colonol Dekker:
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:


[0] Message Index

Go to full version