RespawnShip Definition

From Space Engineers Wiki
Jump to navigation Jump to search

Definition for a ship that can be used by players to (re)spawn with.

Planet-supporting respawnships don't show up individually in the respawn screen.
The planets themselves show up and when you click Respawn it picks a random respawnship that is usable on that planet.
While space respawnships all show up individually.

Creative Mode or Scenario Mode would not show any respawnships, same as disabling EnableRespawnShips world setting.

Wrapper & Entry Example

<?xml version="1.0"?>
<Definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <RespawnShips>
    <!-- One or more RespawnShip entries are placed here. -->
  </RespawnShips>
</Definitions>
A typical RespawnShips.sbc entry

This is the entry for the Moon respawn ship, the rover-version of the survival pod.

    <Ship>
      <Id>
        <TypeId>RespawnShipDefinition</TypeId>
        <SubtypeId>RespawnMoonRover</SubtypeId>
      </Id>
      <DisplayName>DisplayName_PlanetaryLander</DisplayName>
      <Icon>Textures\GUI\Icons\RespawnShips\RespawnRover.png</Icon>
      <CooldownSeconds>900</CooldownSeconds>
      <Prefab>RespawnRover</Prefab>
      <UseForSpace>false</UseForSpace>
      <UseForPlanetsWithAtmosphere>false</UseForPlanetsWithAtmosphere>
      <UseForPlanetsWithoutAtmosphere>true</UseForPlanetsWithoutAtmosphere>
      <PlanetDeployAltitude>15</PlanetDeployAltitude>
      <HelpTextLocalizationId>Description_RespawnRover</HelpTextLocalizationId>
    </Ship>
Removing vanilla respawn ships

An example of all the vanilla respawnships with the Enabled attribute set to false on each entry.

<?xml version="1.0"?>
<Definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <RespawnShips>
    <Ship Enabled="false">
      <Id>
        <TypeId>RespawnShipDefinition</TypeId>
        <SubtypeId>RespawnRover</SubtypeId>
      </Id>
      <DisplayName>DisplayName_PlanetaryLander</DisplayName>
      <Icon>Textures\GUI\Icons\RespawnShips\RespawnRover.png</Icon>
      <CooldownSeconds>900</CooldownSeconds>
      <Prefab>RespawnRover</Prefab>
      <UseForSpace>false</UseForSpace>
      <UseForPlanetsWithAtmosphere>true</UseForPlanetsWithAtmosphere>
      <UseForPlanetsWithoutAtmosphere>false</UseForPlanetsWithoutAtmosphere>
      <PlanetDeployAltitude>1500</PlanetDeployAltitude>
      <MinimalAirDensity>0.9</MinimalAirDensity>
      <InitialLinearVelocity x="0" y="-95" z="0"/>
      <InitialAngularVelocity x="0" y="0.4" z="0"/>
      <HelpTextLocalizationId>Description_RespawnRover</HelpTextLocalizationId>
    </Ship>
    <Ship Enabled="false">
      <Id>
        <TypeId>RespawnShipDefinition</TypeId>
        <SubtypeId>RespawnMoonRover</SubtypeId>
      </Id>
      <DisplayName>DisplayName_PlanetaryLander</DisplayName>
      <Icon>Textures\GUI\Icons\RespawnShips\RespawnRover.png</Icon>
      <CooldownSeconds>900</CooldownSeconds>
      <Prefab>RespawnRover</Prefab>
      <UseForSpace>false</UseForSpace>
      <UseForPlanetsWithAtmosphere>false</UseForPlanetsWithAtmosphere>
      <UseForPlanetsWithoutAtmosphere>true</UseForPlanetsWithoutAtmosphere>
      <PlanetDeployAltitude>15</PlanetDeployAltitude>
      <HelpTextLocalizationId>Description_RespawnRover</HelpTextLocalizationId>
    </Ship>
    <Ship Enabled="false">
      <Id>
        <TypeId>RespawnShipDefinition</TypeId>
        <SubtypeId>RespawnSpacePod</SubtypeId>
      </Id>
      <DisplayName>DisplayName_RespawnPodSpace</DisplayName>
      <Icon>Textures\GUI\Icons\RespawnShips\RespawnSpacePod.png</Icon>
      <CooldownSeconds>900</CooldownSeconds>
      <Prefab>RespawnSpacePod</Prefab>
      <UseForSpace>true</UseForSpace>
      <SpawnNearProceduralAsteroids>true</SpawnNearProceduralAsteroids>
      <HelpTextLocalizationId>Description_SpacePod</HelpTextLocalizationId>
    </Ship>
  </RespawnShips>
