Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Kestrellius on September 06, 2017, 01:05:34 pm

Title: Message-sent-delay?
Post by: Kestrellius on September 06, 2017, 01:05:34 pm
Is there a SEXP that detects when a certain message from the messages list has been sent? There doesn't appear to be.

If not, might I suggest that somebody who knows more about coding than I do create it? Something like:

message-sent-delay
   1: name of message
   2: delay in seconds
   3: (optional) number of times message must have been sent

This would be really really handy for conversation timing.
Title: Re: Message-sent-delay?
Post by: Axem on September 06, 2017, 05:35:17 pm
No, right now there isn't a sexp that would trigger on a message being sent. Instead you would need to check to see if the event that would send the message is true or not.

For conversation timing, there's a few way you can do it now. Send-message-list (but you can't stop the list once it starts), or chained events/is-event-true-delay (a bit more work, but you can only have whole seconds in the delay, so 1 or 2, not 1.5 or 6.753).

I'll let a proper coder answer the feasibility of the sexp you're asking for though, but the above methods are ways of doing basically the same thing now.
Title: Re: Message-sent-delay?
Post by: Kestrellius on September 06, 2017, 06:25:24 pm
It would be specifically for send-message-list, and even more specifically for particularly long conversations. As it is, I've just been eyeballing it, using is-event-true-delay and then modifying the delay if it's off...

EDIT: Oh, I don't think I was clear enough: what I mean by "conversation timing" is that there are cases where I use send-message-list, and I want an event to trigger once the list has been completed. Or once a certain line in the conversation has been said, etc.
Title: Re: Message-sent-delay?
Post by: karajorma on September 06, 2017, 06:41:35 pm
There are some occasions when you can't actually check the if the event has occurred. Built-in messages are somewhat random and if the message has a variable in it (or a container once those are in trunk) the message that would be sent now might be different from what was sent back then, making it difficult to check for.

All messages sent are written to the log (press F4 to see) so it should be possible to check if a message has been sent with a SEXP but unless someone is actually hitting the conditions above, I don't see why you'd need to do it that way rather than simply figuring out if it must have triggered. If you want a certain event to occur mid-way through a conversation, it's usually more sensible to split the conversation over two events.
Title: Re: Message-sent-delay?
Post by: Kestrellius on September 06, 2017, 08:12:22 pm
Okay, but if you're splitting it over two events, how do you make sure the second event triggers once the first event's list is finished? Other than the clumsy delay method?
Title: Re: Message-sent-delay?
Post by: karajorma on September 07, 2017, 03:23:15 am
I don't find the delay to be that clumsy. Remember that even if you used the SEXP you suggested, you'd still need a delay because the event using it would trigger in the same frame the message started, not the frame after it ended.
Title: Re: Message-sent-delay?
Post by: General Battuta on September 07, 2017, 01:13:33 pm
Don't use send-message-list, it is bad :(
Title: Re: Message-sent-delay?
Post by: Spoon on September 07, 2017, 02:14:12 pm
Don't use send-message-list, it is bad :(
Don't post things like these without elaborating on why it is bad.
Battuta please.
Title: Re: Message-sent-delay?
Post by: General Battuta on September 07, 2017, 04:11:42 pm
Inflexible timing and uninterruptible chains make it hard to adjust your messages and impossible to kill/delay them to account for other stuff happening in the mission.
Title: Re: Message-sent-delay?
Post by: Spoon on September 07, 2017, 04:16:41 pm
Now you've imparted wisdom  :yes:

Don't let me catch you doing this again! (https://i.somethingawful.com/forumsystem/emoticons/emot-bahgawd.gif)
Title: Re: Message-sent-delay?
Post by: Kestrellius on September 07, 2017, 05:18:19 pm
Okay, I feel like I'm still not being understood here.

So, let's say I have a mission. Two characters have a conversation, and when they're done talking, a ship jumps in. I use send-message-list for the conversation, because it's forty messages long and using individual events would take like ten years.

How do I know when to tell the ship to jump in? There's no way to tell when the message list is complete. So, I can set the ship to jump in a certain number of seconds after the S-M-L event triggers, but I have no way of knowing how long the conversation will take. There's a lot of room for variation with a conversation that long. Yeah, I can just play the mission and count, and that's what I've been doing -- it's not really difficult. But it would save time to have a better method.

@Battuta: So...is there a way to make the process of using a separate event for every message not mind-bogglingly tedious? Even with S-M-L it takes a while. With individual events, you'd have to -- wait. You'd use is-event-true-delay, but you'd still have to guess how long it took for the previous message to play! So not only would it take forever to format all of those events, you'd have to test to make sure you had the delays right.
Title: Re: Message-sent-delay?
Post by: Mito [PL] on September 07, 2017, 05:30:39 pm
If you're using send-message-list, then you still have to have a rough estimate of how long your messages will play, so you can calculate and place delays of a proper length. There's no way to modify anything in the conversation when it already starts, so you could just add up every single delay in the send-message-list, add some more delay to it for the last message, and just have the ship warp in that amount of time after the event playing these messages fires.

I also have no clue why would one want to use send-message multiple times instead of send-message-list, especially in that case, when nothing is supposed to be happening during the conversation except the conversation.
Title: Re: Message-sent-delay?
Post by: Axem on September 07, 2017, 05:32:54 pm
Unfortunately you are running into basically what has plagued endless other FREDders who have attempted to make "story-rich" missions with a lot of conversations. FreeSpace was never really meant to have conversations be very long. Just battle reports and some general intrigue, so the way messages work was very simple and low-key. Games these days have full blown conversation editors with branching paths and call backs to let the rest of the game know when conversations are happening and how to interrupt them correctly. FreeSpace is really stone age material in that regard.

