Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: dragonsniper on December 01, 2008, 04:07:48 pm

Title: Do something when a certain message has been sent
Post by: dragonsniper on December 01, 2008, 04:07:48 pm
It's a pretty lame title, I know, but is there a SEXP or a variable to use to tell FRED to do something after a certain message has been sent? (Hope this makes sense. :))
Title: Re: Do something when a certain message has been sent
Post by: FUBAR-BDHR on December 01, 2008, 04:32:21 pm
Several ways:

Chain an event to the one that sends the message.

Put the sexps in the same one that sends the message.

Event base on Is-event-true of the event that sent the message.

Straight time delay from mission start if you know exactly when the message will be sent every time.
Title: Re: Do something when a certain message has been sent
Post by: dragonsniper on December 01, 2008, 04:35:12 pm
Chain an event to the one that sends the message.
If I do that, then won't the event that I chained to the message trigger as soon as the first message is played, or after the last one is played?
Title: Re: Do something when a certain message has been sent
Post by: FUBAR-BDHR on December 01, 2008, 04:42:58 pm
Wait you said after a message was sent.  Are you using send-message-list?  That would be messages then.  If you are then since you know the time the message is sent after the event that sends it becomes true then you can chain an event to it with that time delay.   Also you can break it up into 2 message events chained together. 

An example of your current message event and when you want the next event to occur would help.
Title: Re: Do something when a certain message has been sent
Post by: dragonsniper on December 01, 2008, 04:48:32 pm
I don't think I have anything on hand...

An example of the SEXP that isn't there would be something like this: is-message-sent 
                                                                                                              is-message-sent-delay



Title: Re: Do something when a certain message has been sent
Post by: Rodo on December 01, 2008, 07:10:44 pm
create your sexp with the message, name it "something".

then use if event true delay
                              "something"
                                   xxx
- with xxx being the amount of time it takes to get to that message and that's it (count from the time the event something is triggered), this is Fubar's idea, and looks like a pretty solid way to do it, give it a try.
Title: Re: Do something when a certain message has been sent
Post by: dragonsniper on December 01, 2008, 07:26:08 pm
Thanks. :) I've used this once or twice before, but I wanted to know if there was another way around it.