</Definitions>

How the cockpit is picked

Only applicable if the ship has multiple seats. It picks from a sorted list of functional (built above red line) seats on all grids, the way they sort them:

  1. Main cockpits
  2. Cockpits that can control ship
  3. Any other kind of seat (passenger, cryo, couch, etc)

Picks first seat from the first group it can find, for example if there's 0 main, 2 regular, 2 cryos, it goes with one of the regular ones, likely first declared in the prefab .sbc (it's up to the sorting algorithm really).

If it fails to find a cockpit, it probably spawns character near the ship.

Elements

The <Icon> (only the first) is shown when hovered in the respawn screen, except for planets that have more than one eligible respawnship.

Prefab

<Prefab>
Type: StringDefaultnull
Required. A prefab's <SubtypeId> (never file name) that will be spawned with the player inside one of its seats (see How the cockpit is picked).

Infinite streaming means it couldn't find the prefab.

Read the Prefab Definition for important info and blueprint conversion.

Prefab's blocks can use a specific color (360°, 100%, 100% in-game HSV or 1, 0.2, 0.55 inside the file) which gets replaced by a random color from Game definition's <EncounterColors>.

CooldownSeconds

<CooldownSeconds>
Type: Int32Default0
Integer amount of seconds for cooldown that will only work if the respawn ship cooldown world setting is enabled (default is disabled).

When a player choses a respawnship it will cause all their respawnship options to go into cooldown (tracked per player).

For planets, the respawnship with the shortest cooldown will determine the cooldown for all the respawnships eligible for that planet.
This is because once the planet becomes available to click, it will still pick from all the eligible respawnships regardless of their current cooldown state.

SpawnWithDefaultItems

<SpawnWithDefaultItems>
Type: BooleanDefaulttrue
If enabled, character spawns with welder/grinder/etc in their inventory.
Only works if spawn with tools world setting is enabled.

HelpTextLocalizationId

<HelpTextLocalizationId>
Type: StringDefaultnull
Can be plain-text or a localization key (from .resx files).

When selecting a space respawnship or a planet that it can show a popup on the left with this text and the first <Icon> as the image.

The popup will not be visible for planets that have more than one respawnship available for them.

The popup's gravity and oxygen level are automatically computed, but the difficulty label comes from either the planet's <Difficulty> or for space it's hardcoded to DifficultyHard.

InitialLinearVelocity

<InitialLinearVelocity>
Type: SerializableVector3DefaultX:0, Y:0, Z:0
Spawns with this velocity in meters per second.

Relative to grid orientation which is independent of any cockpit. Enable grid pivot in Info tab to see its orientation.

Usage:
<InitialLinearVelocity x="0.0" y="0.0" z="-50.0" />
Where X/Y/Z are right/up/back directions for positive values.

InitialAngularVelocity

<InitialAngularVelocity>
Type: SerializableVector3DefaultX:0, Y:0, Z:0
Spawns with this rotation speed in radians per second.

Relative to grid orientation which is independent of any cockpit. Enable grid pivot in Info tab to see its orientation.

Usage:
<InitialAngularVelocity x="0.0" y="0.8" z="0.0" />
Where X/Y/Z are right/up/back axis for positive values.

UseForSpace

<UseForSpace>
Type: BooleanDefaultfalse
Whether this can be used as a space spawn (shows up individual in the respawn menu).

UseForPlanetsWithAtmosphere

<UseForPlanetsWithAtmosphere>
Type: BooleanDefaultfalse
Makes this available to planets with an atmosphere that have at least <MinimalAirDensity> air density.
Note: Ignored if either <PlanetTypes> or <SpawnPosition> are defined.

UseForPlanetsWithoutAtmosphere

