Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: MP-Ryan on June 10, 2007, 06:53:42 pm

Title: Playing with Directives
Post by: MP-Ryan on June 10, 2007, 06:53:42 pm
I did a search and couldn't find this specific issue covered, so here goes.

Let's say I want to keep a relatively clean directives list so everything shows up as it should when all hell breaks loose, and thus I want to consolidate all my "destroy <wing>" directives into "Destroy all fighters" and a second one for "Destroy all bombers."

I THOUGHT it would be easy, that I could use the ship-type-destroyed SEXP and set it to 100% of fighters and 100% bombers.  Ha.  No.  That calculates fighters and bombers present in the mission.  If you clear them out, even though waves will respawn later, that directive goes to true.  Simply marvelous.

Then I tried using is-destroyed-delay, and adding all the fighter wings and all the bomber wings.  Problem is, because they enter the mission at various times, the directive doesn't show up until every wing has arrived.  That didn't work either.

So them, is desperation, I tried dummy events.  No dice there either - same effect as above.

So - is it possible to add a directive that tells you to destroy all of a certain kind of ship, even before all of those ships enter the mission, and doesn't complete until all respawns have ceased?  Or is there another way to do this?
Title: Re: Playing with Directives
Post by: BlueFlames on June 10, 2007, 08:23:20 pm
Seems you're trying to overcomplicate things....  Completed and failed directives will be automatically removed from the directives window in favor of incomplete directives after a certain threshold has been reached.  Unless you've got a crazy-huge load of tasks to be doing in parallel, you'll never have more than four or five directives on-screen at once.  That's why really long missions don't end up with a directives window that spans the entire height of the screen.

If that's not good enough for you, you could always try setting up a hostile stealth fighter, out in the middle of nowhere that departs once all of the fighters are destroyed.  Then you use a dummy event to setup when the directive appears and key the directive to be true once the stealth fighter departs.  The downside to this is that, unlike a typical "DESTROY EVERYTHING!" directive, this one will not keep count of the remaining fighters in the field.  (Wash, rinse, and repeat for the bombers, by the way.)
Title: Re: Playing with Directives
Post by: GenericCorvette on June 11, 2007, 07:01:09 pm
Have you tried percent-ships-destroyed?
Title: Re: Playing with Directives
Post by: karajorma on June 12, 2007, 01:46:12 am
If that's not good enough for you, you could always try setting up a hostile stealth fighter, out in the middle of nowhere that departs once all of the fighters are destroyed.  Then you use a dummy event to setup when the directive appears and key the directive to be true once the stealth fighter departs.  The downside to this is that, unlike a typical "DESTROY EVERYTHING!" directive, this one will not keep count of the remaining fighters in the field.  (Wash, rinse, and repeat for the bombers, by the way.)

You only need to do that kind of thing with Retail. In FSO 3.6.9 you'd simply make an event that checks if everything is destroyed and then use

when
-is-event-true-delay
--All Ships Dead
--0
--False

The last false tells the game to use the is-event-true only as a condition for making the directive become true and not to use it as a condition for making the directive appear in the first place.
Title: Re: Playing with Directives
Post by: MP-Ryan on June 12, 2007, 10:42:59 am
percent-ships-destroyed worked.

Though karajorma, I initially tried something like that and couldn't figure out how to add the optional false clause (the add-data menu on the right click didn't work...)
Title: Re: Playing with Directives
Post by: karajorma on June 12, 2007, 11:10:25 am
You have FS2_Open 3.6.9?
Title: Re: Playing with Directives
Post by: Colonol Dekker on June 12, 2007, 11:17:27 am
You want the directive to re-show and re-validate for each new wing?

Hmmm.....................I'll think about that one.
Title: Re: Playing with Directives
Post by: Mustang19 on June 12, 2007, 11:58:57 am
Kind of like what was mentioned earlier, except have a few far-off Ulysses, one for each fighter and bomber. Make the directive set to destroy all of these Ulysses; the Ulysses are "tied" to an individual enemy ship, and will self-destruct when that ship is destroyed. The only drawback is that your Events log is going to be cluttered with destroyed dummy ships. Alternatively, you can use departure rather than destruction. Or, you *may* be able to use ship-dissapear, which functions exactly like ai-warp-out, except it doesn't appear in the events log.

You can figure it out, Ryan, we're no more creative than you are!  :pimp:
Title: Re: Playing with Directives
Post by: Goober5000 on June 12, 2007, 05:13:18 pm
(the add-data menu on the right click didn't work...)
Did you try add-operator?
Title: Re: Playing with Directives
Post by: MP-Ryan on June 14, 2007, 03:16:32 pm
(the add-data menu on the right click didn't work...)
Did you try add-operator?

No... I see that works, but I thought it would be a thrid data field under the event and the name, not an additional operator.  *shrug*  So it's supposed to use a 'false' operator?

EDIT:  And yes, I'm using Fred2 Open 3.6.9
Title: Re: Playing with Directives
Post by: karajorma on June 14, 2007, 04:50:24 pm
IIRC yes. If I'm wrong the directive will only actually appear when the directive is complete. Which is the default behaviour for the is-event-true-delay SEXP anyway. :)