Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Sandbox.ModAPI.Ingame.IMyPistonBase

Malware edited this page Oct 22, 2024 · 60 revisions

IndexNamespace Index

IMyPistonBase Interface

public interface IMyPistonBase: IMyMechanicalConnectionBlock, IMyFunctionalBlock, IMyTerminalBlock, IMyCubeBlock, IMyEntity

Describes piston block (PB scripting interface)

Namespace: Sandbox.ModAPI.Ingame
Assembly: Sandbox.Common.dll

Implements:

Inheritors:

Type Definitions:

  • MyObjectBuilder_ExtendedPistonBase/LargePistonBase
  • MyObjectBuilder_ExtendedPistonBase/LargePistonBaseReskin
  • MyObjectBuilder_ExtendedPistonBase/SmallPistonBase
  • MyObjectBuilder_ExtendedPistonBase/SmallPistonBaseReskin

Properties

float CurrentPosition { get; }

Gets the current position of the piston head relative to the base.

float HighestPosition { get; }

Gets the highest position the piston is capable of moving to.

float LowestPosition { get; }

Gets the lowest position the piston is capable of moving to.

float MaxLimit { get; set; }

Gets or sets the maximum position the piston can extend to. See LowestPosition and HighestPosition for the limits of this value.

float MaxVelocity { get; }

Gets the maximum velocity this piston is capable of moving at.

float MinLimit { get; set; }

Gets or sets the minimum position the piston can retract to. See LowestPosition and HighestPosition for the limits of this value.

float NormalizedPosition { get; }

Gets the current position normalized between MinLimit and MaxLimit

PistonStatus Status { get; }

Gets the current status.

float Velocity { get; set; }

Gets or sets the velocity of the piston as it extends or retracts. This value can be between negative and positive MaxVelocity .

SerializableDefinitionId BlockDefinition { get; }

Gets definition.Id assigned to this block

Inherited from IMyCubeBlock

bool Closed { get; }

True if the block has been removed from the world.

Inherited from IMyEntity

IMyEntityComponentContainer Components { get; }

Gets blocks component logic container

Inherited from IMyEntity

IMyCubeGrid CubeGrid { get; }

Grid in which the block is placed

Inherited from IMyCubeBlock

string CustomData { get; set; }

Gets or sets the Custom Data string. NOTE: Only use this for user input. For storing large mod configs, create your own MyModStorageComponent

Inherited from IMyTerminalBlock

string CustomInfo { get; }

Gets information about block status (available from mods) Sandbox.ModAPI.IMyTerminalBlock.AppendingCustomInfo Sandbox.ModAPI.IMyTerminalBlock.RefreshCustomInfo .

Inherited from IMyTerminalBlock

string CustomName { get; set; }

Gets or sets how block is named in Terminal menu

Inherited from IMyTerminalBlock

string CustomNameWithFaction { get; }

Gets or sets how block is named in Terminal menu. Work only for Cockpit, LaserAntenna RadioAntenna, SpaceBall, Beacon

Inherited from IMyTerminalBlock

string DefinitionDisplayNameText { get; }

Definition name

Inherited from IMyCubeBlock

string DetailedInfo { get; }

Gets information about block status. In Control panel bottom right text

Inherited from IMyTerminalBlock

float DisassembleRatio { get; }

Is set in definition Ratio at which is the block disassembled (grinding) Bigger values - longer grinding

Inherited from IMyCubeBlock

string DisplayName { get; }

Gets user friendly name of entity. May be null For block terminal name use DisplayNameText

Inherited from IMyEntity

string DisplayNameText { get; }

Translated block name

Inherited from IMyCubeBlock

bool Enabled { get; set; }

Represents terminal gui toggle. Gets or sets if block is Enabled

Inherited from IMyFunctionalBlock

long EntityId { get; }

Id of entity

Inherited from IMyEntity

bool HasInventory { get; }

Returns true if this entity has got at least one inventory. Note that one aggregate inventory can contain zero simple inventories => zero will be returned even if GetInventory() != null.

Inherited from IMyEntity

int InventoryCount { get; }

Returns the count of the number of inventories this entity has.

