Register Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Richard

Registered:
Posts: 104
Reply with quote  #1 
Hi,

I wrote a script in which a shuttle plays an important role but I had a problem: when it is destroyed and I dock to a station, the new shuttle has a wierd random name ("comEME-0", "comAWA-0",...)

Am I missing anything?

I did place a set_player_carried_type at the start block before create the player ship.


Mike Substelny

Avatar / Picture

Administrator
Registered:
Posts: 1,759
Reply with quote  #2 
You can assign names to the replacement shuttles available at a station. Just give all shuttles the same name and you should be okay.
__________________
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
Richard

Registered:
Posts: 104
Reply with quote  #3 
Quote:
Originally Posted by Mike Substelny
You can assign names to the replacement shuttles available at a station.


Hi Mike,

What xml command should I use ?

Thanks
Mike Substelny

Avatar / Picture

Administrator
Registered:
Posts: 1,759
Reply with quote  #4 
I've posted more detail about this previously (I recommend searching the forums to learn more nuances) but hre are the general guidelines:

You can only load singleseat cradft into a player ship's shuttle bay BEFORE that player ship is instantiated. Below is the code from The Hexaplex Vortex that loads fighters on the carrier Hastings and a shuttle on the Missile Cruiser Georgia:

Quote:
<start>
    <set_player_carried_type player_slot="0" bay_slot="0" name="High Jinx" raceKeys="TSN player" hullKeys="singleseat TSN Fighter"/>
    <set_player_carried_type player_slot="0" bay_slot="1" name="Clipper" raceKeys="TSN player" hullKeys="singleseat TSN Fighter"/>
    <set_player_carried_type player_slot="0" bay_slot="2" name="Marshal" raceKeys="TSN player" hullKeys="singleseat TSN Fighter"/>
    <set_player_carried_type player_slot="0" bay_slot="3" name="Skeeter" raceKeys="TSN player" hullKeys="singleseat TSN Fighter"/>
    <set_player_carried_type player_slot="0" bay_slot="4" name="Badger" raceKeys="TSN player" hullKeys="singleseat TSN Bomber"/>
    <set_player_carried_type player_slot="0" bay_slot="5" name="Banshee" raceKeys="TSN player" hullKeys="singleseat TSN Bomber"/>
    <create type="player" player_slot="0" x="30000.0" y="0" z="31000.0" angle="180" name="Hastings" accent_color="30" raceKeys="TSN player" hullKeys="Carrier" warp="yes" jump="no"/>

   <set_player_carried_type player_slot="1" bay_slot="0" name="Stogey" raceKeys="TSN player" hullKeys="singleseat TSN Shuttle"/>
   <create type="player" player_slot="1" x="52500" y="0" z="92700" angle="0" name="Georgia" raceKeys="TSN player" hullKeys="Missile Cruiser" accent_color="44" warp="yes" jump="no"/>


You can load fighters/bombers/shuttle into a base at any time. Here is the code I used to give reload fighters to DS1 in that same mission script:

Quote:
<!-- Create Bases and Load them With Fighters-->

    <create type ="station" x="30000" y="0" z="30000"  raceKeys="USFP friendly" hullKeys="Civilian Base" name="DS1"/>
    <clear_player_station_carried name="DS1"/>
    <set_player_station_carried name="DS1" singleSeatName="Barnstormer" raceKeys="TSN player" hullKeys="singleseat bomber"/>
    <set_player_station_carried name="DS1" singleSeatName="Wheeler" raceKeys="TSN player" hullKeys="singleseat fighter"/>
    <set_player_station_carried name="DS1" singleSeatName="Bricklayer" raceKeys="TSN player" hullKeys="singleseat bomber"/>
    <set_player_station_carried name="DS1" singleSeatName="Arrowhead" raceKeys="TSN player" hullKeys="singleseat fighter"/>
    <set_player_station_carried name="DS1" singleSeatName="Bulldog" raceKeys="TSN player" hullKeys="singleseat bomber"/>
    <set_player_station_carried name="DS1" singleSeatName="Black Widow" raceKeys="TSN player" hullKeys="singleseat bomber"/>
    <set_player_station_carried name="DS1" singleSeatName="Braveheart" raceKeys="TSN player" hullKeys="singleseat bomber"/>



__________________
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
ryleyra

Registered:
Posts: 2,492
Reply with quote  #5 
The randomly generated names take the form of three letters from the station's class designation, then a random three letter string with the first and last character the same. So for instance your "comEME" is from a Command base, a Deep Space base would be "deeXYX", a Science base would be "sciABA" and so on. The "-0" is the slot number that fighter is put in.

IIRC, randomly generated names for the player ship are just the three letters, with the first and last the same. This is to make replacement fighter names unique. Unfortunately you do not "replace" your original fighter, you have to be given a new one with a different name.

Note this is true in non-scripted modes as well.

It has been suggested to assign a callsign to the PLAYER instead of the fighter, but at this time, that's not the way Thom has implemented it. And you would probably still want an identifier to distinguish your fighter or shuttle.

Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.