Author Topic: Renaming ships in mission, possible?  (Read 3330 times)

0 Members and 1 Guest are viewing this topic.

Offline Amon_Re

  • 28
    • http://www.kefren.be
Renaming ships in mission, possible?
Is it possible to rename a ship within a mission?
Sig? What sig?

  

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Re: Renaming ships in mission, possible?
Not its name. Its class through alt names, I think yes, but not its actual name. FS2 uses the name of the ship as its identifier at a basic sexp and code level, so changing it would screw up the way FS interprets it within the mission.

That said, what's the precise situation you want to change it in? In a very small number of cases, you can sort of change the name of the ship, using a hack. Basically, you time a new ship, with a new name, to arrive at the exact time the other ship disappears (both with the "No Warp Effect" checkbox checked for arrival and departue respectively). You can use a variable to define the hull strength, and any other variables you think are important (eg. turret strength, subsystem strength etc.), and then use set-subsystem-strength, variable-name to define them at their old strengths as soon as the ship comes back. As with any hack, however, there are some caveats.

 - You'll need to use get-position-x,y and z to determine the exact location of the ship and then apply them to the other ship the instant it warps in with set-object-position. Link this to the same set of circumstances that triggers the name change and you should be fine (i.e. no discernable flicker on the name change) (I think).

 - You'll need to know the exact orientation and speed of the ship at the time of is name change, especially orientation. Speed, I'mnnot sure what the effect would be - it probably wouldn't be seamless if they weren't the exact same speed, but it'd be close. Now, at present, there's no way to get and apply the orientation of one ship to another ship, and it can;t be neatly stored within a variable since FS uses a series of 9 variables to define orientation e.g.

Code: [Select]
$Orientation:
-0.862001, 0.000000, -0.506907,
0.000000, 1.000000, 0.000000,
0.506907, 0.000000, -0.862001

Look in a mission file and you'll see stuff like that for every ship. The best (and only) way I can see to get around the problems of speed and orientation of the two ships is to use waypoints - as long as a ship is following a waypoint, you can cap its speed (using, shockingly, cap-waypoint-speed) and you know its orientation (towards the waypoint, so just like using set-object-position you can use set-object-facing-object (the objects being the new ship and the waypoint respectively). You can set the initial speed of the new object to be the capped speed of the old object in the initial status editor.

 - If the ship is in the escort list, it'd be a good idea to define its position absolutely, by having all other ships either well above or below it, andf then giving the new ship the exact same escort priority. That way the new ship should replace the old one in the list in its exact same position

Do it right, and you should get a near seamless transition from one ship to the next. That's the only way I can think of that'll allow you to change the name in-mission.

NB - if your ship is unmoving, of course, the whole thing becomes easier by an order of magnitude. All you need to worry about then is hull/subsystem strength.
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline Shade

  • 211
Re: Renaming ships in mission, possible?
Could also use the 'facing' training sexp to make sure the player does not have the ship in view when the transition happens. That way it won't matter how smooth it is, as long as he is occupied elsewhere.
Report FS_Open bugs with Mantis  |  Find the latest FS_Open builds Here  |  Interested in FRED? Check out the Wiki's FRED Portal | Diaspora: Website / Forums
"Oooooooooooooooooooooooooooooooooooooooh ****ing great. 2200 references to entry->index and no idea which is the one that ****ed up" - Karajorma
"We are all agreed that your theory is crazy. The question that divides us is whether it is crazy enough to have a chance of being correct." - Niels Bohr
<Cobra|> You play this mission too intelligently.

 

Offline Amon_Re

  • 28
    • http://www.kefren.be
Re: Renaming ships in mission, possible?
Wooo boy....  Thx for the excellent explication Black Wolf, but that's overkill for what i want to achieve.

Basicly, the scenario is that a cap ship jumps in mid-battle, and the pilot doesn't know the ship's name, untill command reveals the name, the ship should be named SC Kain (example) untill the name proper is known, then it should be named SC SillyBugger (example) in the mission, so that the name changes during play.

I didn't think of alt. name, if that name gets displayed instead of the ship's real name used in SEXP's, that would make it alot easier....
Sig? What sig?

 

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Re: Renaming ships in mission, possible?
Alt name is only an alternative name for the class, unfortunately.

Luckily for you, the fact that you want to do it that early in the mission, means you can arrange it so that your ship is not moving, making it much, much easier (since there is probably no hull damamge to worry about, so no variables are needed, no motion, and no orientation to worry about). Just plop your new ship down in exactly the same spot as the old one in FRED (use set position/orientation for precisions sake) and give it a non-warp arrival cue identiocal to the non warp arrival cue for the second. If the first has initial orders of play dead, then you can guarantee it wont move.

