Hud Definition
Found in Data\Hud\Default.sbc. Customizes some of the HUD.
Cockpits/Cryos and characters can optionally request a different HUD subtypeId, otherwise they too use the Default subtypeId.
Elements
OptimalScreenRatio<OptimalScreenRatio> | Type: Nullable<Vector2I> | Default: null |
| Required or it gets errors. Aspect ratio that the HUD was designed for, anything else will affect scaling according to this formula:
That multiplier is applied to most cases where <CustomUIScale> is also used, and also only HUD elements with Usage example: <OptimalScreenRatio>
<X>16</X>
<Y>9</Y>
</OptimalScreenRatio>
| ||
CustomUIScale<CustomUIScale> | Type: Nullable<Single> | Default: null |
Optional. Affects scale of things in this HUD, but only ones with <ApplyHudScale> enabled.If null it uses the current resolution's height divided by 1080. | ||
(Top)
Crosshair<Crosshair> | Type: CrosshairStyle | Default: null |
| Same syntax as one <StatControl>. | ||
TargetingMarkers<TargetingMarkers> | Type: TargetingMarkersStyle | Default: null |
| Same syntax as one <StatControl>. | ||
(Top)
GravityIndicator<GravityIndicator> | Type: GravityIndicatorVisualStyle | Default: null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Elements that exist in the game code or vanilla SBC, but do nothing
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(Top)
Toolbar<Toolbar> | Type: ToolbarControlVisualStyle | Default: null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Elements that exist in the game code or vanilla SBC, but do nothing
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(Top)
DPad<DPad> | Type: DPadControlVisualStyle | Default: null | ||||||||||||||||||
| ||||||||||||||||||||
(Top)
StatControls<StatControls> | Type: MyObjectBuilder_StatControls[] | Default: null | ||||||||||||||||||||||||||||||
| List of HUD elements, can have as many as you want. Each
| ||||||||||||||||||||||||||||||||
(Top) | From DefinitionBase:
Common
Id<Id> | Type: SerializableDefinitionId | Default: (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.
<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: String | Default: null | ||||||||||||||||||||||||
| 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.
| ||||||||||||||||||||||||||
Description<Description> | Type: String | Default: null | ||||||||||||||||||||||||
| 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.
{0}, {1}, etc, then they will replaced by kb&m control binds defined in <DescriptionArgs>. | ||||||||||||||||||||||||||
DescriptionArgs<DescriptionArgs> | Type: String | Default: null | ||||||||||||||||||||||||
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. | ||||||||||||||||||||||||||
Icon<Icon> | Type: String[] | Default: null | ||||||||||||||||||||||||
| 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
| ||||||||||||||||||||||||||
DLC<DLC> | Type: String[] | Default: null | ||||||||||||||||||||||||
| Optional. The DLC subtypeId that this definition will require. For the IDs, refer to <SE>\Content\Data\Game\DLCs.sbc. | ||||||||||||||||||||||||||
AvailableInSurvival<AvailableInSurvival> | Type: Boolean | Default: true | ||||||||||||||||||||||||
| 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: Boolean | Default: true | ||||||||||||||||||||||||
| 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. | ||||||||||||||||||||||||||
EnabledEnabled (attribute[1]) | Type: Boolean | Default: true | ||||||||||||||||||||||||
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 <Component>, <Blueprint>, etc. | ||||||||||||||||||||||||||
xsi:typexsi:type (attribute[1]) | Type: string | Default: null | ||||||||||||||||||||||||
Name of an object that this definition will be deserialized as. 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 For more details on how this relates to the TypeId, and usage examples, see: Things to know about SBC - TypeId vs xsi:type. | ||||||||||||||||||||||||||
Obsolete Elements
Note: this list only contains root-level from this definition only, nothing from inherited ones.
| <VisorOverlayTexture> | Type: Nullable<MyStringHash> | Default: null |
| Does not function. | ||
Conditions
The condition starts from:
<ElementName xsi:type="ConditionTypeHere">
Where ConditionTypeHere has to be one of the below types, which also determines what elements you can add inside.
The ElementName depends on where you enter this.
Condition| <Operator> | Type: StatLogicOperator | Default: And |
Available values:
| ||
| <Terms> | Type: ConditionBase[] | Default: null |
List of <Term xsi:type="ConditionTypeHere"> where ConditionTypeHere is either Condition (this) or StatCondition shown below.The contents will be the elements of the chosen condition type. | ||
StatCondition| <Operator> | Type: StatConditionOperator | Default: Below |
| The operator to use when comparing <Value> against the StatId's internal code value in order for this entire condition to evaluate as true. Available values: | ||
| <Value> | Type: Single | Default: 0 |
| The value to check with the Operator against the StatId's internal code value. | ||
| <StatId> | Type: MyStringHash | Default: |
| ID of a HudStat logic. | ||
Full example:
<VisibleCondition xsi:type="Condition">
<Operator>And</Operator>
<Terms>
<Term xsi:type="StatCondition">
<StatId>controller_mode</StatId>
<Operator>Equal</Operator>
<Value>0</Value>
</Term>
<Term xsi:type="StatCondition">
<StatId>hud_mode</StatId>
<Operator>Above</Operator>
<Value>0</Value>
</Term>
</Terms>
</VisibleCondition>
Stat Styles
List of objects that can differ depending on the xsi:type given.
But first, shared things between all styles:
| <Category> | Type: Nullable<VisualStyleCategory> | Default: null |
Available values:
| ||
| <FadeInTimeMs> | Type: Nullable<UInt32> | Default: null |
| <FadeOutTimeMs> | Type: Nullable<UInt32> | Default: null |
| <MaxOnScreenTimeMs> | Type: Nullable<UInt32> | Default: null |
| <MaxTextWidth> | Type: Nullable<Single> | Default: null |
| <OffsetPx> | Type: Vector2 | Default: 0, 0 |
| <SizePx> | Type: Vector2 | Default: 0, 0 |
| <StatId> | Type: MyStringHash | Default: |
| ID of a HudStat logic. | ||
| <VisibleCondition> | Type: ConditionBase | Default: null |
| See the Conditions section. | ||
| <Blink> | Type: MyAlphaBlinkBehavior | Default: null |
Optional.
Example: <Blink>
<MinAlpha>0.2</MinAlpha>
<MaxAlpha>0.8</MaxAlpha>
<IntervalMs>400</IntervalMs>
<ColorMask>
<X>1</X>
<Y>0</Y>
<Z>0</Z>
<W>0.8</W>
</ColorMask>
<Blink>true</Blink>
</Blink>
| ||
| <BlinkCondition> | Type: ConditionBase | Default: null |
| Optional. Condition for activating <Blink>. See the Conditions section. | ||
| <StatCriticalValue> | Type: - | Default: - |
| Found in SBC file but does not exist in game code therefore it does nothing. | ||
Styles:
MyObjectBuilder_CircularProgressBarStatVisualStyle| <Animate> | Type: Nullable<Boolean> | Default: null |
| <AnimationDelayMs> | Type: Nullable<Double> | Default: null |
| <AnimationSegmentDelayMs> | Type: Nullable<Double> | Default: null |
| <AnimatedSegmentColorMask> | Type: Nullable<Vector4> | Default: null |
Usage: <AnimatedSegmentColorMask>
<X>0.5</X>
<Y>0.2</Y>
<Z>1.0</Z>
<W>0.25</W>
</AnimatedSegmentColorMask>
| ||
| <EmptySegmentColorMask> | Type: Nullable<Vector4> | Default: null |
Usage: <EmptySegmentColorMask>
<X>0.5</X>
<Y>0.2</Y>
<Z>1.0</Z>
<W>0.25</W>
</EmptySegmentColorMask>
| ||
| <FullSegmentColorMask> | Type: Nullable<Vector4> | Default: null |
Usage: <FullSegmentColorMask>
<X>0.5</X>
<Y>0.2</Y>
<Z>1.0</Z>
<W>0.25</W>
</FullSegmentColorMask>
| ||
| <NumberOfSegments> | Type: Nullable<Int32> | Default: null |
| <SpacingAngle> | Type: Nullable<Single> | Default: null |
| <AngleOffset> | Type: Nullable<Single> | Default: null |
| <ShowEmptySegments> | Type: Nullable<Boolean> | Default: null |
| <SegmentOrigin> | Type: Nullable<Vector2> | Default: null |
| <SegmentSizePx> | Type: Vector2 | Default: 0, 0 |
| <BackgroudTexture> | Type: Nullable<MyStringHash> | Default: null |
<SubtypeName> of a GUI texture (GuiTextures.sbc). | ||
| <SegmentTexture> | Type: MyStringHash | Default: |
<SubtypeName> of a GUI texture (GuiTextures.sbc). | ||
| <FirstSegmentTexture> | Type: Nullable<MyStringHash> | Default: null |
<SubtypeName> of a GUI texture (GuiTextures.sbc). | ||
| <LastSegmentTexture> | Type: Nullable<MyStringHash> | Default: null |
<SubtypeName> of a GUI texture (GuiTextures.sbc). | ||
MyObjectBuilder_TargetingProgressBarStatVisualStyle| <EnemyFocusSegmentColorMask> | Type: Nullable<Vector4> | Default: null |
Usage: <EnemyFocusSegmentColorMask>
<X>0.5</X>
<Y>0.2</Y>
<Z>1.0</Z>
<W>0.25</W>
</EnemyFocusSegmentColorMask>
| ||
| <EnemyLockingSegmentColorMask> | Type: Nullable<Vector4> | Default: null |
Usage: <EnemyLockingSegmentColorMask>
<X>0.5</X>
<Y>0.2</Y>
<Z>1.0</Z>
<W>0.25</W>
</EnemyLockingSegmentColorMask>
| ||
| <FriendlyFocusSegmentColorMask> | Type: Nullable<Vector4> | Default: null |
Usage: <FriendlyFocusSegmentColorMask>
<X>0.5</X>
<Y>0.2</Y>
<Z>1.0</Z>
<W>0.25</W>
</FriendlyFocusSegmentColorMask>
| ||
| <FriendlyLockingSegmentColorMask> | Type: Nullable<Vector4> | Default: null |
Usage: <FriendlyLockingSegmentColorMask>
<X>0.5</X>
<Y>0.2</Y>
<Z>1.0</Z>
<W>0.25</W>
</FriendlyLockingSegmentColorMask>
| ||
| <NeutralFocusSegmentColorMask> | Type: Nullable<Vector4> | Default: null |
Usage: <NeutralFocusSegmentColorMask>
<X>0.5</X>
<Y>0.2</Y>
<Z>1.0</Z>
<W>0.25</W>
</NeutralFocusSegmentColorMask>
| ||
| <NeutralLockingSegmentColorMask> | Type: Nullable<Vector4> | Default: null |
Usage: <NeutralLockingSegmentColorMask>
<X>0.5</X>
<Y>0.2</Y>
<Z>1.0</Z>
<W>0.25</W>
</NeutralLockingSegmentColorMask>
| ||
| <NumberOfSegments> | Type: Nullable<Int32> | Default: null |
| <ShowEmptySegments> | Type: Nullable<Boolean> | Default: null |
| <SegmentOrigin> | Type: Nullable<Vector2> | Default: null |
| <SegmentSizePx> | Type: Vector2 | Default: 0, 0 |
| <SpacingAngle> | Type: Nullable<Single> | Default: null |
| <AngleOffset> | Type: Nullable<Single> | Default: null |
| <BackgroudTexture> | Type: Nullable<MyStringHash> | Default: null |
<SubtypeName> of a GUI texture (GuiTextures.sbc). | ||
| <FilledTexture> | Type: Nullable<MyStringHash> | Default: null |
<SubtypeName> of a GUI texture (GuiTextures.sbc). | ||
| <SegmentTexture> | Type: MyStringHash | Default: |
<SubtypeName> of a GUI texture (GuiTextures.sbc). | ||
| <FirstSegmentTexture> | Type: Nullable<MyStringHash> | Default: null |
<SubtypeName> of a GUI texture (GuiTextures.sbc). | ||
| <LastSegmentTexture> | Type: Nullable<MyStringHash> | Default: null |
<SubtypeName> of a GUI texture (GuiTextures.sbc). | ||
MyObjectBuilder_ProgressBarStatVisualStyle| <Inverted> | Type: Nullable<Boolean> | Default: null | ||||||||||||||||||||||||||||||
| <NineTiledStyle> | Type: Nullable<NineTiledData> | Default: null | ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| <SimpleStyle> | Type: Nullable<SimpleBarData> | Default: null | ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
MyObjectBuilder_TextStatVisualStyle| <ColorMask> | Type: Nullable<Vector4> | Default: null |
Usage: <ColorMask>
<X>0.5</X>
<Y>0.2</Y>
<Z>1.0</Z>
<W>0.25</W>
</ColorMask>
| ||
| <Font> | Type: String | Default: null |
| Text's font. Expects a SubtypeId from a Font Definition. | ||
| <MaxWidth> | Type: Single | Default: 0 |
| <Scale> | Type: Single | Default: 0 |
| <Text> | Type: String | Default: null |
| The text to print. Supports text variables, and additionally {STAT} is replaced with the HudStat's current value. | ||
| <TextAlign> | Type: Nullable<MyGuiDrawAlignEnum> | Default: null |
| <Percentage> | Type: - | Default: - |
| Found in SBC file but does not exist in game code therefore it does nothing. | ||
| <Precision> | Type: - | Default: - |
| Found in SBC file but does not exist in game code therefore it does nothing. | ||
MyObjectBuilder_ImageStatVisualStyle| <ColorMask> | Type: Nullable<Vector4> | Default: null |
Usage: <ColorMask>
<X>0.5</X>
<Y>0.2</Y>
<Z>1.0</Z>
<W>0.25</W>
</ColorMask>
| ||
| <Texture> | Type: MyStringHash | Default: |
<SubtypeName> of a GUI texture (GuiTextures.sbc). | ||
HudStat logic
HudStats are programmed to do something and return it as a decimal number.
These can be referenced by an ID by various things above which either print it or check it as a condition.
IDs which sound like on/off will return 1 for on and 0 for off.
Mod scripts can create HudStats or even override existing IDs: Example_HudStatOverride.cs.
controlled_broadcastingcontrolled_can_targetcontrolled_dampenerscontrolled_estimated_time_remaining_energycontrolled_estimated_time_remaining_hydrogencontrolled_handbreak- parking brakecontrolled_hydrogen_capacitycontrolled_is_gridcontrolled_is_staticcontrolled_is_turretcontrolled_masscontrolled_power_usagecontrolled_reactorscontrolled_reloading- reloading progress ratio (0.0 to 1.0)controlled_reloading_count- how many weapons are reloadingcontrolled_remote_accesscontrolled_speedis_weapon_selected- when controlling a cockpit or RC, returns 1 if any target-locking-capable weapon is selected in the toolbar.controller_mode- returns 1 if any joystick/gamepad was last used, otherwise 0 for keyboard/mouse.environment_oxygen_levelenvironment_temperature_levelhud_mode- 0 is hidden, 1 is with hints and 2 is without hints.hud_show_keys- has no logic, always 1hud_show_states- has no logic, always 0artificial_gravitynatural_gravity- in g (1.0 means 9.81m/s/s)player_broadcastingplayer_energyplayer_flashlightplayer_healthplayer_helmetplayer_hydrogenplayer_hydrogen_bottlesplayer_inventory_capacityplayer_inventory_capacity_changedplayer_inventory_fullplayer_jetpackplayer_magbootsplayer_oxygenplayer_oxygen_bottlesplayer_refilling_hydrogenplayer_refilling_oxygenplayer_suffocatingtarget_in_focustarget_lockedtargeting_circle- target locking progress ratio (0.0 to 1.0).offscreen_target_circle- only while controlling a target-locking-capable block, returns target locking progress ratio (0.0 to 1.0); otherwise returns 0.toolbar_align_to_mountpointtoolbar_grid_sizetoolbar_symmetry
New in 207:
session_food_consumption_rate- returns the exact same value that the FoodConsumptionRate world setting is set to.player_radiation- ratio, (0.0 to 1.0).player_radiation_immunity- ratio, (0.0 to 1.0).player_is_using_cryo_chamber- 0 or 1player_food- ratio, (0.0 to 1.0).player_cant_sprint- turns 1 when player attempts to sprint while being unable to.