So here's what you can do (at the moment):
1) use send-message-list and keeping a running tally of when each new message will filter through. That's a little tedious, but you have no control of how the messages are sent once the list gets going (as Battuta said). I think send-message-list is perfectly fine for 2-3 message long conversations where you know everyone is alive and well.

2) a whole lot of chained events (or is-event-trues) with send-messages. Yes this is even more tedious, but you can alleviate this a bit by copying and pasting a base send-message sexp and filling in what you need to. You'll have a greater deal of control, but yes, it is pretty tedious as well.

Now to answer your question "how long does this conversation take?". Well... that is really hard to answer. You'll need to find your own rule of thumb. Delays between short messages need about 5-6 seconds long for a player to be able to read them well. Average ones about 6-8. Long messages will need... however much.
Title: Re: Message-sent-delay?
Post by: Novachen on September 07, 2017, 06:02:16 pm
Mh.. where is the problem the read all the messages aloud to know, how long every one of them will take?
Actually i would always create dialogue sequences with a voice acting in mind for the delays. Also you have characters in mind and so you know how (fast) they would speak.
Because so it does not need any big changes if there will be a real voice acting some day.


Actually i think 40 indiviudal events much less tedious instead of a giant message list  :)... because individual events give much more control about everything. And imo it does not take longer to create.. because you have to add every source, priority, message and delay in a message-list nonetheless.

Title: Re: Message-sent-delay?
Post by: Spoon on September 07, 2017, 06:10:19 pm
The easiest way to make a message-list is to open the mission file in notepad, and copypaste as many entries as you need, then continue editing the list in fred's event window after. Saves the tedium of manually having to add each line one by one.

Words
Agreed
Title: Re: Message-sent-delay?
Post by: Kestrellius on September 07, 2017, 08:01:46 pm
Oh...I think there's something I've been missing. I always use text-to-speech if there's no voice-acting available -- which obviously there isn't for my WIP -- and I'd just been having a delay of 0 between messages, and they lasted however long it took the TTS to read them. I assumed the delay took place after that span of time, not including it.

Also, when I've tried using the delay, I haven't been able to get it to do anything -- it seems to behave exactly the same...
Title: Re: Message-sent-delay?
Post by: General Battuta on September 07, 2017, 11:44:48 pm
It's in milliseconds, one second delay is 1000
Title: Re: Message-sent-delay?
Post by: General Battuta on September 07, 2017, 11:48:55 pm
Okay, I feel like I'm still not being understood here.

So, let's say I have a mission. Two characters have a conversation, and when they're done talking, a ship jumps in. I use send-message-list for the conversation, because it's forty messages long and using individual events would take like ten years.

How do I know when to tell the ship to jump in? There's no way to tell when the message list is complete. So, I can set the ship to jump in a certain number of seconds after the S-M-L event triggers, but I have no way of knowing how long the conversation will take. There's a lot of room for variation with a conversation that long. Yeah, I can just play the mission and count, and that's what I've been doing -- it's not really difficult. But it would save time to have a better method.

@Battuta: So...is there a way to make the process of using a separate event for every message not mind-bogglingly tedious? Even with S-M-L it takes a while. With individual events, you'd have to -- wait. You'd use is-event-true-delay, but you'd still have to guess how long it took for the previous message to play! So not only would it take forever to format all of those events, you'd have to test to make sure you had the delays right.

One event for each message, chained to control the delays, your ship jumps in when the last event is true. Boom, super easy, you don't have to time anything to get your ship to arrive at the right time. And you can easily adjust the conversation length. Or add a dialogue skip on replays!

Send message list is an agent of Belial, cast it from your house
Title: Re: Message-sent-delay?
Post by: Kestrellius on September 08, 2017, 12:30:47 am
It's in milliseconds, one second delay is 1000

ohhhhhhhhhhhhhh

this explains everything

Anyway. Yeah, I guess I should switch to the one-event-per-message technique. Copy-pasting might make it less horrible...
Title: Re: Message-sent-delay?
Post by: General Battuta on September 08, 2017, 01:07:48 am
Delay between chained events is in whole seconds, though #justfredthings
Title: Re: Message-sent-delay?
Post by: Spoon on September 08, 2017, 04:58:53 am
but you dont have to use chains, you could also use is-event-true-msecs-delay, if you need to really fine tune the delay between two events (though in the case of a string of messages, I dont really see why you would. but just throwing it out there!)
Title: Re: Message-sent-delay?
Post by: Trivial Psychic on September 08, 2017, 08:28:51 am
Sometimes I use send-message-list for single messages, but I make use of the fact that the delay for the first message is BEFORE the message plays.  For example, I have a directive linked to a ship departing safely, but perhaps I don't want the message concerning this departure to play exactly at the same time, but I also don't want to create another event chaining to the directive event, so I use send-message-list.  Give it a few seconds (or a few thousand milliseconds) and the delay takes place before the message plays.
Title: Re: Message-sent-delay?
Post by: AdmiralRalwood on September 08, 2017, 01:01:05 pm
Sometimes I use send-message-list for single messages, but I make use of the fact that the delay for the first message is BEFORE the message plays.  For example, I have a directive linked to a ship departing safely, but perhaps I don't want the message concerning this departure to play exactly at the same time, but I also don't want to create another event chaining to the directive event, so I use send-message-list.  Give it a few seconds (or a few thousand milliseconds) and the delay takes place before the message plays.
So why don't you just put the delay in the condition? Like if you want it to play 2 seconds after the ship leaves, just set the delay for has-departed-delay to 2.
Title: Re: Message-sent-delay?
Post by: karajorma on September 08, 2017, 01:58:25 pm
Sometimes the trigger condition doesn't include any of the delay SEXPs.