Interface IMyCharacter
Describes character (mods interface)
Inherited Members
Namespace: VRage.Game.ModAPI
Assembly: VRage.Game.dll
Syntax
public interface IMyCharacter : IMyEntity, IMyEntity, IMyControllableEntity, IMyCameraController, IMyDestroyableObject, IMyDecalProxyProperties
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 | 
CanSprint
Gets/Sets if character can sprint
Declaration
bool CanSprint { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
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 | 
UsingEntity
Gets currently used entity by character (cockpit, cryo etc.)
Declaration
IMyEntity UsingEntity { get; }Property Value
| Type | Description | 
|---|---|
| IMyEntity | 
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 | 
SetCharacterSpeedDebuff(Single)
Sets character speed debuf
Declaration
void SetCharacterSpeedDebuff(float debuffValue)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Single | debuffValue | 
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> CharacterDiedEvent Type
| Type | Description | 
|---|---|
| System.Action<IMyCharacter> | 
MovementStateChanged
Called when the movement state changes
Declaration
event CharacterMovementStateChangedDelegate MovementStateChangedEvent Type
| Type | Description | 
|---|---|
| CharacterMovementStateChangedDelegate | 
OnMovementStateChanged
Declaration
event CharacterMovementStateDelegate OnMovementStateChangedEvent Type
| Type | Description | 
|---|---|
| CharacterMovementStateDelegate |