Show / Hide Table of Contents

Interface IMyCharacter

Describes character (mods interface)

Inherited Members
IMyEntity.GetFriendlyName()
IMyEntity.Close()
IMyEntity.Delete()
IMyEntity.GetObjectBuilder(Boolean)
IMyEntity.BeforeSave()
IMyEntity.GetTopMostParent(Type)
IMyEntity.SetLocalMatrix(Matrix, Object)
IMyEntity.GetChildren(List<IMyEntity>, Func<IMyEntity, Boolean>)
IMyEntity.GetSubpart(String)
IMyEntity.TryGetSubpart(String, MyEntitySubpart)
IMyEntity.GetDiffuseColor()
IMyEntity.IsVisible()
IMyEntity.DebugDraw()
IMyEntity.DebugDrawInvalidTriangles()
IMyEntity.EnableColorMaskForSubparts(Boolean)
IMyEntity.SetColorMaskForSubparts(Vector3)
IMyEntity.SetTextureChangesForSubparts(Dictionary<MyStringId, MyTextureChange>)
IMyEntity.SetTextureChangesForSubparts(Dictionary<String, MyTextureChange>)
IMyEntity.SetEmissiveParts(String, Color, Single)
IMyEntity.SetEmissivePartsForSubparts(String, Color, Single)
IMyEntity.GetDistanceBetweenCameraAndBoundingSphere()
IMyEntity.GetDistanceBetweenCameraAndPosition()
IMyEntity.GetLargestDistanceBetweenCameraAndBoundingSphere()
IMyEntity.GetSmallestDistanceBetweenCameraAndBoundingSphere()
IMyEntity.OnRemovedFromScene(Object)
IMyEntity.OnAddedToScene(Object)
IMyEntity.GetViewMatrix()
IMyEntity.GetWorldMatrixNormalizedInv()
IMyEntity.SetWorldMatrix(MatrixD, Object)
IMyEntity.SetPosition(Vector3D)
IMyEntity.Teleport(MatrixD, Object, Boolean)
IMyEntity.GetIntersectionWithLine(LineD, Nullable<MyIntersectionResultLineTriangleEx>, IntersectionFlags)
IMyEntity.GetIntersectionWithLineAndBoundingSphere(LineD, Single)
IMyEntity.GetIntersectionWithSphere(BoundingSphereD)
IMyEntity.GetIntersectionWithAABB(BoundingBoxD)
IMyEntity.GetTrianglesIntersectingSphere(BoundingSphere, Nullable<Vector3>, Nullable<Single>, List<MyTriangle_Vertex_Normals>, Int32)
IMyEntity.DoOverlapSphereTest(Single, Vector3D)
IMyEntity.GetInventory()
IMyEntity.GetInventory(Int32)
IMyEntity.AddToGamePruningStructure()
IMyEntity.RemoveFromGamePruningStructure()
IMyEntity.UpdateGamePruningStructure()
IMyEntity.Physics
IMyEntity.PositionComp
IMyEntity.Render
IMyEntity.GameLogic
IMyEntity.Hierarchy
IMyEntity.SyncObject
IMyEntity.Storage
IMyEntity.Flags
IMyEntity.EntityId
IMyEntity.Name
IMyEntity.MarkedForClose
IMyEntity.DebugAsyncLoading
IMyEntity.Save
IMyEntity.PersistentFlags
IMyEntity.Model
IMyEntity.ModelCollision
IMyEntity.Synchronized
IMyEntity.NeedsUpdate
IMyEntity.Parent
IMyEntity.LocalMatrix
IMyEntity.NearFlag
IMyEntity.CastShadows
IMyEntity.FastCastShadowResolve
IMyEntity.NeedsResolveCastShadow
IMyEntity.MaxGlassDistSq
IMyEntity.NeedsDraw
IMyEntity.NeedsDrawFromParent
IMyEntity.Transparent
IMyEntity.ShadowBoxLod
IMyEntity.SkipIfTooSmall
IMyEntity.Visible
IMyEntity.NeedsWorldMatrix
IMyEntity.InScene
IMyEntity.InvalidateOnMove
IMyEntity.WorldMatrix
IMyEntity.WorldMatrixInvScaled
IMyEntity.WorldMatrixNormalizedInv
IMyEntity.IsVolumetric
IMyEntity.LocalAABB
IMyEntity.LocalAABBHr
IMyEntity.LocalVolume
IMyEntity.LocalVolumeOffset
IMyEntity.LocationForHudMarker
IMyEntity.IsCCDForProjectiles
IMyEntity.DisplayName
IMyEntity.StopPhysicsActivation
IMyEntity.OnClose
IMyEntity.OnClosing
IMyEntity.OnMarkForClose
IMyEntity.OnPhysicsChanged
IMyEntity.GetPosition()
IMyEntity.Components
IMyEntity.HasInventory
IMyEntity.InventoryCount
IMyEntity.Closed
IMyEntity.WorldAABB
IMyEntity.WorldAABBHr
IMyEntity.WorldVolume
IMyEntity.WorldVolumeHr
IMyControllableEntity.GetHeadMatrix(Boolean, Boolean, Boolean, Boolean)
IMyControllableEntity.MoveAndRotate(Vector3, Vector2, Single)
IMyControllableEntity.MoveAndRotateStopped()
IMyControllableEntity.Use()
IMyControllableEntity.UseContinues()
IMyControllableEntity.PickUp()
IMyControllableEntity.PickUpContinues()
IMyControllableEntity.Up()
IMyControllableEntity.Down()
IMyControllableEntity.Jump(Vector3)
IMyControllableEntity.SwitchWalk()
IMyControllableEntity.Crouch()
IMyControllableEntity.ShowInventory()
IMyControllableEntity.ShowTerminal()
IMyControllableEntity.ShowRemoteAccessMenu()
IMyControllableEntity.SwitchThrusts()
IMyControllableEntity.SwitchDamping()
IMyControllableEntity.SwitchLights()
IMyControllableEntity.SwitchLandingGears()
IMyControllableEntity.SwitchHandbrake()
IMyControllableEntity.SwitchReactors()
IMyControllableEntity.SwitchReactorsLocal()
IMyControllableEntity.SwitchHelmet()
IMyControllableEntity.DrawHud(IMyCameraController, Int64)
IMyControllableEntity.Die()
IMyControllableEntity.ControllerInfo
IMyControllableEntity.Entity
IMyControllableEntity.ForceFirstPersonCamera
IMyControllableEntity.LastMotionIndicator
IMyControllableEntity.LastRotationIndicator
IMyControllableEntity.EnabledThrusts
IMyControllableEntity.EnabledDamping
IMyControllableEntity.EnabledLights
IMyControllableEntity.EnabledLeadingGears
IMyControllableEntity.CanSwitchLandingGears
IMyControllableEntity.EnabledReactors
IMyControllableEntity.EnabledHelmet
IMyControllableEntity.PrimaryLookaround
IMyControllableEntity.RelativeDampeningDistance
IMyControllableEntity.RelativeDampeningTarget
IMyControllableEntity.IsAutopilotControlled
IMyCameraController.ControlCamera(MyCamera)
IMyCameraController.Rotate(Vector2, Single)
IMyCameraController.RotateStopped()
IMyCameraController.OnAssumeControl(IMyCameraController)
IMyCameraController.OnReleaseControl(IMyCameraController)
IMyCameraController.HandleUse()
IMyCameraController.HandlePickUp()
IMyCameraController.GetOverridingFocusMatrix()
IMyCameraController.IsInFirstPersonView
IMyCameraController.EnableFirstPersonView
IMyCameraController.AllowCubeBuilding
IMyDestroyableObject.OnDestroy()
IMyDestroyableObject.DoDamage(Single, MyStringHash, Boolean, Nullable<MyHitInfo>, Int64, Int64, Boolean, Nullable<MyStringHash>)
IMyDestroyableObject.Integrity
IMyDestroyableObject.UseDamageSystem
IMyDecalProxy.AddDecals(MyHitInfo, MyStringHash, Vector3, Object, IMyDecalHandler, MyStringHash, MyStringHash, Boolean, MyDecalFlags, Int32, List<UInt32>)
Namespace: VRage.Game.ModAPI
Assembly: VRage.Game.dll
Syntax
public interface IMyCharacter : IMyEntity, IMyEntity, IMyControllableEntity, IMyCameraController, IMyDestroyableObject, IMyDecalProxy

