Difference between revisions of "Programming"

From Space Engineers Wiki
Jump to: navigation, search
(Created page with "== API List == This is a list of all API functions currently available<ref>http://steamcommunity.com/sharedfiles/filedetails/?id=360966557</ref>. === GridTerminalSystem ===...")
 
(Code Examples)
 
(10 intermediate revisions by 6 users not shown)
Line 28: Line 28:
 
| X
 
| X
 
|}
 
|}
 +
 +
'''Note''' since 2015 "Blocks" and "BlockGroups" properties are gone. Use "void GridTerminalSystem.GetBlocks(List<IMyTerminalBlock> blocks)" method instead. <ref>http://forum.keenswh.com/threads/gridterminalsystem-blocks-doesnt-work-anymore.7365691/</ref>
  
 
==== Methods ====
 
==== Methods ====
Line 163: Line 165:
 
| ITerminalAction  
 
| ITerminalAction  
 
| Returns action with specified name (Case Sensitive)
 
| Returns action with specified name (Case Sensitive)
 +
|-
 +
| ApplyAction(string actionName)
 +
| void
 +
| Applies an action of the given name to this block. (Case Sensitive)
 
|}
 
|}
  
Line 226: Line 232:
  
 
All terminal blocks have the following properties:
 
All terminal blocks have the following properties:
Interface name: this name is the name of the block in code, it can differ from the name as displayed in the building screen. E.g. Antenna interface name is IMyRadioAntenna - you need to use this interface if you want to get all antennas.
+
Interface name: this name is the name of the block in code, it can differ from the name as displayed in the building screen. E.g. [[Antenna]] interface name is IMyRadioAntenna - you need to use this interface if you want to get all antennas.
  
'''Parent:''' this is parent of the block (all blocks have IMyTerminalBlock as parent), this can be used for getting type of blocks instead of concrete block type. E.g. if you want to get all lights in grid you will use IMyLightingBlock, if you want only interior light you can use IMyInteriorLight.
+
'''Parent:''' this is parent of the block (all blocks have IMyTerminalBlock as parent), this can be used for getting type of blocks instead of concrete block type. E.g. if you want to get all lights in grid you will use IMyLightingBlock, if you want only [[Interior Light]] you can use IMyInteriorLight.
  
'''Field:''' this is read only field available for block e.g. for IMyBeacon you can get Radius property. Based on this property you can increase/decrease radius of beacon.
+
'''Field:''' this is read only field available for block e.g. for IMy[[Beacon]] you can get Radius property. Based on this property you can increase/decrease radius of beacon.
  
 
'''Actions:''' these are all available actions for block with their names in game, so if you want to increase broadcast radius for antenna, you need to execute DecreaseRadius action for block.
 
'''Actions:''' these are all available actions for block with their names in game, so if you want to increase broadcast radius for antenna, you need to execute DecreaseRadius action for block.
  
=== Antenna ===
+
=== [[Antenna]] ===
  
 
'''Interface name:''' IMyRadioAntenna<br />
 
'''Interface name:''' IMyRadioAntenna<br />
Line 247: Line 253:
 
DecreaseRadius -> Decrease Broadcast radius
 
DecreaseRadius -> Decrease Broadcast radius
  
=== Arc Furnace ===
+
=== [[Arc Furnace]] ===
  
 
'''Interface name:''' IMyRefinery<br />
 
'''Interface name:''' IMyRefinery<br />
Line 260: Line 266:
 
UseConveyor -> Use Conveyor System On/Off
 
UseConveyor -> Use Conveyor System On/Off
  
=== Artificial Mass ===
+
=== [[Artificial Mass]] ===
  
 
'''Interface name:''' IMyVirtualMass<br />
 
'''Interface name:''' IMyVirtualMass<br />
Line 271: Line 277:
 
OnOff_Off -> Toggle block Off
 
OnOff_Off -> Toggle block Off
  
=== Assembler ===
+
=== [[Assembler]] ===
  
 
'''Interface name:''' IMyAssembler<br />
 
'''Interface name:''' IMyAssembler<br />
Line 284: Line 290:
 
UseConveyor -> Use Conveyor System On/Off
 
UseConveyor -> Use Conveyor System On/Off
  
=== Battery ===
+
=== [[Battery]] ===
  
 
'''Interface name:''' IMyBatteryBlock<br />
 
'''Interface name:''' IMyBatteryBlock<br />
Line 296: Line 302:
 
Recharge -> Recharge On/Off
 
Recharge -> Recharge On/Off
  
=== Beacon ===
+
=== [[Beacon]] ===
  
 
'''Interface name:''' IMyBeacon<br />
 
'''Interface name:''' IMyBeacon<br />
Line 309: Line 315:
 
DecreaseRadius -> Decrease Broadcast radius
 
DecreaseRadius -> Decrease Broadcast radius
  
=== Button Panel ===
+
=== [[Button Panel]] ===
  
 
'''Interface name:''' IMyButtonPanel<br />
 
'''Interface name:''' IMyButtonPanel<br />
Line 317: Line 323:
 
AnyoneCanUse -> Anyone Can Use On/Off
 
AnyoneCanUse -> Anyone Can Use On/Off
  
=== Camera
+
=== [[Camera]] ===
 
'''Interface name:''' IMyCameraBlock<br />
 
'''Interface name:''' IMyCameraBlock<br />
 
'''Parent:''' IMyFunctionalBlock<br />
 
'''Parent:''' IMyFunctionalBlock<br />
Line 328: Line 334:
 
View -> View
 
View -> View
  
=== Cockpit ===
+
=== [[Cockpit]] ===
  
 
'''Interface name:''' IMyCockpit<br />
 
