CubeBlock

From Space Engineers Wiki
Jump to navigation Jump to search

Description

SBC documentation: CubeBlock Definition
The most basic block type which has no function.

Also used for deformable armor however all block types can support that (although with some bugs). For more info see the Deformable Armor page.

Damage behaviors

All blocks take increased damage if they're not fully built, formula:
Damage = Damage * (2 - (BuildIntegrity / MaxIntegrity))
This results in blocks not taking any extra damage if they're welded to 100% (even if already damaged and its current integrity is lower), linearly increasing all the way to taking double damage when just placed at 0% welded.

Other damage multipliers can be found in CubeBlock Definition (section Combat).

Conveyor Network

This type does not offer inherent connection to conveyor system, however it can be given support by linking the ConveyorEndpointComponent entity component.

Inventory

Does not have one, however all block types can be given an inventory using EntityComponents.

Unlike other block types, if this block has an inventory it won't show up in the terminal's inventories list unless you directly interact with this block. This is by design.

Emissive Presets

This being the base block type it also defines how most blocks behave with the <EmissiveColorPreset>.

The states used:

  • "Working" - in working state which means built past red line + blocks that have on/off it also includes being turned on + some blocks also include being powered into this.
  • "Disabled" - opposite of the above but still built past the red line.
  • "Damaged" - broken or unfinished (below red line).

The materials used are Emissive and Display and their colors are controlled by the EmissiveColorName/DisplayColorName.

All these work on all subparts, including deeper ones.

Note: the materials require an emissive texture to be lit by this game code or modAPI. The brightnes of that color channel can be used to dim the effect.

Model setup

Changes to dummies/colliders/animations require re-launching the entire game to apply.
They're only loaded once per model file and cached. The ModDebugBuild plugin will clear that cache on every world exit.

Optional dummies usable by all blocks:

  • detector_terminal_* - interactive button that opens the terminal on the control panel tab. If placed on any door type it will instead open/close the door when interacted with.
  • detector_inventory_* - interactive button that opens the terminal on the inventory tab and alternate interaction opens control panel tab. This is even if it does not have an inventory, but can have an inventory using EntityComponents.
  • subpart_* - spawns a subpart entity which does nothing on its own, you can however use an EntityComponents or a mod script to animate it in some way.
  • detector_maintenance_* - only relevant if the block has the MaintenancePanel entity component: interactive and toggles the open state.
  • detector_ownership - (not recommended) alternative way of enabling ownership but mind that it's required in all build stages, and has a few bugs. The primary way to enable ownership is by having at least one Computer component in the block's <Components>.

The interactive ones can highlight a mesh or an entire subpart's model, see the interaction highlights tutorial for details.