Properties

AimedPoint

Gets or, for non-player controlled characters, sets the aimed point direction.

Declaration
Vector3D AimedPoint { get; set; }
Property Value
Type Description
Vector3D
Remarks

For characters, which are not controlled by player, this will set the aimed point, otherwise the aimed point is determined from camera matrix

BaseMass

Gets the base mass of the character

Declaration
float BaseMass { get; }
Property Value
Type Description
System.Single

CharacterGeneralDamageModifier

Allows you to get or set the damage modifier of a character.

Declaration
float CharacterGeneralDamageModifier { get; set; }
Property Value
Type Description
System.Single

CurrentMass

Gets the entire mass of the character, including inventory

Declaration
float CurrentMass { get; }
Property Value
Type Description
System.Single

CurrentMovementState

Gets the character's current movement state.

Declaration
MyCharacterMovementEnum CurrentMovementState { get; set; }
Property Value
Type Description
MyCharacterMovementEnum

Definition

The character definition. Cast to MyCharacterDefinition.

Declaration
MyDefinitionBase Definition { get; }
Property Value
Type Description
MyDefinitionBase
Remarks

Until refactoring is complete, casting this to MyCharacterDefinition is needed.

EnvironmentOxygenLevel

Gets the amount of oxygen in the surrounding environment

