Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: 0rph3u5 on August 27, 2010, 01:01:04 pm

Title: SEXP request: ship-change-callsign
Post by: 0rph3u5 on August 27, 2010, 01:01:04 pm
I need a new SEXP!
It's for "The Lost Generation" and there I have a mission in which I need a fighter to change its callsign for a very good reason (which I'm not telling)...

So first: Can it be done? (= is it possible at all? Like it was done with the alt-name?)

ps. I'm currently using change-alt-ship-name as a workaround... but that does not quite the same effect

EDIT: I don't need this too fast... there are still almost 20 missions ahead of me and it might take me another year to get the campaign finished at mininum
Title: Re: SEXP request: ship-change-callsign
Post by: FUBAR-BDHR on August 27, 2010, 02:50:37 pm
This one looks pretty easy.  Seeing if I can whip in up in a few minutes. 
Title: Re: SEXP request: ship-change-callsign
Post by: Mobius on August 27, 2010, 02:57:21 pm
Such SEXP would be very nice. Campaign could theoretically give callsigns to all pilots, and take those who die into account so that they can be replaced, as it happened in StarLancer.
Title: Re: SEXP request: ship-change-callsign
Post by: FUBAR-BDHR on August 27, 2010, 03:55:29 pm
Whipped this up real quick.  One known issue is if you set the callsign to <any string> you actually get <any string>.  Anyway might as well get some testing in:

SSE2 inferno builds (http://fubar5.fubar.org/fs2netd/change_callsign.rar)
Patch file (http://fubar5.fubar.org/fs2netd/change_callsign.patch)
Title: Re: SEXP request: ship-change-callsign
Post by: Mobius on August 27, 2010, 04:24:54 pm
The patch file goes to root FS2 folder, right?
Title: Re: SEXP request: ship-change-callsign
Post by: The E on August 27, 2010, 04:29:40 pm
If you are a coder, you will know where to put the .patch file. If you aren't, you should delete it.
Title: Re: SEXP request: ship-change-callsign
Post by: Mobius on August 27, 2010, 04:32:48 pm
Oh, right. It's for the code.

 :warp:
Title: Re: SEXP request: ship-change-callsign
Post by: 0rph3u5 on August 27, 2010, 05:56:32 pm
Whipped this up real quick.  One known issue is if you set the callsign to <any string> you actually get <any string>.  Anyway might as well get some testing in:

SSE2 inferno builds (http://fubar5.fubar.org/fs2netd/change_callsign.rar)
Patch file (http://fubar5.fubar.org/fs2netd/change_callsign.patch)

Thx FUBAR,
I'll test this tomorrow when I finish the mission in question
Title: Re: SEXP request: ship-change-callsign
Post by: Iss Mneur on August 27, 2010, 07:37:26 pm
Whipped this up real quick.  One known issue is if you set the callsign to <any string> you actually get <any string>.  Anyway might as well get some testing in:

SSE2 inferno builds (http://fubar5.fubar.org/fs2netd/change_callsign.rar)
Patch file (http://fubar5.fubar.org/fs2netd/change_callsign.patch)

What is <any string> supposed to do instead, as you don't appear to be doing anything for it?
Title: Re: SEXP request: ship-change-callsign
Post by: The E on August 27, 2010, 07:43:21 pm
Nothing, I suppose. It's just the default value. I suppose we could filter it out somehow, but I'd rather leave it as-is.
Title: Re: SEXP request: ship-change-callsign
Post by: FUBAR-BDHR on August 27, 2010, 07:56:34 pm
Yea it's just the default shown in FRED for a sexp that takes a generic string to let you know that it's a string field.

The one thing that I will probably do is add a way to remove the callsign either by leaving it as blank, <any string> or a third true/false field.
Title: Re: SEXP request: ship-change-callsign
Post by: FUBAR-BDHR on August 28, 2010, 02:58:49 pm
Well the ability to remove the callsign was already there by just entering an empty string.  Updated the patch but didn't bother with new exes since all I changed was the description.  So if you want to remove the callsign from a ship just delete <any string>.  Make sure it's not a " " but "" a space will show as ( ) in the callsign.  If anyone thinks that should be illegal let me know.
Title: Re: SEXP request: ship-change-callsign
Post by: Goober5000 on August 28, 2010, 10:40:55 pm
Added (with some tweaks) in 6397.