'''Interface name:''' IMyCockpit<br />
Line 344: Line 350:
 
DampenersOverride -> Inertia dampeners On/Off
 
DampenersOverride -> Inertia dampeners On/Off
  
=== Collector ===
+
=== [[Collector]] ===
  
 
'''Interface name:''' IMyCollector<br />
 
'''Interface name:''' IMyCollector<br />
Line 356: Line 362:
 
UseConveyor -> Use Conveyor System On/Off
 
UseConveyor -> Use Conveyor System On/Off
  
=== Connector ===
+
=== [[Connector]] ===
  
 
'''Interface name:''' IMyShipConnector<br />
 
'''Interface name:''' IMyShipConnector<br />
Line 373: Line 379:
 
SwitchLock -> Switch lock
 
SwitchLock -> Switch lock
  
=== Control Panel ===
+
=== [[Control Panel]] ===
  
 
'''Interface name:''' IMyControlPanel<br />
 
'''Interface name:''' IMyControlPanel<br />
Line 379: Line 385:
 
Actions: None
 
Actions: None
  
=== Control Station ===
+
=== [[Control Station]] ===
  
 
'''Interface name:''' IMyCockpit<br />
 
'''Interface name:''' IMyCockpit<br />
Line 395: Line 401:
 
DampenersOverride -> Inertia dampeners On/Off
 
DampenersOverride -> Inertia dampeners On/Off
  
=== Door ===
+
=== [[Door]] ===
  
 
'''Interface name:''' IMyDoor<br />
 
'''Interface name:''' IMyDoor<br />
Line 409: Line 415:
 
Open_Off -> Closed
 
Open_Off -> Closed
  
=== Drill ===
+
=== [[Drill]] ===
  
 
'''Interface name:''' IMyShipDrill<br />
 
'''Interface name:''' IMyShipDrill<br />
Line 421: Line 427:
 
UseConveyor -> Use Conveyor System On/Off
 
UseConveyor -> Use Conveyor System On/Off
  
=== Flight Seat ===
+
=== [[Flight Seat]] ===
  
 
'''Interface name:''' IMyCockpit<br />
 
'''Interface name:''' IMyCockpit<br />
Line 437: Line 443:
 
DampenersOverride -> Inertia dampeners On/Off
 
DampenersOverride -> Inertia dampeners On/Off
  
=== Gatling Turret ===
+
=== [[Gatling Turret]] ===
  
 
'''Interface name:''' IMyLargeGatlingTurret<br />
 
'''Interface name:''' IMyLargeGatlingTurret<br />
Line 457: Line 463:
 
UseConveyor -> Use Conveyor System On/Off
 
UseConveyor -> Use Conveyor System On/Off
  
=== Gravity Generator ===
+
=== [[Gravity Generator]] ===
  
 
'''Interface name:''' IMyGravityGenerator<br />
 
'''Interface name:''' IMyGravityGenerator<br />
Line 481: Line 487:
 
DecreaseGravity -> Decrease Acceleration
 
DecreaseGravity -> Decrease Acceleration
  
=== Grinder ===
+
=== [[Grinder (Ship)|Grinder]] ===
  
 
'''Interface name:''' IMyShipGrinder<br />
 
'''Interface name:''' IMyShipGrinder<br />
Line 494: Line 500:
 
UseConveyor -> Use Conveyor System On/Off
 
UseConveyor -> Use Conveyor System On/Off
  
=== Gyroscope ===
+
=== [[Gyroscope]] ===
  
 
'''Interface name:''' IMyGyro<br />
 
'''Interface name:''' IMyGyro<br />
Line 519: Line 525:
 
DecreaseRoll -> Decrease Roll override
 
DecreaseRoll -> Decrease Roll override
  
=== Interior Light ===
+
=== [[Interior Light]] ===
  
 
'''Interface name:''' IMyInteriorLight<br />
 
'''Interface name:''' IMyInteriorLight<br />
Line 544: Line 550:
 
DecreaseBlink Offset -> Decrease Blink Offset
 
DecreaseBlink Offset -> Decrease Blink Offset
  
=== Interior Turret ===
+
=== [[Interior Turret]] ===
  
 
'''Interface name:''' IMyLargeInteriorTurret<br />
 
'''Interface name:''' IMyLargeInteriorTurret<br />
Line 561: Line 567:
 
DecreaseRange -> Decrease Radius
 
DecreaseRange -> Decrease Radius
  
=== Landing Gear ===
+
=== [[Landing Gear]] ===
  
 
'''Interface name:''' IMyLandingGear<br />
 
'''Interface name:''' IMyLandingGear<br />
Line 579: Line 585:
 
DecreaseBreakForce -> Decrease Break Force
 
DecreaseBreakForce -> Decrease Break Force
  
=== Small Cargo Container ===
+
=== [[Small Cargo Container]] ===
  
 
'''Interface name:''' IMyCargoContainer<br />
 
'''Interface name:''' IMyCargoContainer<br />
Line 585: Line 591:
 
Actions: None
 
Actions: None
  
=== Medium Cargo Container ===
+
=== [[Medium Cargo Container]] ===
  
 
'''Interface name:''' IMyCargoContainer<br />
 
'''Interface name:''' IMyCargoContainer<br />
Line 591: Line 597:
 
Actions:None
 
Actions:None
  
=== Large Cargo Container ===
+
=== [[Large Cargo Container]] ===
  
 
'''Interface name:''' IMyCargoContainer<br />
 
'''Interface name:''' IMyCargoContainer<br />
Line 597: Line 603:
 
Actions: None
 
Actions: None
  
