LuaDocs/Actor
From Data Realms Wiki
Parent: MOSRotating
Concrete Class. A sprite movable object that is autonomous.
Enumerations
Status
- 0 = STABLE
- 1 = UNSTABLE
- 2 = INACTIVE
- 3 = DYING
- 4 = DEAD
AIMode
- 0 = AIMODE_NONE
- 1 = AIMODE_SENTRY
- 2 = AIMODE_PATROL
- 3 = AIMODE_GOTO
- 4 = AIMODE_BRAINHUNT
- 5 = AIMODE_GOLDDIG
- 6 = AIMODE_RETURN
- 7 = AIMODE_STAY
- 8 = AIMODE_SCUTTLE
- 9 = AIMODE_DELIVER
- 10 = AIMODE_BOMB
- 11 = AIMODE_SQUAD
- 12 = AIMODE_COUNT
ActionState
- 0 = MOVING
- 1 = MOVING_FAST
- 2 = FIRING
- 3 = ActionStateCount
AimState
- 0 = AIMSTILL
- 1 = AIMUP
- 2 = AIMDOWN
- 3 = AimStateCount
LateralMoveState
- 0 = LAT_STILL
- 1 = LAT_LEFT
- 2 = LAT_RIGHT
ObstacleState
- 0 = PROCEEDING
- 1 = BACKSTEPPING
- 2 = DIGPAUSING
- 3 = JUMPING
- 4 = SOFTLANDING
TeamBlockState
- 0 = NOTBLOCKED
- 1 = BLOCKED
- 2 = IGNORINGBLOCK
- 3 = FOLLOWWAIT
Properties
ClassName
The class name of this Entity.A string with the friendly-formatted type name of this object.
Status
Returns the current Status of this.The status.
Health
This Actor's health value.A const int describing this Actor's health.
MaxHealth
This Actor's maximum health value.A const int describing this Actor's max health.
GoldCarried
Gets how many ounces of gold this Actor is carrying.The current amount of carried gold, in Oz.
AimRange
Read-only property. The limit of this actors aiming angle, in each direction, in radians.The arc range of the aiming angle in radians. Eg if HalfPI, it means full 180 degree range
CPUPos
Read-only property. The absoltue position of this' brain, or equivalent.A Vector with the absolute position of this' brain.
EyePos
Read-only property. The absoltue position of this' eye, or equivalent, where look vector starts from.A Vector with the absolute position of this' eye or view point.
ViewPoint
The point at which this actor is viewing, or that the scene frame should be centered on if tracking this Actor's view. In absolute scene coordinates.The point in absolute scene coordinates.
Height
Read-only property. The approximate height of this Actor, standing up.A float with the approximate height, in pixels.
AIMode
This' AI mode.The current AI mode.
Perceptiveness
This' perceptiveness to alarming events going on around him.The current perceptiveness, 0.0 - 1.0
InventorySize
Read-only property. Tells how many things are in the invetoryThe number of things in the inventory
MaxMass
Read-only property. Tells how much total mass (in kg) this Actor is recommended to weigh at most INCLUDING his own weight AND all his inventory!The max recommend total mass for this Actor
MovePathSize
Read-only property. Gets how many waypoints there are in the MovePath currentlyThe number of waypoints in the MovePath.
AimDistance
Read-only property. The distance between the actor and the view point when not sharp aiming.A const int describing how far this actor aims/looks by default.
TotalWoundCount
Read-only property. Returns total number of wounds of this actor.
TotalWoundLimit
Read-only property. Returns total wound limit of this actor.
Functions
GetController
Gets this Actor's Controller. Ownership IS NOT transferred!
Arguments:
- None.
Return value:
A const pointer to this Actor's Controller.
IsPlayerControlled
Tells whether a player is currently controlling this.
Arguments:
- None.
Return value:
Whether a player is controlling this.
IsControllable
Tells wheter the player can switch control to this at all
Arguments:
- None.
Return value:
Whether a player can control this at all.
SetControllerMode
Sets this Actor's new Controller input mode.
Arguments:
- The new input mode.
- The player which will control this if the input mode was set to player.
Return value:
None.
SwapControllerModes
Sets this Actor's Controller mode and gives back what it used to be.
Arguments:
- The new mode to set to.
- The player which will control this if the input mode was set to player.
Return value:
The old mode that it had before.
GetAimAngle
Gets this Actor's aim angle.
Arguments:
- Whether to adjust the angle for flipping or not.
Return value:
The angle, in radians.
SetAimAngle
Sets this Actor's aim angle.
Arguments:
- A new angle, in radians.
Return value:
None.
HasObject
Shows whether this is or carries a specifically named object in its inventory. Also looks through the inventories of potential passengers, as applicable.
Arguments:
- The Preset name of the object to look for.
Return value:
Whetehr the object was found carried by this.
HasObjectInGroup
Shows whether this is or carries a specifically grouped object in its inventory. Also looks through the inventories of potential passengers, as applicable.
Arguments:
- The name of the group to look for.
Return value:
Whetehr the object in the group was found carried by this.
IsWithinRange
Tells whether a point on the scene is within range of the currently used device and aiming status, if applicable.
Arguments:
- A Vector witht he aboslute coordinates of a point to check.
Return value:
Whether the point is within range of this.
AddHealth
Adds health points to this Actor's current health value.
Arguments:
- An int specifying the value to add.
Return value:
The resulting total health of this Actor.
IsStatus
Checks if this Actor is in a specific status.
Arguments:
- Which status to check for.
Return value:
A bool with the answer.
IsDead
Checks if this Actor is dead.
Arguments:
- None.
Return value:
A const bool with the answer.
FacingAngle
Adjusts an absolute aiming angle based on wether this Actor is facing left or right.
Arguments:
- The input angle in radians.
Return value:
The output angle in radians, which will be unaltered if this Actor is facing right.
AddAISceneWaypoint
Adds an absolute scene point to the list of waypoints this is going to go to, in order
Arguments:
- The new scene point this should try to get to after all other waypoints are reached.
Return value:
None.
AddAIMOWaypoint
Adds an MO in the scene as the next waypoint for this to go to, in order
Arguments:
- The new MO this should try to get to after all other waypoints are reached.
- OWNERSHIP IS NOT TRANSFERRED!
Return value:
None.
ClearAIWaypoints
Removes all AI waypoints and clears the current path to the current waypoint. The AI Actor will stop in its tracks.
Arguments:
- None.
Return value:
None.
GetLastAIWaypoint
Gets the last or furthest set AI waypoint of this. If none, this' pos is returned.
Arguments:
- None.
Return value:
The furthest set AI waypoint of this.
GetWaypointListSize
Gets how many waypoints this actor have.
Arguments:
- None.
Return value:
How many waypoints.
ClearMovePath
Clears the list of coordinates in this' current MovePath, ie the path to the next Waypoint.
Arguments:
- None.
Return value:
None.
AddToMovePathBeginning
Adds a coordinate to the beginning of the MovePath, meaning the one closest to this Actor.
Arguments:
- The new coordinate to add to the front of the MovePath.
Return value:
None.
AddToMovePathEnd
Adds a coordinate to the end of the MovePath, meaning the one closest to this Actor's next waypoint.
Arguments:
- The new coordinate to add to the end of the MovePath.
Return value:
None.
RemoveMovePathBeginning
Removes a coordinate from the beginning of the MovePath, meaning the one closest to this Actor.
Arguments:
- None.
Return value:
Whether there was any coordinate to remove. If false, the MovePath is empty.
RemoveMovePathEnd
Removes a coordinate from the end of the MovePath, meaning the one farthest from this Actor.
Arguments:
- None.
Return value:
Whether there was any coordinate to remove. If false, the MovePath is empty.
AddInventoryItem
Adds an inventory item to this Actor.
Arguments:
- An pointer to the new item to add. Ownership IS TRANSFERRED!
Return value:
None..
RemoveInventoryItem
Removes a specified item from the actor's inventory. Only one item is removed at a time.
Arguments:
- Preset name of an item to remove.
Return value:
None.
SwapNextInventory
Swaps the next MovableObject carried by this Actor and puts one not currently carried into the into the back of the inventory of this.
Arguments:
- A pointer to the external MovableObject to trade in. Ownership IS xferred!
- If 0 is passed in, nothing will be added to the inventory.
- Whether to mute the sound on this event. Override for the loading screen hack.
Return value:
The next MovableObject in this Actor's inventory. Ownership IS xferred! If there are no MovableObject:s in inventory, 0 will be returned.
SwapPrevInventory
Swaps the prev MovableObject carried by this Actor and puts one not currently carried into the into the back of the inventory of this.
Arguments:
- A pointer to the external MovableObject to trade in. Ownership IS xferred!
- If 0 is passed in, nothing will be added to the inventory.
Return value:
The prev MovableObject in this Actor's inventory. Ownership IS xferred! If there are no MovableObject:s in inventory, 0 will be returned.
DropAllInventory
Ejects all inventory items that this is carrying. It may not happen instantaneously, so check for ejection being complete with IsInventoryEmpty().
Arguments:
- None.
Return value:
None.
IsInventoryEmpty
Tells whether inventory is completely empty
Arguments:
- None.
Return value:
Whether inventory is completely empty.
FlashWhite
Tells to make this and all children get drawn as completely white, but only for a specified amount of time.
Arguments:
- For how long to flash the whiteness, in MS.
Return value:
None.
DrawWaypoints
Makes this draw its current waypoints and related data on the scene in its HUD drawing stage.
Arguments:
- Whether to enable or disable the drawing of the waypoints.
Return value:
None.
SetMovePathToUpdate
Sets this' AI's move path to be updated. Will update the path to the current waypoint, if any.
Arguments:
- None.
Return value:
None.
UpdateMovePath
Updates this' move path RIGHT NOW. Will update the path to the current waypoint, if any. CAVEAT: this only actually updates if a queue index number passed in is sufficiently close to 0 to allow this to compute, based on an internal global assessment of how often this very expensive computation is allowed to run.
Arguments:
- The queue number this was given the last time
Return value:
Whether the update was performed, or if it should be tried again next frame.
SetAlarmPoint
Makes this alarmed about a certian point on in the scene, overriding the current AI mode until a certain time has passed.
Arguments:
- The new scene point this should look at and see if anything dangerous is there.
Return value:
None.
GetAlarmPoint
Gets any point on the scene this actor should be alarmed about this frame.
Arguments:
- None.
Return value:
The new scene point this should look at and see if anything dangerous is there or (0,0) if nothing is alarming.
RemoveAnyRandomWounds
Removes a specified amount of wounds from the actor and all standard attachables.
Arguments:
- Amount of wounds to remove.
Return value:
Damage taken from removed wounds.