Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Trivial Psychic on December 11, 2016, 10:20:31 pm

Title: Different Display Name & Different Departures
Post by: Trivial Psychic on December 11, 2016, 10:20:31 pm
So I'm working on the second mission in the FS1:U chapter 1 loop, and I'd like one ship to be miss identified as another, until it is scanned.  I'm not talking about a different class, but as a different ship name.  I thought that the ship-change-callsign might do it, but it just adds a second name next to the main.  Is there any way to do this?

Also, I have a wing of ships that I want to depart via destroyer fighterbays, except I want two to enter the fighterbay of one ship, and the 3rd into the bay of another ship.  I've tried using set-departure-into, but it seems that the wing's departure info overrides this.  I thought that perhaps there might be a disband-wing sexp, which I could use to kill this, but I couldn't find one.  I guess it doesn't exist.  Any ideas?
Title: Re: Different Display Name & Different Departures
Post by: xenocartographer on December 12, 2016, 12:53:14 pm
I don't believe either of these are possible.

For the name issue, you could try spawning a replacement ship, noting the position and rotation of the other (and speed and damage, if appropriate - there's a copy-damages SEXP that'll help with the last), then ship-vanishing it and copying the noted values to the replacement. Of course, that'll forcibly un-target the ship...

For the wing issue: does it actually have to be a wing? I mean, if the player never gets to give them orders, you could just manually name them as if they were in a wing and hope no one looks too closely at the F3 menu. Failing that, you could use warp-effect, ship-vanish, and a waypoint to pantomime the first two ships jumping out.



Otoh, hm, I've been looking for something useful to contribute to the SCP codebase...
Title: Re: Different Display Name & Different Departures
Post by: AdmiralRalwood on December 12, 2016, 01:14:58 pm
You can change a ship's name via Lua; there's no SEXP to do it (aside from script-eval and friends, of course).

As far as I'm aware, a wing's departure cue/type/anchor will always override those of the individual ships in that wing.
Title: Re: Different Display Name & Different Departures
Post by: Trivial Psychic on December 12, 2016, 04:57:54 pm
Thanks guys.  Scripting is a bit above my skill level, so I'll just have to change the plot a bit.  As for the wing departures, I can live with that I guess.
Title: Re: Different Display Name & Different Departures
Post by: AdmiralRalwood on December 12, 2016, 06:57:35 pm
Thanks guys.  Scripting is a bit above my skill level, so I'll just have to change the plot a bit.
This isn't very complicated scripting; just need something like:
Code: [Select]
( script-eval-block
   "Ships['"
   "old name goes here"
   "'].name = '"
   "new name goes here"
   "'"
)
(Somebody who actually knows Lua may want to double-check my work.)
Title: Re: Different Display Name & Different Departures
Post by: Axem on December 12, 2016, 08:06:42 pm
.Name should be capitalized. On simple testing it does work, but you'll need to have your name changey ship referred to in sexps with variables and not just your ship's name by itself, because the game isn't going to keep up to date with your changes on its own.
Title: Re: Different Display Name & Different Departures
Post by: Goober5000 on December 14, 2016, 12:47:02 am
If you set the "hide ship name" flag on a ship, then all it will display is the callsign.  You can then make the callsign correspond to whatever identification you want, and change it as you see fit.
Title: Re: Different Display Name & Different Departures
Post by: AdmiralRalwood on December 14, 2016, 01:04:33 am
If you set the "hide ship name" flag on a ship, then all it will display is the callsign.  You can then make the callsign correspond to whatever identification you want, and change it as you see fit.
Oh, yeah, that's a much better solution than using Lua to change the ship's name.
Title: Re: Different Display Name & Different Departures
Post by: Mito [PL] on December 14, 2016, 01:25:34 am
How about clearing the wing orders for them and giving each fighter an individual order? I think I saw something like that (a vessel from the player's wing following waypoints regardless of other orders) actually working somewhere.
Title: Re: Different Display Name & Different Departures
Post by: AdmiralRalwood on December 14, 2016, 02:11:15 am
How about clearing the wing orders for them and giving each fighter an individual order? I think I saw something like that (a vessel from the player's wing following waypoints regardless of other orders) actually working somewhere.
Works for orders because you can clear them; you can't not have departure information specified.
Title: Re: Different Display Name & Different Departures
Post by: Goober5000 on December 14, 2016, 10:31:10 pm
Do all the ships in the wing have to depart simultaneously?  Because you could set the departure for one ship and then change it for the other two.
Title: Re: Different Display Name & Different Departures
Post by: Trivial Psychic on December 15, 2016, 06:43:34 am
I've just decided to disband the wing and give them all separate waypoints and departure cues.