=== Small Reactor ===
+
=== [[Small Reactor]] ===
  
 
'''Interface name:''' IMyReactor<br />
 
'''Interface name:''' IMyReactor<br />
Line 610: Line 616:
 
UseConveyor -> Use Conveyor System On/Off
 
UseConveyor -> Use Conveyor System On/Off
  
=== Large Reactor ===
+
=== [[Large Reactor]] ===
  
 
'''Interface name:''' IMyReactor<br />
 
'''Interface name:''' IMyReactor<br />
Line 622: Line 628:
 
UseConveyor -> Use Conveyor System On/Off
 
UseConveyor -> Use Conveyor System On/Off
  
=== Small Thruster ===
+
=== [[Small Thruster]] ===
  
 
'''Interface name:''' IMyThrust<br />
 
'''Interface name:''' IMyThrust<br />
Line 635: Line 641:
 
DecreaseOverride -> Decrease Thrust override
 
DecreaseOverride -> Decrease Thrust override
  
=== Large Thruster ===
+
=== [[Large Thruster]] ===
  
 
'''Interface name:''' IMyThrust<br />
 
'''Interface name:''' IMyThrust<br />
Line 648: Line 654:
 
DecreaseOverride -> Decrease Thrust override
 
DecreaseOverride -> Decrease Thrust override
  
=== Medical Room ===
+
=== [[Medical Room]] ===
  
 
'''Interface name:''' IMyMedicalRoom<br />
 
'''Interface name:''' IMyMedicalRoom<br />
Line 659: Line 665:
 
OnOff_Off -> Toggle block Off
 
OnOff_Off -> Toggle block Off
  
=== Merge Block ===
+
=== [[Merge Block]] ===
  
 
'''Interface name:''' IMyShipMergeBlock<br />
 
'''Interface name:''' IMyShipMergeBlock<br />
Line 670: Line 676:
 
OnOff_Off -> Toggle block Off
 
OnOff_Off -> Toggle block Off
  
=== Missile Turret ===
+
=== [[Missile Turret]] ===
  
 
'''Interface name:''' IMyLargeMissileTurret<br />
 
'''Interface name:''' IMyLargeMissileTurret<br />
Line 690: Line 696:
 
UseConveyor -> Use Conveyor System On/Of
 
UseConveyor -> Use Conveyor System On/Of
 
<br />
 
<br />
Ore Detector<br />
+
 
Interace name: IMyOreDetector<br />
+
=== [[Ore Detector]] ===
 +
 
 +
'''Interface name''': IMyOreDetector<br />
 
'''Parent:''' IMyFunctionalBlock<br />
 
'''Parent:''' IMyFunctionalBlock<br />
 
'''Fields:'''<br />
 
'''Fields:'''<br />
Line 702: Line 710:
 
OnOff_Off -> Toggle block Off
 
OnOff_Off -> Toggle block Off
  
=== Passenger Seat ===
+
=== [[Passenger Seat]] ===
  
 
'''Interface name:''' IMyCockpit<br />
 
'''Interface name:''' IMyCockpit<br />
Line 718: Line 726:
 
DampenersOverride -> Inertia dampeners On/Off
 
DampenersOverride -> Inertia dampeners On/Off
  
=== Piston ===
+
=== [[Piston Base|Piston]] ===
  
 
'''Interface name:''' IMyPistonBase<br />
 
'''Interface name:''' IMyPistonBase<br />
Line 740: Line 748:
 
DecreaseLowerLimit -> Decrease Minimal distance
 
DecreaseLowerLimit -> Decrease Minimal distance
  
=== Programmable block ===
+
=== [[Programmable Block]] ===
  
 
'''Interface name:''' IMyProgrammableBlock<br />
 
'''Interface name:''' IMyProgrammableBlock<br />
Line 752: Line 760:
 
Run -> Run
 
Run -> Run
  
=== Refinery ===
+
=== [[Refinery]] ===
  
 
'''Interface name:''' IMyRefinery<br />
 
'''Interface name:''' IMyRefinery<br />
Line 765: Line 773:
 
UseConveyor -> Use Conveyor System On/Off
 
UseConveyor -> Use Conveyor System On/Off
  
=== Spotlight ===
+
=== [[Spotlight]] ===
  
 
'''Interface name:''' IMyReflectorLight<br />
 
'''Interface name:''' IMyReflectorLight<br />
Line 790: Line 798:
 
DecreaseBlink Offset -> Decrease Blink Offset
 
DecreaseBlink Offset -> Decrease Blink Offset
  
=== Remote Control ===
+
=== [[Remote Control]] ===
  
 
'''Interface name:''' IMyRemoteControl<br />
 
'''Interface name:''' IMyRemoteControl<br />
Line 807: Line 815:
 
Control -> Control
 
Control -> Control
  
=== Rocket Launcher ===
+
=== [[Rocket Launcher]] ===
  
 
'''Interface name:''' IMySmallMissileLauncher<br />
 
'''Interface name:''' IMySmallMissileLauncher<br />
Line 819: Line 827:
 
UseConveyor -> Use Conveyor System On/Off
 
UseConveyor -> Use Conveyor System On/Off
  
=== Reloadable Rocket Launcher ===
+
=== [[Reloadable Rocket Launcher]] ===
  
 
'''Interface name:''' IMySmallMissileLauncherReload<br />
 
'''Interface name:''' IMySmallMissileLauncherReload<br />
Line 831: Line 839:
 
UseConveyor -> Use Conveyor System On/Off
 
UseConveyor -> Use Conveyor System On/Off
  
=== Rotor ===
+
=== [[Rotor]] ===
  
 
'''Interface name:''' IMyMotorStator<br />
 
