Author Topic: Detecting destroyed wings with waves launching from carriers  (Read 1475 times)

0 Members and 1 Guest are viewing this topic.

Offline IPAndrews

  • Disgruntled Customer
  • 212
  • This site stole my work
Detecting destroyed wings with waves launching from carriers
The problem:

You have a wing called "Wing" which consists of 1 fighter (yes I know it's dumb but it's just an example case). That wing has 6 waves. It launches from a carrier ship called "Carrier".

How do you detect that the wing has been dealt with (destroyed/departed/can no longer affect the mission) when there is the potential for the carrier to be destroyed before all of the waves of the wing are launched?

Existing code:

This is what I have at the moment.
------------------------------------------------------------
event called "wing destroyed"
when-argument
   every-of
        Wing 1
        Wing 2
        Wing 3
        Wing 4
        Wing 5
        Wing 6
or
     and
           has-arrived <argument>
           is-departed-or-destroyed <argument>
     and
           not
                 has-arrived <argument>
           or
                 is-subsystem-destroyed
                      "Carrier"
                      "fighterbay"
                 is-destroyed-or-departed
                       "Carrier"
--------------------------------------------------

My question. Can anyone come up with something less bloated that achieves the same thing?
Be warned: This site's admins stole 100s of hours of my work. They will do it to you.

  

Offline Al Tarket

  • 28
  • A resident nutcase from Jerusalem.
    • An FSO Modification site
Re: Detecting destroyed wings with waves launching from carriers
i have wondered the same thing, ive had to compromise my 1st campaign a few times before it was destroyed. everytime i want to get some fighters out their i have to have them launched as asson as the mission starts.

take for example the PVN Pinnacle which launched the Elimini wing and Takami wing. their are supposed to be 4 waves each but the objective was destroyed and the pinnacle warps out leaving 2 waves missing and hence the objective remains uncompleted. the only way around it is by putting them from ship dock to warp in.
Cowardice is no selfishness, Friendliness is no enemy and Information is no attack platform.

Judge these words wisely and you might make it through this cruel world.

 

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Re: Detecting destroyed wings with waves launching from carriers
Maybe use destroyed-or-departed-delay and every-of sexps to modify variables? When every ship in wing one is destroyed or departed, add ne to "Wings-gone" variable. When Wings-gone > 5, all the ships are dead, or flick the variable up to seven when the carrier is destroyed and 8 when the fighterbay is destroyed?

I think. Though It's kind of hard to understand exactly what you want.
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline IPAndrews

  • Disgruntled Customer
  • 212
  • This site stole my work
Re: Detecting destroyed wings with waves launching from carriers
I think. Though It's kind of hard to understand exactly what you want.[/bw]

Some smaller code that achieves the same thing that's all :). The counters idea is a good one. It will be interesting to see if the counter variable version is as compact as the complex logic version above. Anybody want to post some code?
Be warned: This site's admins stole 100s of hours of my work. They will do it to you.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Detecting destroyed wings with waves launching from carriers
I believe you can just use destroyed-or-departed-delay and the wing name.  I think that sexp takes into account the remaining wings not being able to arrive and returns true. 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras