Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Titan on January 24, 2007, 12:00:14 pm

Title: realistic campaigns
Post by: Titan on January 24, 2007, 12:00:14 pm
is it possible to make it seem as if a certain ship survives, then it can be carried on to a later mission, but if it bites the dust, you never hear from it again....... it was just that in the fs2 campaign only a few ships were carried from mission to mission, and i think this has  to do with its rather difficult to get them to keep going through missions because of all the possible outcomes.

getting to the point, is it possible to have a ship come in using the event that checks if an event in a previous mission is true. Im trying to make it seem as if there only is 20-odd ships in the force you are part of in my campaign.
Title: Re: realistic campaigns
Post by: FUBAR-BDHR on January 24, 2007, 01:42:00 pm
Definately.  There are a couple of sexps for this.  is-previous-goal- and is-previous-event-.  You just put the ship in the mission and have the arrival based on one of those. 
Title: Re: realistic campaigns
Post by: Polpolion on January 24, 2007, 01:43:26 pm
Huh. I thought you could only do that with persistent variables. Or whatever they're called.
Title: Re: realistic campaigns
Post by: Admiral Edivad on January 24, 2007, 01:45:37 pm
it gets a bit complicated when you have a lot of these events scattered through all the campaign...
Title: Re: realistic campaigns
Post by: peterc10 on January 24, 2007, 03:20:24 pm
it gets a bit complicated when you have a lot of these events scattered through all the campaign...

amen 2 that.  :)
Title: Re: realistic campaigns
Post by: karajorma on January 24, 2007, 03:31:37 pm
Huh. I thought you could only do that with persistent variables. Or whatever they're called.

PVs offer you much finer control than is-previous-event-true. All you can do with is-previous-event-true is get a True/False out of the previous mission. Sometimes that's enough but for when it isn't, PVs allow you to carry over numbers or words. :)
Title: Re: realistic campaigns
Post by: FUBAR-BDHR on January 24, 2007, 03:39:48 pm
Just looked at the main campaign and they do it there.  Not often but they do it.  The only drawback is in testing and multiplayer.  If the previous mission has not run then the sexps defualt to something.  Can't remember what.  If there are only a couple of places that a ship can be destroyed you can also just branch the campaign based upon the outcome and create 2 missions later on.  One with the ship, one without.  I've tried both and the multiple mission one seems to work the best for multiplayer but I only have one ship that might be captured or not.

Here's a simple 2 mission camp I tossed together.  Just run the first mission do nothing for 31 seconds and jump. fs2_sexp_test.rar (http://fubar4.fubar.org/fubar/fs2_sexp_test.rar)
Title: Re: realistic campaigns
Post by: karajorma on January 24, 2007, 06:26:32 pm
This is one reason why the persistent variables are nicer than the SEXPs. If you run a game from the techroom a persistent variable simply uses whatever the default for the missions is. That means that you can easily predict what the default will be and can change it for playtesting.

This means that you can have a mission set up differently if a goal succeeded, failed and if the player is just playing from the techroom.
Title: Re: realistic campaigns
Post by: KappaWing on January 27, 2007, 07:41:39 am
One SEXP solves everything for me, everytime.

ship-guardian  :p
Title: Re: realistic campaigns
Post by: NGTM-1R on January 27, 2007, 08:37:57 am
ship-guardian  :p

To keep from looking like a total copout, though, you really need an additional departure cue, ship-invunerable, and repair-subsystem.
Title: Re: realistic campaigns
Post by: karajorma on January 27, 2007, 11:09:59 am
One SEXP solves everything for me, everytime.

ship-guardian  :p

Only lamers use ship-guardian without a very good reason.

Ship-guardian-threshold + ship-subsys-guardian-threshold > *

:p
Title: Re: realistic campaigns
Post by: Mobius on January 27, 2007, 12:55:10 pm
Or modify-variable hits-left when you want to keep a ship's status.


Only lamers use ship-guardian without a very good reason.

Ship-guardian-threshold + ship-subsys-guardian-threshold > *

:p

I'm not a lamer...whatever it means.

I do exactly what Karajorma wrote.
Title: Re: realistic campaigns
Post by: karajorma on January 27, 2007, 01:30:03 pm
I was joking with kappa wing mostly. But the big problem with using ship-guardian is pretty much the one I pointed out in my FAQ.

Quote
Ship-Invulnerable means that a ship can't be damaged by anything. No matter what happens the ship will remain at 100% (or whatever the damage was when it was at when the SEXP triggered). Ship-Guardian allows a ship to take damage until the ship reaches 1%. After that the ship becomes invulnerable. Careful use of both can fool the player and prevent him from realising that the ship is protected (A wing of ships at 100% at the end of a mission is a big sign that Ship-Invulnerable was used while a wing at 1% is just as obviously a sign of Ship-Guardian's use. )

Ship-guardian-threshold is a great way to get around that especially if you randomise the threshold like this

ship-guardian-threshold
-rand
--65
--73
-Ship Names

Once you've done that a player will have to be watching very closely to spot that a ship is guardianed as the hull percentage at which he is guardianed will change every time the mission runs.