'''Interface name:''' IMyMotorStator<br />
Line 866: Line 874:
 
DecreaseDisplacement -> Decrease Rotor displacement
 
DecreaseDisplacement -> Decrease Rotor displacement
  
=== Sensor ===
+
=== [[Sensor]] ===
  
 
'''Interface name:''' IMySensorBlock<br />
 
'''Interface name:''' IMySensorBlock<br />
Line 907: Line 915:
 
Detect Asteroids -> Detect Asteroids On/Off
 
Detect Asteroids -> Detect Asteroids On/Off
  
=== Solar Panel ===
+
=== [[Solar Panel]] ===
  
 
'''Interface name:''' IMySolarPanel<br />
 
'''Interface name:''' IMySolarPanel<br />
Line 913: Line 921:
 
Actions:None
 
Actions:None
  
=== Sound Block ===
+
=== [[Sound Block]] ===
  
 
'''Interface name:''' IMySoundBlock<br />
 
'''Interface name:''' IMySoundBlock<br />
Line 936: Line 944:
 
DecreaseLoopableSlider -> Decrease Loop time
 
DecreaseLoopableSlider -> Decrease Loop time
  
=== Spherical Gravity Generator ===
+
=== [[Spherical Gravity Generator]] ===
  
 
'''Interface name:''' IMyGravityGeneratorSphere<br />
 
'''Interface name:''' IMyGravityGeneratorSphere<br />
Line 954: Line 962:
 
DecreaseGravity -> Decrease Acceleration
 
DecreaseGravity -> Decrease Acceleration
  
=== Timer Block ===
+
=== [[Timer Block]] ===
  
 
'''Interface name:''' IMyTimerBlock<br />
 
'''Interface name:''' IMyTimerBlock<br />
Line 972: Line 980:
 
Stop -> Stop
 
Stop -> Stop
  
=== Warhead ===
+
=== [[Warhead]] ===
  
 
'''Interface name:''' IMyWarhead<br />
 
'''Interface name:''' IMyWarhead<br />
Line 987: Line 995:
 
Detonate -> Detonate
 
Detonate -> Detonate
  
=== Welder ===
+
=== [[Welder (Ship)|Welder]] ===
  
 
'''Interface name:''' IMyShipWelder<br />
 
'''Interface name:''' IMyShipWelder<br />
Line 999: Line 1,007:
 
UseConveyor -> Use Conveyor System On/Off
 
UseConveyor -> Use Conveyor System On/Off
  
=== Wheel Suspension 1x1 ===
+
=== [[Wheel Suspension 1x1]] ===
  
 
'''Interface name:''' IMyMotorSuspension<br />
 
'''Interface name:''' IMyMotorSuspension<br />
Line 1,027: Line 1,035:
 
DecreasePower -> Decrease Power
 
DecreasePower -> Decrease Power
  
=== Wheel Suspension 3x3 ===
+
=== [[Wheel Suspension 3x3]] ===
  
 
'''Interface name:''' IMyMotorSuspension<br />
 
'''Interface name:''' IMyMotorSuspension<br />
Line 1,055: Line 1,063:
 
DecreasePower -> Decrease Power
 
DecreasePower -> Decrease Power
  
=== Wheel Suspension 5x5 ===
+
=== [[Wheel Suspension 5x5]] ===
  
 
'''Interface name:''' IMyMotorSuspension<br />
 
'''Interface name:''' IMyMotorSuspension<br />
Line 1,083: Line 1,091:
 
DecreasePower -> Decrease Power
 
DecreasePower -> Decrease Power
  
 +
== IMyInventoryItem Type and Subtypes List ==
 +
 +
This is a list of all API functions currently available. These can be accessed through an instance of IMyInventoryItem.Content and IMyInventoryItem.SubtypeName
 +
 +
 +
{| class="wikitable"
 +
! Type
 +
! Subtypes
 +
|-
 +
| Ore
 +
| Cobalt, Gold, Ice, Iron, Magnesium, Nickel, Platinum, Silicon, Silver, Stone, Uranium
 +
|-
 +
| Ingot
 +
| Cobalt, Gold, Iron, Magnesium, Nickel, Platinum, Scrap, Silicon, Silver, Stone, Uranium
 +
|-
 +
| Component
 +
| BulletproofGlass, Computer, Construction, Detector, Display, Girder, GravityGenerator, InteriorPlate, LargeTube, Medical, MetalGrid, Motor, PowerCell, RadioCommunication, Reactor, SmallTube, SolarCell, SteelPlate, Thrust
 +
|-
 +
| PhysicalGunObject
 +
| WelderItem, HandDrillItem, AngleGrinderItem, AutomaticRifleItem
 +
|-
 +
| AmmoMagazine
 +
| Missle200mm, NATO_25x184mm, NATO_5p56x45mm, Explosives
 +
|}
 +
 +
 +
== Code Examples ==
 +
 +
== See also ==
 +
* [[Programming Guide]]
 +
 +
* [[Programming Guide/API List|API List]]
 +
 +
* [[Programming Guide/Action List|Action List]]
 +
 +
* [[Scripting Whitelist]]
 +
 +
== References ==
 
<references />
 
<references />

Latest revision as of 01:06, 23 February 2018

API List

This is a list of all API functions currently available[1].

GridTerminalSystem

Currently only following “built-in” variable that user can use: GridTerminalSystem. This is entry point of entire grid terminal system.

Properties

Property Return Type Description get set
Blocks List<IMyTerminalBlock> Returns a list of all blocks on the grid V X
BlockGroups List<IMyBlockGroup> Returns a list of all groups in the grid. V X

