Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Lorric on December 18, 2012, 07:15:13 pm

Title: Death to Debriefing
Post by: Lorric on December 18, 2012, 07:15:13 pm
I want my mission to go to a debrief on the death of the player.

Telling it to end the mission on the death of the player's ship does work, but it takes way too long. Too long for the player to realise that there will be a debrief on their death.

( is-destroyed-delay
- 0
- Player's ship

- End mission )

Is there any way to speed this up? Ideally with the debrief screen appearing immediately on the player's death, or at least before the options menu appears.
Title: Re: Death to Debriefing
Post by: Droid803 on December 18, 2012, 07:18:32 pm
try hits-left i haven't tried it myself but it might offer a different result if you trigger off hits left <= 0 (or maybe <1)
Title: Re: Death to Debriefing
Post by: Lorric on December 18, 2012, 07:49:57 pm
try hits-left i haven't tried it myself but it might offer a different result if you trigger off hits left <= 0 (or maybe <1)

I'm sorry, I'm struggling with how to use hits-left to set up an sexp that the computer likes. How would you set it up, if you don't mind?
Title: Re: Death to Debriefing
Post by: Droid803 on December 18, 2012, 08:35:01 pm
try


op when
      op <
           op hits-left
                Salad Alfalfa 1
           1
      op end-mission

?

dude bro you gotta skate bro
Title: Re: Death to Debriefing
Post by: Black Wolf on December 18, 2012, 08:36:40 pm
First, set the player's ship to be "ship guardian" in the ship editor so that you'll take damage as normal down to 1%. Then, set up an = sexp (when, =, hits-left, Alpha 1, 1, end-mission). You might instead want to use a fade out sexp to white or red.

[EDIT]Ninjaed
Title: Re: Death to Debriefing
Post by: mjn.mixael on December 18, 2012, 08:38:00 pm
The unsaid here is that you can't have anything trigger when the player actually dies. At that point it's too late. FSO stops running events.
Title: Re: Death to Debriefing
Post by: karajorma on December 18, 2012, 08:45:02 pm
The unsaid here is that you can't have anything trigger when the player actually dies. At that point it's too late. FSO stops running events.

I don't think it does actually. I'm pretty sure I've gotten

( is-destroyed-delay
- 3
- Player's ship

- End mission )

to work before. I used that to allow the player to see the death roll and then end the mission before the option to replay appeared. If that's not working now, something changed.
Title: Re: Death to Debriefing
Post by: Lorric on December 18, 2012, 08:56:20 pm
try


op when
      op <
           op hits-left
                Salad Alfalfa 1
           1
      op end-mission

?

dude bro you gotta skate bro

I asked you in the other thread what "skate" means.

Thanks for the answer, but I might be able to get around the need for this another way. I'm trying to make a branching campaign (the idea is for the missions to be loose in the mission folder, but with instructions on which one to play next in the debriefing, or to tell you you lost.) Maybe I just need the instructions in the briefing instead. Not as desirable, but it will do. And it's only a problem if the mission ends in the player's death, otherwise I still get what I wanted.

The <. I didn't realise that that's what it was.

The unsaid here is that you can't have anything trigger when the player actually dies. At that point it's too late. FSO stops running events.

I don't think it does actually. I'm pretty sure I've gotten

( is-destroyed-delay
- 3
- Player's ship

- End mission )

to work before. I used that to allow the player to see the death roll and then end the mission before the option to replay appeared. If that's not working now, something changed.

I gave this a try too. It just took longer to end the mission.
Title: Re: Death to Debriefing
Post by: Black Wolf on December 18, 2012, 09:01:30 pm
Not sure if it's related or not, but I reported a mantis bug (http://scp.indiegames.us/mantis/view.php?id=2683) that Goober has since resolved where sexps stopped firing after the warpout sequence started. Not the same as death, but if they are related, it might have meant that there were periods where you could and periods where you couldn't use sexps after the mission has ended (either by death or warpout).
Title: Re: Death to Debriefing
Post by: Lorric on December 18, 2012, 09:05:36 pm
I gave Droid's method a try, but that didn't work at all. Which is curious, since you'd think it would at least have the same effect as is-destroyed.