Title: Re: realistic campaigns
Post by: Mobius on January 27, 2007, 03:45:30 pm
Unfortunately sometimes you can't use ship-subsys-guardian-threshold to ensure yourself that a fighter can't be disabled. There are "engine", "engines" and sometimes even "engine01" "engine02". :(
Title: Re: realistic campaigns
Post by: NGTM-1R on January 29, 2007, 03:11:54 am
Repair-subsystem.
Title: Re: realistic campaigns
Post by: CP5670 on January 29, 2007, 10:38:25 am
I use ship-invulnerable and ship-guardian-threshold together for fighters. A fixed cutoff value works fine as long as you don't choose round-looking numbers. I make the ship guardian at the beginning and have another event that renders the ship invulnerable when its strength falls to the guardian threshold. If you use only the guardian feature, it tends to get disabled/disarmed easily and looks silly, and if you only use the invulnerable option, it can still die if it gets hit by a powerful weapon (suddenly reducing its strength to 0 before the invulnerable sexp kicks in).
Title: Re: realistic campaigns
Post by: karajorma on January 29, 2007, 12:48:11 pm
Something needs to be done about that last one. :) I'd heard previously that it was a problem with ship-guardian rather than ship-invulnerable. Can you confirm that it is definitely the latter?
Title: Re: realistic campaigns
Post by: Mobius on January 29, 2007, 01:37:44 pm
Repair-subsystem.

What do you mean? I'm talking about wingmen fighters. Their engine subsys name changes...sometimes(Claymore Mk.2, for example. It has 4 engines).

I think I can solve this with when-argument....every-of all the possible engine names,then ship-subsys-guardian-threshold...


About the threshold...I think I have just found an interesting SCP bug: a fighter of your wing with ship-guardian-threshold is destroyed with self-destruct...The balls that represents him/her in the "wingmen" part of the HUD, however, considers the fighter as badly damaged!
Title: Re: realistic campaigns
Post by: CP5670 on January 29, 2007, 11:35:32 pm
Something needs to be done about that last one. :) I'd heard previously that it was a problem with ship-guardian rather than ship-invulnerable. Can you confirm that it is definitely the latter?

It may be an issue with both, actually. The thing I mentioned with ship-invulnerable sounds like it should be rare but I have had it happen many times in the past. It stopped occurring when I also added in ship-guardian-threshold into my missions.

However, I've also heard people reporting that Snipes occasionally dies in "Love the Treason," where I believe ship-guardian is used (I may have had it happen myself, can't remember now).
Title: Re: realistic campaigns
Post by: Goober5000 on January 30, 2007, 12:03:25 am
The problem is not with ship-guardian or ship-invulnerable, it's with the less-than sexp.  Or, alternatively, it's not a problem at all; it's a design decision.  If you have ship-invulnerable set to go off when a fighter's hull strength drops below 50, and said fighter gets hit with a missile that drops him from 75 to 0 instantly, it's too late.  The solution is to ship-guardian him when the mission first starts, and then use a ship-invulnerable sexp later on if that's your thing.

I've had Snipes die on me too, on rare occasions.
Title: Re: realistic campaigns
Post by: Mobius on January 30, 2007, 01:45:03 am
Me too...

What about the bug I found? Should I report it in Mantis?
Title: Re: realistic campaigns
Post by: karajorma on January 30, 2007, 06:06:15 am
The problem is not with ship-guardian or ship-invulnerable, it's with the less-than sexp.  Or, alternatively, it's not a problem at all; it's a design decision.  If you have ship-invulnerable set to go off when a fighter's hull strength drops below 50, and said fighter gets hit with a missile that drops him from 75 to 0 instantly, it's too late.  The solution is to ship-guardian him when the mission first starts, and then use a ship-invulnerable sexp later on if that's your thing.

That's why I asked for confirmation that the problem was actually with ship-invulnerable. I'm pretty sure that most of the reports of it not working are due to this exact cause rather than any actual problem with the SEXPs.

A look at Love the Treason..... pretty much confirms that. Simply adding a ship-guardian at mission start would prevent Snipes from ever being killed in that mission.

Incidentally as far as I can see the mission Jim Boone was completely unaware of the existance of the add operator option in FRED. Every single event I looked at seemed to work like this

Event 1
when
-trigger
-Do one Thing

Event 2
When
-Same Trigger as Event 1
-Do something else

I can't think of any sensible reason for making 26 seperate events for the destruction and sabotage of the NTF wings when it could have been done in 3 or 4.
Title: Re: realistic campaigns
Post by: Qwer on January 31, 2007, 04:18:51 am
Currently there's no reallistic campaigns (I mean those which has got high realism level for FreeSpace standards). I don't know what's about other in-progress ones, but Earth Defence and Phoenix will try to keep large realism level.
Title: Re: realistic campaigns
Post by: NGTM-1R on January 31, 2007, 08:33:57 am
Repair-subsystem.

What do you mean? I'm talking about wingmen fighters. Their engine subsys name changes...sometimes(Claymore Mk.2, for example. It has 4 engines).

I think I can solve this with when-argument....every-of all the possible engine names,then ship-subsys-guardian-threshold...

Even with only one working engine, a ship will still be able to depart or move at full speed. (You have to specify it slowing down in response to engine damage.)
Title: Re: realistic campaigns
Post by: Mobius on January 31, 2007, 01:20:40 pm
But multiple engines are name like "engine1", "engine01", "engine2" ecc.
Title: Re: realistic campaigns
Post by: NGTM-1R on January 31, 2007, 02:49:22 pm
You only have to have one name, still.
Title: Re: realistic campaigns
Post by: Mobius on January 31, 2007, 05:34:56 pm
And how? I'm not the modeller that created the spacecraft I use in my missions.

I may try to use every-of with all the possible engine subsystem names, but the game could crash.
Title: Re: realistic campaigns
Post by: NGTM-1R on February 01, 2007, 01:34:35 am
You know the subsystem names; you should. It gives them to you. Just use a single one of them on the repair-subsystem.
Title: Re: realistic campaigns
Post by: Mobius on February 01, 2007, 05:26:40 pm
Ship selection? Changing fighter or bomber? Claymore Mk.2?