Note since 2015 "Blocks" and "BlockGroups" properties are gone. Use "void GridTerminalSystem.GetBlocks(List<IMyTerminalBlock> blocks)" method instead. [2]

Methods

Method Return Type Description
GetBlocksOfType<T>(List<IMyTerminalBlock> blocks, Func<IMyTerminalBlock, bool> collect = null) void Puts all found blocks of provided type in the list that are connected to the grid
SearchBlocksOfName(string name,List<IMyTerminalBlock> blocks, Func<IMyTerminalBlock, bool> collect = null) void Puts all found blocks of provided name in the list that are connected to the grid
GetBlockWithName(string name) IMyTerminalBlock Returns a block with provided name

IMyCubeBlock

IMyCubeBlock is base class for every terminal block.

Properties

Property Return Type Description get set
IsBeingHacked boolean Returns true if block is being hacked V X
IsFunctional boolean Returns true if current block is operational V X
IsWorking boolean Returns true if current block is powered V X
Position VRageMath.Vector3I Returns current position V X

IMyTerminalBlock

MyTerminalBlock is base class for every terminal block.

Properties

Property Return Type Description get set
CustomName String Returns name of the block V X
CustomNameWithFaction String ... V X
DetailedInfo String ... V X
ShowOnHUD boolean Whether block shows up on hud V X

Methods

Method Return Type Description
HasLocalPlayerAccess() boolean ...
HasPlayerAccess(long playerId) boolean ...
RequestShowOnHUD(bool enable) void ...
SetCustomName(string text) void Set the name of the block
SetCustomName(StringBuilder text) void Set the name of the block
GetActions(List<ITerminalAction> resultList, Func<ITerminalAction, bool> collect = null) void Populates list with available actions
SearchActionsOfName(string name,List<ITerminalAction> resultList, Func<ITerminalAction, bool> collect = null) void Populates list with available actions matching the name (Case Insensitive)
GetActionWithName(string name) ITerminalAction Returns action with specified name (Case Sensitive)
ApplyAction(string actionName) void Applies an action of the given name to this block. (Case Sensitive)

ITerminalAction

ITerminal action is representation of concrete action that can be triggered.

Properties

Property Return Type Description get set
Id String Returns id of the action V X
Name StringBuilder Returns the name of the action V X

Methods

Method Return Type Description
Apply(IMyCubeBlock block) void Apply the action on a block

IMyFunctionalBlock

IMyFunctionalBlock is base class for every block that can be turned on or off, it’s derived from IMyTerminal block e.g. every Functional block is Terminal block but not all terminal blocks can be turned on or off.

Properties

Property Return Type Description get set
Enabled boolean Returns true if the block is turned on V X

Action List

All terminal blocks have the following properties: Interface name: this name is the name of the block in code, it can differ from the name as displayed in the building screen. E.g. Antenna interface name is IMyRadioAntenna - you need to use this interface if you want to get all antennas.

Parent: this is parent of the block (all blocks have IMyTerminalBlock as parent), this can be used for getting type of blocks instead of concrete block type. E.g. if you want to get all lights in grid you will use IMyLightingBlock, if you want only Interior Light you can use IMyInteriorLight.

Field: this is read only field available for block e.g. for IMyBeacon you can get Radius property. Based on this property you can increase/decrease radius of beacon.

Actions: these are all available actions for block with their names in game, so if you want to increase broadcast radius for antenna, you need to execute DecreaseRadius action for block.

Antenna

Interface name: IMyRadioAntenna
Parent: IMyFunctionalBlock
Fields: float Radius

Actions OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
IncreaseRadius -> Increase Broadcast radius
DecreaseRadius -> Decrease Broadcast radius

Arc Furnace

Interface name: IMyRefinery
Parent: IMyProductionBlock
Parent: IMyFunctionalBlock
Fields: bool UseConveyorSystem

Actions OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
UseConveyor -> Use Conveyor System On/Off

Artificial Mass

Interface name: IMyVirtualMass
Parent: IMyFunctionalBlock
Fields: None

Actions OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off

Assembler

Interface name: IMyAssembler
Parent: IMyProductionBlock
Parent: IMyFunctionalBlock
Fields: bool UseConveyorSystem

Actions OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
UseConveyor -> Use Conveyor System On/Off

Battery

Interface name: IMyBatteryBlock
Parent: IMyFunctionalBlock
Fields: bool HasCapacityRemaining

Actions OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
Recharge -> Recharge On/Off

Beacon

Interface name: IMyBeacon
Parent: IMyFunctionalBlock
Fields: float Radius

Actions OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
IncreaseRadius -> Increase Broadcast radius
DecreaseRadius -> Decrease Broadcast radius

Button Panel

Interface name: IMyButtonPanel
Fields: bool AnyoneCanUse

Actions AnyoneCanUse -> Anyone Can Use On/Off

Camera

Interface name: IMyCameraBlock
Parent: IMyFunctionalBlock
Fields: None

Actions OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
View -> View

Cockpit

Interface name: IMyCockpit
Parent: IMyShipController
Fields:
bool ControlWheels
bool ControlThrusters
bool HandBrake
bool DampenersOverride

Actions ControlThrusters -> Control thrusters On/Off
ControlWheels -> Control wheels On/Off
HandBrake -> Handbrake On/Off
DampenersOverride -> Inertia dampeners On/Off

Collector

Interface name: IMyCollector
Parent: IMyFunctionalBlock
Fields: bool UseConveyorSystem

Actions OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
UseConveyor -> Use Conveyor System On/Off

Connector