Inherited from IMyEntity

bool IsAttached { get; }

Gets if the block base is attached to something

Inherited from IMyMechanicalConnectionBlock

bool IsBeingHacked { get; }

Hacking of the block is in progress

Inherited from IMyCubeBlock

bool IsFunctional { get; }

Gets if integrity is above breaking threshold

Inherited from IMyCubeBlock

bool IsWorking { get; }

True if block is able to do its work depening on block type (is functional, powered, enabled, etc...)

Inherited from IMyCubeBlock

float Mass { get; }

Block mass

Inherited from IMyCubeBlock

Vector3I Max { get; }

Maximum coordinates of grid cells occupied by this block

Inherited from IMyCubeBlock

Vector3I Min { get; }

Minimum coordinates of grid cells occupied by this block

Inherited from IMyCubeBlock

string Name { get; }

Some entities can have uniq name, and game can find them by name VRage.ModAPI.IMyEntities.TryGetEntityByName(System.String,VRage.ModAPI.IMyEntity@)

Inherited from IMyEntity

int NumberInGrid { get; }

Order in which were the blocks of same type added to grid Used in default display name

Inherited from IMyCubeBlock

MyBlockOrientation Orientation { get; }

Returns block orientation in base 6 directions

Inherited from IMyCubeBlock

long OwnerId { get; }

IdentityId of player owning block (not steam Id)

Inherited from IMyCubeBlock

bool PendingAttachment { get; }

Gets if the block is looking for a top part

Inherited from IMyMechanicalConnectionBlock

Vector3I Position { get; }

Position in grid coordinates

Inherited from IMyCubeBlock

bool ShowInInventory { get; set; }

Represent terminal gui toggle Show block in Inventory Screen. Gets or sets its value

Inherited from IMyTerminalBlock

bool ShowInTerminal { get; set; }

Represent terminal gui toggle Show block in terminal. Gets or sets its value

Inherited from IMyTerminalBlock

bool ShowInToolbarConfig { get; set; }

Represent terminal gui toggle Show in toolbar config. Gets or sets its value

Inherited from IMyTerminalBlock

bool ShowOnHUD { get; set; }

Represent terminal gui toggle Show On HUD. Gets or sets its value

Inherited from IMyTerminalBlock

IMyAttachableTopBlock Top { get; }

Gets the attached top part entity

Inherited from IMyMechanicalConnectionBlock

IMyCubeGrid TopGrid { get; }

Gets the grid of the attached top part

Inherited from IMyMechanicalConnectionBlock

BoundingBoxD WorldAABB { get; }

Gets world axis-aligned bounding box

Inherited from IMyEntity

BoundingBoxD WorldAABBHr { get; }

Gets world axis-aligned bounding box

Inherited from IMyEntity

MatrixD WorldMatrix { get; }

Gets world matrix of this entity

Inherited from IMyEntity

BoundingSphereD WorldVolume { get; }

Gets bounding sphere of this entity

Inherited from IMyEntity

BoundingSphereD WorldVolumeHr { get; }

Gets bounding sphere of this entity

Inherited from IMyEntity

bool IsLocked { get; }

Obsolete: SafetyLock is no longer supported. This is property dummy property only, for backwards compatibility.

Gets if the block is safety locked (welded)

Inherited from IMyMechanicalConnectionBlock

bool SafetyLock { get; set; }

Obsolete: SafetyLock is no longer supported. This is property dummy property only, for backwards compatibility.

Gets if the block is safety locked (welded)

Inherited from IMyMechanicalConnectionBlock

float SafetyLockSpeed { get; set; }

Obsolete: SafetyLock is no longer supported. This is property dummy property only, for backwards compatibility.

Gets or sets the speed at which this device will engage it's safety lock ( IsLocked ).

Inherited from IMyMechanicalConnectionBlock

Methods

void Extend()

Extends the piston.

void MoveToPosition(float extent, float speed)

Sets velocity and limits to move the piston to the specified extent value

void Retract()

Retracts the piston.

void Reverse()

Reverses the direction of the piston.

void Attach()

Attaches a nearby top part to the block

Inherited from IMyMechanicalConnectionBlock