I'm going to try = 0...

No, that didn't work either. Strange.
Title: Re: Death to Debriefing
Post by: Lorric on December 18, 2012, 09:16:41 pm
Right, I've bitten the bullet.

I've removed the death events and the death debriefings and changed the briefings accordingly.
Title: Re: Death to Debriefing
Post by: General Battuta on December 18, 2012, 09:59:03 pm
Why. That's dumb. I have death events in a bunch of missions in BP2 and unless they all broke under 3.6.14, they work fine.

Post the exact events you were using so we can tell you the incredibly simple way to make this work.
Title: Re: Death to Debriefing
Post by: jg18 on December 18, 2012, 10:27:35 pm
Doesn't Vassago's Dirge also have death events (as in death goes to debriefing), as just another example? Dunno if those work the same way as yours (Battuta), though.
Title: Re: Death to Debriefing
Post by: Lorric on December 18, 2012, 10:35:08 pm
Why. That's dumb. I have death events in a bunch of missions in BP2 and unless they all broke under 3.6.14, they work fine.

Post the exact events you were using so we can tell you the incredibly simple way to make this work.

You can see it at the top.

Droid's event was tested as well, as was Karojorma's.

By the way, I'm still going with 3.6.12. So if this was in the second BP campaign, maybe it won't work. I can try though if it's simple.
Title: Re: Death to Debriefing
Post by: Axem on December 18, 2012, 10:47:50 pm
Interesting...

Doing a little playing around with this, Lorric's sexp does indeed not work.

However the mission end on death sexps work fine in Vassago.

The only difference is that the Vassago sexps have the mission end chained to the "is-destroyed-delay 0 Player". Interestingly the chain delay has to be more than 0. It won't execute on the same frame.

So yeah, play with chaining mission end to your is destroyed delay sexp. You'll need a 1 second delay, so fade to black if you want it to seem more abrupt or something.
Title: Re: Death to Debriefing
Post by: Lorric on December 18, 2012, 10:59:38 pm
Interesting...

Doing a little playing around with this, Lorric's sexp does indeed not work.

However the mission end on death sexps work fine in Vassago.

The only difference is that the Vassago sexps have the mission end chained to the "is-destroyed-delay 0 Player". Interestingly the chain delay has to be more than 0. It won't execute on the same frame.

So yeah, play with chaining mission end to your is destroyed delay sexp. You'll need a 1 second delay, so fade to black if you want it to seem more abrupt or something.

I already tried Karojorma's with the delay. It didn't work. It took much, much longer than 3.

EDIT: Oh wait, you want me to try a chain, sorry. I'll try.
Title: Re: Death to Debriefing
Post by: Lorric on December 18, 2012, 11:08:42 pm
It works!!!

You know, I actually tried with a chain as well, but since I did 0, it failed.

0 works fine when it's not the player. I've got it on some ships that need protecting. No need for a chain either.

Now to rewrite things.

Thanks. I'd given up on this, but you didn't.

 :D :pimp: :cool:
Title: Re: Death to Debriefing
Post by: Droid803 on December 18, 2012, 11:39:19 pm
funny engine quirk there
Title: Re: Death to Debriefing
Post by: Lorric on December 18, 2012, 11:52:01 pm
Speaking of quirks, here's another one for you.

Under the old method I had, where it would trigger, but far too late, when you replayed the mission, it would start as if you already lost, so you'd need to do a quick restart to get it working again.
Title: Re: Death to Debriefing
Post by: General Battuta on December 19, 2012, 12:39:23 am
Yeah that'll happen pretty consistently.
Title: Re: Death to Debriefing
Post by: X3N0-Life-Form on December 19, 2012, 06:40:52 am
Yeah, it's something about the death screen not reseting or something. I've still got a screenshot of JAD 2.2's ending cutscene with the death menu (I got beamed in the friendship mission, waited 'till the mission ended, then launched the last mission).