Interface name: IMyShipConnector
Parent: IMyFunctionalBlock
Fields:
bool ThrowOut
bool CollectAll
bool IsLocked

Actions OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
ThrowOut -> Throw Out On/Off
CollectAll -> Collect All On/Off
SwitchLock -> Switch lock

Control Panel

Interface name: IMyControlPanel
Fields: None
Actions: None

Control Station

Interface name: IMyCockpit
Parent: IMyShipController
Fields:
bool ControlWheels
bool ControlThrusters
bool HandBrake
bool DampenersOverride

Actions ControlThrusters -> Control thrusters On/Off
ControlWheels -> Control wheels On/Off
HandBrake -> Handbrake On/Off
DampenersOverride -> Inertia dampeners On/Off

Door

Interface name: IMyDoor
Parent: IMyFunctionalBlock
Fields: bool Open

Actions OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
Open -> Open/Closed
Open_On -> Open
Open_Off -> Closed

Drill

Interface name: IMyShipDrill
Parent: IMyFunctionalBlock
Fields: bool UseConveyorSystem

Actions OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
UseConveyor -> Use Conveyor System On/Off

Flight Seat

Interface name: IMyCockpit
Parent: IMyShipController
Fields:
bool ControlWheels
bool ControlThrusters
bool HandBrake
bool DampenersOverride

Actions ControlThrusters -> Control thrusters On/Off
ControlWheels -> Control wheels On/Off
HandBrake -> Handbrake On/Off
DampenersOverride -> Inertia dampeners On/Off

Gatling Turret

Interface name: IMyLargeGatlingTurret
Parent: IMyLargeConveyorTurretBase
Parent: IMyLargeTurretBase
Parent: IMyFunctionalBlock
Fields:
bool UseConveyorSystem
bool CanControl
float Range

Actions OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
Control -> Control
IncreaseRange -> Increase Radius
DecreaseRange -> Decrease Radius
UseConveyor -> Use Conveyor System On/Off

Gravity Generator

Interface name: IMyGravityGenerator
Parent: IMyGravityGeneratorBase
Parent: IMyFunctionalBlock
Fields:
float FieldWidth
float FieldHeight
float FieldDepth
float Gravity

Actions OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
IncreaseWidth -> Increase Field width
DecreaseWidth -> Decrease Field width
IncreaseHeight -> Increase Field height
DecreaseHeight -> Decrease Field height
IncreaseDepth -> Increase Field depth
DecreaseDepth -> Decrease Field depth
IncreaseGravity -> Increase Acceleration
DecreaseGravity -> Decrease Acceleration

Grinder

Interface name: IMyShipGrinder
Parent: IMyShipToolBase
Parent: IMyFunctionalBlock
Fields: None

Actions OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
UseConveyor -> Use Conveyor System On/Off

Gyroscope

Interface name: IMyGyro
Parent: IMyFunctionalBlock
Fields:
float GyroPower
bool GyroOverride
float Yaw
float Pitch
float Roll

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
IncreasePower -> Increase Power
DecreasePower -> Decrease Power
Override -> Override controls On/Off
IncreaseYaw -> Increase Yaw override
DecreaseYaw -> Decrease Yaw override
IncreasePitch -> Increase Pitch override
DecreasePitch -> Decrease Pitch override
IncreaseRoll -> Increase Roll override
DecreaseRoll -> Decrease Roll override

Interior Light

Interface name: IMyInteriorLight
Parent: IMyLightingBlock
Parent: IMyFunctionalBlock
Fields:
float Radius
float Intensity
float BlinkIntervalSeconds
float BlinkLenght
float BlinkOffset

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
IncreaseRadius -> Increase Radius
DecreaseRadius -> Decrease Radius
IncreaseBlink Interval -> Increase Blink Interval
DecreaseBlink Interval -> Decrease Blink Interval
IncreaseBlink Lenght -> Increase Blink Length
DecreaseBlink Lenght -> Decrease Blink Length
IncreaseBlink Offset -> Increase Blink Offset
DecreaseBlink Offset -> Decrease Blink Offset

Interior Turret

Interface name: IMyLargeInteriorTurret
Parent: IMyLargeTurretBase
Parent: IMyFunctionalBlock
Fields:
bool CanControl
float Range

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
Control -> Control
IncreaseRange -> Increase Radius
DecreaseRange -> Decrease Radius

Landing Gear

Interface name: IMyLandingGear
Parent: IMyFunctionalBlock
Fields:
float BreakForce

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
Lock -> Lock
Unlock -> Unlock
SwitchLock -> Switch lock
Autolock -> Autolock On/Off
IncreaseBreakForce -> Increase Break Force
DecreaseBreakForce -> Decrease Break Force

Small Cargo Container

Interface name: IMyCargoContainer
Fields: None
Actions: None

Medium Cargo Container

Interface name: IMyCargoContainer
Fields: None
Actions:None

Large Cargo Container

Interface name: IMyCargoContainer
Fields: None
Actions: None

Small Reactor

Interface name: IMyReactor
Parent: IMyFunctionalBlock
Fields:
bool UseConveyorSystem

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
UseConveyor -> Use Conveyor System On/Off

Large Reactor

Interface name: IMyReactor
Parent: IMyFunctionalBlock
Fields: bool UseConveyorSystem

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
UseConveyor -> Use Conveyor System On/Off

Small Thruster

Interface name: IMyThrust
Parent: IMyFunctionalBlock
Fields: float ThrustOverride

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
IncreaseOverride -> Increase Thrust override
DecreaseOverride -> Decrease Thrust override

Large Thruster

