Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Solatar on April 11, 2013, 12:27:39 pm

Title: Question about debriefings and variables
Post by: Solatar on April 11, 2013, 12:27:39 pm
This seems like such a simple thing that I'm sure there's an easier way to accomplish this, but what the heck.  I've got a mission with three Poseidon freighters, Theta 1, 2, and 3 - they are not in a wing - carrying Cargo Alpha, Beta, and Gamma respectively.  In order to provide a useful directive for the player, I've got a CargoLeft variable that starts at 3 and decreases each time one of the containers is destroyed.  I can also know at any point how many containers are left, and send different messages accordingly.  For my debriefings, I thought I would be Super SmoothTM and just have three stages, one for each of the three number of possible containers left, coupled with a check that the RTB directive is true to make sure the player doesn't get the debriefing stage if he just randomly jumps out.

For some reason, this doesn't show a debriefing stage.  I'm not sure if my logic won't work (variables are gone by debriefing or something), or if I'm just using the sexps wrong (can I use an equal sign like that, or do I need to query it somehow). Any takers? :P

I just have three of these.
Code: [Select]
- and
   - =
        - CargoLeft(3)
        - 3 (and 2, and 1)
   - is-event-true-delay
        - RTB Pass/Maybe
        - 0
Title: Re: Question about debriefings and variables
Post by: Axem on April 11, 2013, 09:49:29 pm
That shoooould work. Normal variables are still in the system until the mission unloads (from quitting it or moving on to the next mission).

Could something weird be happening that CargoLeft goes to 0 or some odd value?
Title: Re: Question about debriefings and variables
Post by: karajorma on April 12, 2013, 12:30:50 am
Yeah, I can't see anything wrong with it either.

One suggestion is to put the same SEXPs into an event and then use the event.log tools in any newer version of FRED to see if they are triggering.
Title: Re: Question about debriefings and variables
Post by: Solatar on April 12, 2013, 11:54:27 am
Hmm, I changed the events to reference the event that the RTB directive was chained to instead of the directive itself, and it works as intended.  Maybe it was a problem with an event that returned true with Alpha 1's departure?
Title: Re: Question about debriefings and variables
Post by: Axem on April 12, 2013, 12:08:50 pm
That may be it. Since has-departed-delay looks at the mission log to see if something has left, there probably isn't a point where the game goes "hey, Alpha 1 departed" before it goes "hey, mission's over."