LuaDocs/Actor

From Data Realms Wiki

(Difference between revisions)
Jump to: navigation, search

Revision as of 02:40, 5 May 2010

Contents

Parent: MOSRotating

Concrete Class. A sprite movable object that is autonomous.

Go back to Class Index


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_COUNT


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.

GoldCarried

Gets how many ounces of gold this Actor is carrying.The current amount of carried gold, in Oz.

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.

AIMode

This' AI mode.The current AI mode.


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.


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.


AddInventoryItem

Adds an inventory item to this Actor.

Arguments:

  • An pointer to the new item to add. Ownership IS TRANSFERRED!

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.

Arguments:

  • None.

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.


Go back to Class Index

Personal tools