Interface name: IMyThrust
Parent: IMyFunctionalBlock
Fields: float ThrustOverride

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
IncreaseOverride -> Increase Thrust override
DecreaseOverride -> Decrease Thrust override

Medical Room

Interface name: IMyMedicalRoom
Parent: IMyFunctionalBlock
Fields: None

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off

Merge Block

Interface name: IMyShipMergeBlock
Parent: IMyFunctionalBlock
Fields: None

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off

Missile Turret

Interface name: IMyLargeMissileTurret
Parent: IMyLargeConveyorTurretBase
Parent: IMyLargeTurretBase
Parent: IMyFunctionalBlock
Fields:
bool UseConveyorSystem
bool CanControl
float Range

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
Control -> Control
IncreaseRange -> Increase Radius
DecreaseRange -> Decrease Radius
UseConveyor -> Use Conveyor System On/Of

Ore Detector

Interface name: IMyOreDetector
Parent: IMyFunctionalBlock
Fields:
float Range
bool BroadcastUsingAntennas

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off

Passenger Seat

Interface name: IMyCockpit
Parent: IMyShipController
Fields:
bool ControlWheels
bool ControlThrusters
bool HandBrake
bool DampenersOverride

Actions
ControlThrusters -> Control thrusters On/Off
ControlWheels -> Control wheels On/Off
HandBrake -> Handbrake On/Off
DampenersOverride -> Inertia dampeners On/Off

Piston

Interface name: IMyPistonBase
Parent: IMyFunctionalBlock
Fields:
float Velocity
float MinLimit
float MaxLimit

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
Reverse -> Reverse
IncreaseVelocity -> Increase Velocity
DecreaseVelocity -> Decrease Velocity
ResetVelocity -> Reset Velocity
IncreaseUpperLimit -> Increase Maximal distance
DecreaseUpperLimit -> Decrease Maximal distance
IncreaseLowerLimit -> Increase Minimal distance
DecreaseLowerLimit -> Decrease Minimal distance

Programmable Block

Interface name: IMyProgrammableBlock
Parent: IMyFunctionalBlock
Fields: bool IsRunning

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
Run -> Run

Refinery

Interface name: IMyRefinery
Parent: IMyFunctionalBlock
Parent: IMyProductionBlock
Fields: bool UseConveyorSystem

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
UseConveyor -> Use Conveyor System On/Off

Spotlight

Interface name: IMyReflectorLight
Parent: IMyLightingBlock
Parent: IMyFunctionalBlock
Fields:
float Radius
float Intensity
float BlinkIntervalSeconds
float BlinkLenght
float BlinkOffset

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
IncreaseRadius -> Increase Radius
DecreaseRadius -> Decrease Radius
IncreaseBlink Interval -> Increase Blink Interval
DecreaseBlink Interval -> Decrease Blink Interval
IncreaseBlink Lenght -> Increase Blink Length
DecreaseBlink Lenght -> Decrease Blink Length
IncreaseBlink Offset -> Increase Blink Offset
DecreaseBlink Offset -> Decrease Blink Offset

Remote Control

Interface name: IMyRemoteControl
Parent: IMyShipController
Fields:
bool ControlWheels
bool ControlThrusters
bool HandBrake
bool DampenersOverride

Actions
ControlThrusters -> Control thrusters On/Off
ControlWheels -> Control wheels On/Off
HandBrake -> Handbrake On/Off
DampenersOverride -> Inertia dampeners On/Off
Control -> Control

Rocket Launcher

Interface name: IMySmallMissileLauncher
Parent: IMyFunctionalBlock
Fields: bool UseConveyorSystem

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
UseConveyor -> Use Conveyor System On/Off

Reloadable Rocket Launcher

Interface name: IMySmallMissileLauncherReload
Parent: IMyFunctionalBlock
Fields: bool UseConveyorSystem

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
UseConveyor -> Use Conveyor System On/Off

Rotor

Interface name: IMyMotorStator
Parent: IMyMotorBase
Parent: IMyFunctionalBlock
Fields:
bool IsAttached
float Torque
float BrakingTorque
float Velocity
float LowerLimit
float UpperLimit
float Displacement

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
Reverse -> Reverse
Detach -> Detach
Attach -> Attach
IncreaseTorque -> Increase Torque
DecreaseTorque -> Decrease Torque
IncreaseBrakingTorque -> Increase Braking tor.
DecreaseBrakingTorque -> Decrease Braking tor.
IncreaseVelocity -> Increase Velocity
DecreaseVelocity -> Decrease Velocity
ResetVelocity -> Reset Velocity
IncreaseLowerLimit -> Increase Lower limit
DecreaseLowerLimit -> Decrease Lower limit
IncreaseUpperLimit -> Increase Upper limit
DecreaseUpperLimit -> Decrease Upper limit
IncreaseDisplacement -> Increase Rotor displacement
DecreaseDisplacement -> Decrease Rotor displacement

Sensor

Interface name: IMySensorBlock
Parent: IMyFunctionalBlock
Fields:
float LeftExtend
float RightExtend
float TopExtend
float BottomExtend
float FrontExtend
float BackExtend
bool DetectPlayers
bool DetectFloatingObjects
bool DetectSmallShips
bool DetectLargeShips
bool DetectStations
bool DetectAsteroids

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
IncreaseLeft -> Increase Left extent
DecreaseLeft -> Decrease Left extent
IncreaseRight -> Increase Right extent
DecreaseRight -> Decrease Right extent
IncreaseBottom -> Increase Bottom extent
DecreaseBottom -> Decrease Bottom extent
IncreaseTop -> Increase Top extent
DecreaseTop -> Decrease Top extent
IncreaseBack -> Increase Back extent
DecreaseBack -> Decrease Back extent
IncreaseFront -> Increase Front extent
DecreaseFront -> Decrease Front extent
Detect Players -> Detect players On/Off
Detect Floating Objects -> Detect floating objects On/Off
Detect Small Ships -> Detect small ships On/Off
Detect Large Ships -> Detect large ships On/Off
Detect Stations -> Detect stations On/Off
Detect Asteroids -> Detect Asteroids On/Off