<UseForPlanetsWithoutAtmosphere>
Type: BooleanDefaultfalse
Makes this available for planets without an atmosphere (game doesn't differentiate moons, all huge voxel spheres are planet definitions).
Note: Ignored if either <PlanetTypes> or <SpawnPosition> are defined.

MinimalAirDensity

<MinimalAirDensity>
Type: SingleDefault0.7
The required air density at ground level.

Recommended to use less than 90% of the planet's Atmosphere Density value.

Note: Ignored if <UseForPlanetsWithAtmosphere> is false, or either <PlanetTypes> or <SpawnPosition> are defined.

PlanetDeployAltitude

<PlanetDeployAltitude>
Type: Nullable<Single>Default500
Meters to spawn above planet surface if this spawns on a planet in the first place (which includes <SpawnPosition>).

PlanetTypes

<PlanetTypes>
Type: String[]Defaultnull
If declared it only spawn on these planet <SubtypeId>s, otherwise if left not declared it will be allowed on any planet (other atmosphere rules apply).

Requires all these things in order to function:

Usage:
<PlanetTypes>
  <PlanetType>SomePlanetSubtype</PlanetType>
  <!-- ... -->
</PlanetTypes>
The <PlanetType>...</PlanetType> can be repeated for as many planets as you wish.

SpawnPosition

<SpawnPosition>
Type: Nullable<SerializableVector3D>Defaultnull
Defines a fixed position where this respawnship will be.
Usage:
<SpawnPosition x="0.0" y="0.0" z="0.0" />

Now how it all works. First, the "dispersion sphere" is an immaginary sphere with <SpawnPositionDispersionMax> meters radius, and then a smaller <SpawnPositionDispersionMin> meters radius immaginary sphere exclusion zone inside that, resulting in a spherical shell of valid positions.

Depending on a few other things this can behave differently (in order, if one fails for any reason it will move to the next):

  1. If the position is within a planet's boundingbox then a random point within the dispersion sphere at the position is chosen, closest surface to that position is then chosen as the target location and <PlanetDeployAltitude> offsets it upwards. It will test up to 100 points for a free location before giving up and using the exact coordinates given.
  2. If <SpawnNearProceduralAsteroids> is true it will spawn near an asteroid within the dispersion sphere.
  3. Lastly it tries up to 100 times to find a free location outside of any planet before giving up and using whatever the 100th random location was.
The OptimalSpawnDistance world setting will influence the free area required around the ship.

SpawnPositionDispersionMax

<SpawnPositionDispersionMax>
Type: SingleDefault10000
Only used if <SpawnPosition> is defined, see there for details.

SpawnPositionDispersionMin

<SpawnPositionDispersionMin>
Type: SingleDefault0
Only used if <SpawnPosition> is defined, see there for details.

SpawnNearProceduralAsteroids

<SpawnNearProceduralAsteroids>
Type: BooleanDefaulttrue
Only used if <SpawnPosition> is defined, see there for details.

(Top) | From DefinitionBase:

Common

Id

<Id>
Type: SerializableDefinitionIdDefault(invalid)
The type and subtype combined make up a unique identifier for this definition.

If two definitions use the same Type+Subtype (Subtypes are only unique per Type), then the last to load will override the first one(s). For more details see Things to know about SBC.

<TypeId>Type: stringDefault(invalid)
Must be an existing type with or without the "MyObjectBuilder_" prefix.

Some types require an xsi:type, refer to the vanilla files for the exact pairing.

TypeId vs xsi:type
<SubtypeId>Type: stringDefault(empty)
This can be invented and only needs to be unique per TypeId.

Vanilla game re-uses some subtypes over multiple types (e.g. Iron is used for Ore type and Ingot type).

An empty value is also a valid subtype (which vanilla also uses on at least 5 blocks).
Type (attribute[1])Type: stringDefault(invalid)
Same behavior as <TypeId>, do not define both.
Subtype (attribute[1])Type: stringDefault(empty)
Same behavior as <SubtypeId>, do not define both.
Example:
<Id>
  <TypeId>CubeBlock</TypeId>
  <SubtypeId>FancyTable</SubtypeId>
</Id>

Because it has attribute alternatives it can also be declared as:

<Id Type="CubeBlock" Subtype="FancyTable" />

DisplayName

<DisplayName>
Type: StringDefaultnull
If the object defined here is visible anywhere in the game GUI, this would be the name shown for it. In cases where it is used, it is very much required.

Can be plain-text.
If the text contains DisplayName_ then:

Description

<Description>
Type: StringDefaultnull
Optional. If the object defined here is shown with a description in the game GUI (Hotbar/G-menu, HUD, etc) then this is the place to write it.

Can be plain-text.
If the text contains Description_ then:

If the final text (plain, localized or variable-replaced) contains {0}, {1}, etc, then they will replaced by kb&m control binds defined in <DescriptionArgs>.

DescriptionArgs

<DescriptionArgs>
Type: StringDefaultnull
Optional. A comma-separated list of control IDs which are referenced in <Description> by {number} tags, which then get replaced by the keyboard or mouse bind that the viewer has for those controls.
Example:
<Description>Press {0} to fire, {1} to change color, {2} to interact.</description>
<DescriptionArgs>PRIMARY_TOOL_ACTION,CUBE_COLOR_CHANGE,USE</DescriptionArgs>

And each player will see their current binds for those actions.

The control IDs can be found in your %appdata%/SpaceEngineers/SpaceEngineers.cfg at the ControlsButtons section.

Icon

<Icon>
Type: String[]Defaultnull
Icon(s) for the definition which may or may not be used depending on the definition type.

Path to a .dds or .png file relative to current mod's folder. Falls back to game folder if not found in current mod. Referencing assets in other mods

Can be declared multiple times which will stack icons on top of eachother, however it will not work for all definitions.

Known definitions to work or not work with multiple icons
  • Working: Blocks, BlockVariantGroups and component items seen in G-menu, BlockInfo (HUD right side) and toolbars; Blueprints in terminal production tab; Blocks and PhysicalItems in gamepad HUD.
  • Partial: Blocks seen in terminal.
  • Not working: HandItems (uses PhysicalItem's icon instead); Blocks and BlockVariantGroups seen in build planner, radial menu and some economy GUIs; PhysicalItems in economy GUIs and stores; Prefabs in stores; BlueprintClass (tabs) in terminal production tab; BankingSystemDefinition (Game\BankingSystem.sbc); Emotes (both kinds of definitions) in gamepad HUD; Block skins; RespawnShips.
  • Special cases: Economy contracts, FactionIcons Definition.

DLC

<DLC>
Type: String[]Defaultnull
Optional. The DLC subtypeId that this definition will require.

For the IDs, refer to <SE>\Content\Data\Game\DLCs.sbc.
Can be declared multiple times to require multiple DLCs.

Most definition types won't check for this, the ones that do: blocks, emotes and possibly anything else that can be placed in the toolbar.

AvailableInSurvival

<AvailableInSurvival>
Type: BooleanDefaulttrue
Depends on the definition if it uses this, and if it does then this determines whether it can be accessible in survival game mode.

Currently known definitions that do use this:

Public

<Public>
Type: BooleanDefaulttrue
If the definition is visible or accessible in some cases.
For blocks, this only hides them and they can still be built using projectors and other means.

Enabled

Enabled (attribute[1])
Type: BooleanDefaulttrue
If set to false it will remove the definition after it's been loaded.
Example usage:
<Definition Enabled="false">

The "Definition" above is the opening element that for the entire definition, not an inner node like <DisplayName> is.

The opening node can have a different name for other definitions, some examples <Component>, <Blueprint>, etc.

xsi:type

xsi:type (attribute[1])
Type: stringDefaultnull

Name of an object that this definition will be deserialized as.
Sometimes required, depends on the definition. The wiki page for any given definition will mention at the top what xsi:type it requires, if any. The game's sbc files are also a reference on what xsi:types are required for a given definition.

This attribute is available on all elements and comes from the XML specification. This game relies on this attribute to change which sub-definition object is used to deserialize that element's contents. It's what allows, for example, a thruster to have unique elements (such as <MinPlanetaryInfluence>) that no other block definitions have.

For more details on how this relates to the TypeId, and usage examples, see: Things to know about SBC - TypeId vs xsi:type.