[EDIT]Experimentation has proved that this wont work with the ships arrival/departure and no-warp checked. You're better off using the ship-vanish and (possibly as yet untested) ship-create sexps.

[EDIT2]Neither the initial speed in the ships initial status nor the set-object-speed sexp seems to get me an instantaneous seting of the speed of the old ship. This is frustrating.
« Last Edit: June 08, 2006, 04:30:15 pm by Black Wolf »
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Renaming ships in mission, possible?
Hmmmmm. Remind me to look into giving the ship-create a new optional speed setting when you're reminding me about that other thing I asked you to remind me about BW. :D

That should give you the ability to plonk a ship down with the location, orientation and speed of the mission designers choice :)


As for the name change it might be possible with scripting. If you can't change the actual name of the ship it may be possible to get the HUD to display a different name :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Re: Renaming ships in mission, possible?
It's a good thing you reminded me to remind you. I'd almost forgotten. :)

That should give you the ability to plonk a ship down with the location, orientation and speed of the mission designers choice :)

Well... so long as its following a waypoint.
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline Amon_Re

  • 28
    • http://www.kefren.be
Re: Renaming ships in mission, possible?
As for the name change it might be possible with scripting. If you can't change the actual name of the ship it may be possible to get the HUD to display a different name :)

That's what i was kinda hoping to do, seems however, to be impossible at the time....
I'd prod the coders, but i forgot my cattleprod at work  :nervous:

Oh well, atleast the new name gets attributed to the ship eventhough it's not displayed as such in the Excort list (this is the biggest annoyance really)
Sig? What sig?

 

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Re: Renaming ships in mission, possible?
As for the name change it might be possible with scripting. If you can't change the actual name of the ship it may be possible to get the HUD to display a different name :)

That's what i was kinda hoping to do, seems however, to be impossible at the time....
I'd prod the coders, but i forgot my cattleprod at work  :nervous:

Oh well, atleast the new name gets attributed to the ship eventhough it's not displayed as such in the Excort list (this is the biggest annoyance really)

Not impossible at all. Here's a simplified example of the sexping at work:

http://rapidshare.de/files/22576229/RenamingShip.fs2.html
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Renaming ships in mission, possible?
Luckily for you, the fact that you want to do it that early in the mission, means you can arrange it so that your ship is not moving, making it much, much easier (since there is probably no hull damamge to worry about, so no variables are needed, no motion, and no orientation to worry about). Just plop your new ship down in exactly the same spot as the old one in FRED (use set position/orientation for precisions sake) and give it a non-warp arrival cue identiocal to the non warp arrival cue for the second. If the first has initial orders of play dead, then you can guarantee it wont move.

[EDIT]Experimentation has proved that this wont work with the ships arrival/departure and no-warp checked. You're better off using the ship-vanish and (possibly as yet untested) ship-create sexps.

What do you mean?  This is exactly how the FSPort handled the shields-off sexp in Awakenings, using retail.

As for changing the alt-name, there's now a sexp to do that.

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Renaming ships in mission, possible?
Goob, would it actually be possible to have a "display name" that overrides the name of the ship as far as the player is concerned, without changing the actual name of the ship?  That would take care of the concern with the game having to deal with a ship changing names mid-mission.  It could make a useful change to say, "Mystery of the Trinity", and have the Trinity initially show up as "GTC Trinity" when Romeig first identifies his ship, then changed to "NTC Trinity" when Command points out the Trator status of him and his ship.
The Trivial Psychic Strikes Again!

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Renaming ships in mission, possible?
It would.  Be a bit of a hassle (but not particularly hard) though.

 

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Re: Renaming ships in mission, possible?
What do you mean?  This is exactly how the FSPort handled the shields-off sexp in Awakenings, using retail.

I tried it with a pair of fenris', and the first one, for reasons best known to its digital captain, pitched up 90 degrees and sped off like it was heading into subspace, then just disappeared, despite having no warp effect checked. it worked seamlessly with ship-vanish though.

It could be a perculiarity of the fenris, or related to some change the SCP's made somewhere along the way, but I don't suppose it matters much since it works seamlessly with ship-vanish anyway.
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Renaming ships in mission, possible?
Yes, you can.

With scripting, of course. ;)

Code: [Select]
mn.getShipByName("Original name").Name = "New name"
You can't call that directly from FRED, though, because of the string limit. (You can make your own function and call that from FRED though) It'll also mean that any SEXPs after the renaming will have to use the new name.

Altogether it's hardly an ideal solution, but will work if you really want it to happen.
-C