Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: FUBAR-BDHR on July 15, 2008, 10:49:54 pm

Title: Feature request: Send message from list
Post by: FUBAR-BDHR on July 15, 2008, 10:49:54 pm
Been thinking about this one for awhile now.  It's kind of an expansion on any-wingman but would actually allow you to specify a list of ships that would send the message.  In case the first ship isn't in the mission it would use the second one in the list and so on.  Also things like any-Alpha,  any-Beta, or any <wing> would be nice. 
Title: Re: Feature request: Send message from list
Post by: karajorma on July 16, 2008, 03:06:46 am
Well I can't just do it for send-message-list. It would have to be done for at least send-message too and possibly other message SEXPs. I doubt you're complaining about that though. :)

Looking at the code this is perfectly legal for any of the message SEXPs.

send-message
-Beta
-high
-Message Name

However both FRED and the mission parse code won't let you do that. The code is still there and uncommented (as evidenced by the fact that I thought it was live and actually altered it when I added the radio silence code) but there is no way to reach it.

The code does have this comment in it.

Code: [Select]
// message from a wing
// this will be an invalid case soon
// Int3();
// choose wing leader to speak for wing (hence "1" at end of ship_get_random_ship_in_wing)

It looks like :v: planned to add exactly what you describe but forgot about it halfway through or decided against it. Since they never made it work I've got carte blanche to make it work sensibly rather than the stupid way they have it working in their half-finished code at the moment (It would only ever pick the wing leader and if he wasn't available it would pick any wingman from any wing). :)

So I'll simply make it do this, you can add any wing, it will first attempt to pick a ship at random from that wing who hasn't been radio-silenced. If it can't find one it will then pick any wingman in that wing. If that fails it sends high priority messages from command or sends nothing at all.

I suspect that's exactly what most FREDders would expect it to do. :)
Title: Re: Feature request: Send message from list
Post by: FUBAR-BDHR on July 16, 2008, 02:03:33 pm
Not sure if that is what I was thinking or not.  It's part of it.  I was thinking something like this:

send-message
-->in-sequence
---->Beta 4
---->Gamma
---->GTV whatever
---->#voice in your head
-->high
-->message name
Title: Re: Feature request: Send message from list
Post by: karajorma on July 16, 2008, 03:49:55 pm
Ah, what you actually want is something like this

when-argument
-first-of
--Ship list
-not
--is-destroyed-delay
-- <argument>
-send-message
-- <argument>

I suspect that would be easier to implement and would be a lot more useful in general. I'll probably implement the suggestion I had above first anyway cause it's pretty simple. Given that first-of is a cross between random-of and any-of it shouldn't be too hard to make it work but I have some other things I want to finish off first.
Title: Re: Feature request: Send message from list
Post by: phreak on July 16, 2008, 04:50:07 pm
The problem is that you would need to create a voice file for each different persona, and then have the game figure out which voice file to play based upon the ship's persona
Title: Re: Feature request: Send message from list
Post by: karajorma on July 16, 2008, 05:08:45 pm
Agreed, but like using variables in messages it's one of those things that I tend to think that I'll worry about only if my mission actually is going to be voice acted. Since most aren't, why worry? :D
Title: Re: Feature request: Send message from list
Post by: FUBAR-BDHR on July 16, 2008, 05:22:36 pm
I'm more worried about using it in multi and having the message come from the player to the player if there aren't any AI ships left.  Wingman chatter in multi is always fun to try to code.