void Detach()

Detaches the top from the base

Inherited from IMyMechanicalConnectionBlock

void GetActions(List<ITerminalAction> resultList, Func<ITerminalAction, bool> collect = null)

Get all terminal actions available for block

Inherited from IMyTerminalBlock

ITerminalAction GetActionWithName(string name)

Get first found terminal action with name

Inherited from IMyTerminalBlock

IMyInventory GetInventory()

Simply get the MyInventoryBase component stored in this entity.

Inherited from IMyEntity

IMyInventory GetInventory(int index)

Search for inventory component with maching index.

Inherited from IMyEntity

string GetOwnerFactionTag()

Tag of faction owning block

Inherited from IMyCubeBlock

Vector3D GetPosition()

Gets position in world coordinates

Inherited from IMyEntity

void GetProperties(List<ITerminalProperty> resultList, Func<ITerminalProperty, bool> collect = null)

Get all terminal actions available for block.

Inherited from IMyTerminalBlock

ITerminalProperty GetProperty(string id)

Finds terminal property with provided id

Inherited from IMyTerminalBlock

MyRelationsBetweenPlayerAndBlock GetUserRelationToOwner(long playerId, MyRelationsBetweenPlayerAndBlock defaultNoUser = MyRelationsBetweenPlayerAndBlock.NoOwnership)

Gets relation to owner of block

Inherited from IMyCubeBlock

bool HasLocalPlayerAccess()

Returns if local player can use block. Executes HasPlayerAccess(long, MyRelationsBetweenPlayerAndBlock = MyRelationsBetweenPlayerAndBlock.NoOwnership) with local player identityId. On Dedicated Server as identityId it is using 0 as playerId

Inherited from IMyTerminalBlock

bool HasNobodyPlayerAccessToBlock()

Returns if Nobody has access to block.

Inherited from IMyTerminalBlock

bool HasPlayerAccess(long playerId, MyRelationsBetweenPlayerAndBlock defaultNoUser = MyRelationsBetweenPlayerAndBlock.NoOwnership)

Returns if local player can use block. It is also checking for admin access.

Inherited from IMyTerminalBlock

bool HasPlayerAccessWithNobodyCheck(long playerId, bool isForPB = default)

Returns if player can use block. If playerId is 0 (Nobody), calls HasNobodyPlayerAccessToBlock instead It is also checking for admin access.

Inherited from IMyTerminalBlock

bool IsSameConstructAs(IMyTerminalBlock other)

Determines whether this block is VRage.Game.ModAPI.GridLinkTypeEnum.Mechanical connected to the other. This is any block connected with rotors or pistons or other mechanical devices, but not things like connectors. This will in most cases constitute your complete construct.

Be aware that using merge blocks combines grids into one, so this function will not filter out grids connected that way. Also be aware that detaching the heads of pistons and rotors will cause this connection to change.

Inherited from IMyTerminalBlock

void SearchActionsOfName(string name, List<ITerminalAction> resultList, Func<ITerminalAction, bool> collect = null)

Get all terminal actions available for block. NOTE: First called `

and then

` check

Inherited from IMyTerminalBlock

MyRelationsBetweenPlayerAndBlock GetPlayerRelationToOwner()

Obsolete: GetPlayerRelationToOwner() is useless ingame. Mods should use the one in ModAPI.IMyCubeBlock

Relation of local player to the block Should not be called on Dedicated Server.

Inherited from IMyCubeBlock

void RequestEnable(bool enable)

Obsolete: Use the setter of Enabled

Obsolete

Inherited from IMyFunctionalBlock

void SetCustomName(string text)

Obsolete: Use the setter of Customname

Obsolete

Inherited from IMyTerminalBlock

void SetCustomName(StringBuilder text)

Obsolete: Use the setter of Customname

Obsolete

Inherited from IMyTerminalBlock

void UpdateIsWorking()

Obsolete

Force refresh working state. Call if you change block state that could affect its working status.

Inherited from IMyCubeBlock

void UpdateVisual()

Obsolete

Updates block visuals (ie. block emissivity)

Inherited from IMyCubeBlock

Clone this wiki locally