Solar Panel

Interface name: IMySolarPanel
Fields:None
Actions:None

Sound Block

Interface name: IMySoundBlock
Parent: IMyFunctionalBlock
Fields:
float Volume
float Range
bool IsSoundSelected
float LoopPeriod

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
IncreaseVolumeSlider -> Increase Volume
DecreaseVolumeSlider -> Decrease Volume
IncreaseRangeSlider -> Increase Range
DecreaseRangeSlider -> Decrease Range
PlaySound -> Play
StopSound -> Stop
IncreaseLoopableSlider -> Increase Loop time
DecreaseLoopableSlider -> Decrease Loop time

Spherical Gravity Generator

Interface name: IMyGravityGeneratorSphere
Parent: IMyGravityGeneratorBase
Parent: IMyFunctionalBlock
Fields:
float Radius
float Gravity

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
IncreaseRadius -> Increase Radius
DecreaseRadius -> Decrease Radius
IncreaseGravity -> Increase Acceleration
DecreaseGravity -> Decrease Acceleration

Timer Block

Interface name: IMyTimerBlock
Parent: IMyFunctionalBlock
Fields:
bool IsCountingDown
float TriggerDelay

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
IncreaseTriggerDelay -> Increase Delay
DecreaseTriggerDelay -> Decrease Delay
TriggerNow -> Trigger now
Start -> Start
Stop -> Stop

Warhead

Interface name: IMyWarhead
Fields:
bool IsCountingDown
float DetonationTime

Actions
IncreaseDetonationTime -> Increase Detonation time
DecreaseDetonationTime -> Decrease Detonation time
StartCountdown -> Start countdown
StopCountdown -> Stop countdown
Safety -> Safety On/Off
Detonate -> Detonate

Welder

Interface name: IMyShipWelder
Parent: IMyShipToolBase
Parent: IMyFunctionalBlock

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
UseConveyor -> Use Conveyor System On/Off

Wheel Suspension 1x1

Interface name: IMyMotorSuspension
Parent: IMyMotorBase
Parent: IMyFunctionalBlock
Fields:
bool Steering
bool Propulsion
float Damping
float Strength
float Friction
float Power

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
Steering -> Steering On/Off
Propulsion -> Propulsion On/Off
IncreaseDamping -> Increase Damping
DecreaseDamping -> Decrease Damping
IncreaseStrength -> Increase Strength
DecreaseStrength -> Decrease Strength
IncreaseFriction -> Increase Friction
DecreaseFriction -> Decrease Friction
IncreasePower -> Increase Power
DecreasePower -> Decrease Power

Wheel Suspension 3x3

Interface name: IMyMotorSuspension
Parent: IMyMotorBase
Parent: IMyFunctionalBlock
Fields:
bool Steering
bool Propulsion
float Damping
float Strength
float Friction
float Power

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
Steering -> Steering On/Off
Propulsion -> Propulsion On/Off
IncreaseDamping -> Increase Damping
DecreaseDamping -> Decrease Damping
IncreaseStrength -> Increase Strength
DecreaseStrength -> Decrease Strength
IncreaseFriction -> Increase Friction
DecreaseFriction -> Decrease Friction
IncreasePower -> Increase Power
DecreasePower -> Decrease Power

Wheel Suspension 5x5

Interface name: IMyMotorSuspension
Parent: IMyMotorBase
Parent: IMyFunctionalBlock
Fields:
bool Steering
bool Propulsion
float Damping
float Strength
float Friction
float Power

Actions
OnOff -> Toggle block On/Off
OnOff_On -> Toggle block On
OnOff_Off -> Toggle block Off
Steering -> Steering On/Off
Propulsion -> Propulsion On/Off
IncreaseDamping -> Increase Damping
DecreaseDamping -> Decrease Damping
IncreaseStrength -> Increase Strength
DecreaseStrength -> Decrease Strength
IncreaseFriction -> Increase Friction
DecreaseFriction -> Decrease Friction
IncreasePower -> Increase Power
DecreasePower -> Decrease Power

IMyInventoryItem Type and Subtypes List

This is a list of all API functions currently available. These can be accessed through an instance of IMyInventoryItem.Content and IMyInventoryItem.SubtypeName


Type Subtypes
Ore Cobalt, Gold, Ice, Iron, Magnesium, Nickel, Platinum, Silicon, Silver, Stone, Uranium
Ingot Cobalt, Gold, Iron, Magnesium, Nickel, Platinum, Scrap, Silicon, Silver, Stone, Uranium
Component BulletproofGlass, Computer, Construction, Detector, Display, Girder, GravityGenerator, InteriorPlate, LargeTube, Medical, MetalGrid, Motor, PowerCell, RadioCommunication, Reactor, SmallTube, SolarCell, SteelPlate, Thrust
PhysicalGunObject WelderItem, HandDrillItem, AngleGrinderItem, AutomaticRifleItem
AmmoMagazine Missle200mm, NATO_25x184mm, NATO_5p56x45mm, Explosives


Code Examples

See also

References

  1. http://steamcommunity.com/sharedfiles/filedetails/?id=360966557
  2. http://forum.keenswh.com/threads/gridterminalsystem-blocks-doesnt-work-anymore.7365691/