Declaration
float EnvironmentOxygenLevel { get; }
Property Value
Type Description
System.Single

EquippedTool

Gets currently equipped tool (IMyHandheldGunObject)

Declaration
IMyEntity EquippedTool { get; }
Property Value
Type Description
IMyEntity

IsBot

Returns true if this character is an AI character, otherwise false.

Declaration
bool IsBot { get; }
Property Value
Type Description
System.Boolean

IsDead

Returns true if this character is dead

Declaration
bool IsDead { get; }
Property Value
Type Description
System.Boolean

IsPlayer

Returns true if this character is a player character, otherwise false.

Declaration
bool IsPlayer { get; }
Property Value
Type Description
System.Boolean

OxygenLevel

Gets the amount of oxygen at the character location from air pressure system (grids with airtightness)

Declaration
float OxygenLevel { get; }
Property Value
Type Description
System.Single

PreviousMovementState

Gets the character's previous movement state.

Declaration
MyCharacterMovementEnum PreviousMovementState { get; }
Property Value
Type Description
MyCharacterMovementEnum

SuitEnergyLevel

Returns the amount of energy the suit has, values will range between 0 and 1, where 0 is no charge and 1 is full charge.

Declaration
float SuitEnergyLevel { get; }
Property Value
Type Description
System.Single

Methods

add_MovementStateChanged(CharacterMovementStateChangedDelegate)

Declaration
void add_MovementStateChanged(CharacterMovementStateChangedDelegate value)
Parameters
Type Name Description
CharacterMovementStateChangedDelegate value

add_OnMovementStateChanged(CharacterMovementStateDelegate)

Declaration
void add_OnMovementStateChanged(CharacterMovementStateDelegate value)
Parameters
Type Name Description
CharacterMovementStateDelegate value

GetOutsideTemperature()

Returns outside temperature around character. If character is in presurrized/oxygen environment, then the temperature is always friendly.

Declaration
float GetOutsideTemperature()
Returns
Type Description
System.Single

0 for extreme freeze, 0.5 for cozy, 1.0 for extreme hot

GetSuitGasFillLevel(MyDefinitionId)

Returns the amount of gas left in the suit, values will range between 0 and 1, where 0 is no gas and 1 is full gas.

Declaration
float GetSuitGasFillLevel(MyDefinitionId gasDefinitionId)
Parameters
Type Name Description
MyDefinitionId gasDefinitionId

Definition Id of the gas. Common example: new MyDefinitionId(typeof(MyObjectBuilder_GasProperties), "Oxygen")

Returns
Type Description
System.Single

Kill(Object)

Kills the character

Declaration
void Kill(object killData = null)
Parameters
Type Name Description
System.Object killData

remove_MovementStateChanged(CharacterMovementStateChangedDelegate)

Declaration
void remove_MovementStateChanged(CharacterMovementStateChangedDelegate value)
Parameters
Type Name Description
CharacterMovementStateChangedDelegate value

remove_OnMovementStateChanged(CharacterMovementStateDelegate)

Declaration
void remove_OnMovementStateChanged(CharacterMovementStateDelegate value)
Parameters
Type Name Description
CharacterMovementStateDelegate value

TriggerCharacterAnimationEvent(String, Boolean)

Trigger animation event in the new animation system. If there is a transition leading from current animation state having same name as this event, animation state machine will change state accordingly. If not, nothing happens.

Declaration
void TriggerCharacterAnimationEvent(string eventName, bool sync)
Parameters
Type Name Description
System.String eventName

Event name.

System.Boolean sync

Synchronize over network

Events

CharacterDied

Event triggered when character dies

Declaration
event Action<IMyCharacter> CharacterDied
Event Type
Type Description
System.Action<IMyCharacter>

MovementStateChanged

Called when the movement state changes

Declaration
event CharacterMovementStateChangedDelegate MovementStateChanged
Event Type
Type Description
CharacterMovementStateChangedDelegate

OnMovementStateChanged

Declaration
event CharacterMovementStateDelegate OnMovementStateChanged
Event Type
Type Description
CharacterMovementStateDelegate
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