LuaDocs/Controller

From Data Realms Wiki

(Difference between revisions)
Jump to: navigation, search
(SetState)
(Controller - Automatically generated by LuaBot)
 
Line 1: Line 1:
 +
===Has no parent class===
===Has no parent class===
Line 136: Line 137:
'''Arguments:'''
'''Arguments:'''
-
* Name of the state
+
* Which state to set and which value to set it to.
-
* What the state should be set to(true/false)
+
'''Return value:'''
'''Return value:'''
None.
None.
 +
===IsState===
===IsState===

Latest revision as of 22:58, 10 May 2011

Contents

Has no parent class

Generic Class. A class controlling MovableObject:s through either player input, networking, scripting, AI, etc.

Go back to Class Index


Enumerations

ControlState

  • 0 = PRIMARY_ACTION
  • 1 = SECONDARY_ACTION
  • 2 = MOVE_IDLE
  • 3 = MOVE_RIGHT
  • 4 = MOVE_LEFT
  • 5 = MOVE_UP
  • 6 = MOVE_DOWN
  • 7 = MOVE_FAST
  • 8 = BODY_JUMPSTART
  • 9 = BODY_JUMP
  • 10 = BODY_CROUCH
  • 11 = AIM_UP
  • 12 = AIM_DOWN
  • 13 = AIM_SHARP
  • 14 = WEAPON_FIRE
  • 15 = WEAPON_RELOAD
  • 16 = PIE_MENU_ACTIVE
  • 17 = WEAPON_CHANGE_NEXT
  • 18 = WEAPON_CHANGE_PREV
  • 19 = WEAPON_PICKUP
  • 20 = WEAPON_DROP
  • 21 = ACTOR_NEXT
  • 22 = ACTOR_PREV
  • 23 = ACTOR_BRAIN
  • 24 = ACTOR_NEXT_PREP
  • 25 = ACTOR_PREV_PREP
  • 26 = HOLD_RIGHT
  • 27 = HOLD_LEFT
  • 28 = HOLD_UP
  • 29 = HOLD_DOWN
  • 30 = PRESS_PRIMARY
  • 31 = PRESS_SECONDARY
  • 32 = PRESS_RIGHT
  • 33 = PRESS_LEFT
  • 34 = PRESS_UP
  • 35 = PRESS_DOWN
  • 36 = RELEASE_PRIMARY
  • 37 = RELEASE_SECONDARY
  • 38 = PRESS_FACEBUTTON
  • 39 = SCROLL_UP
  • 40 = SCROLL_DOWN
  • 41 = DEBUG_ONE
  • 42 = CONTROLSTATECOUNT


InputMode

  • 0 = CIM_DISABLED
  • 1 = CIM_PLAYER
  • 2 = CIM_AI
  • 3 = CIM_NETWORK
  • 4 = CIM_INPUTMODECOUNT


Properties

InputMode

The current mode of input for this Controller.The InputMode that this controller is currently using.

ControlledActor

Gets which Actor is being controlled by this. 0 if none.A pointer to the Actor which is being controlled by this. Ownership is NOT transferred!

Team

The Team number using this controller.An int representing the team which this Controller belongs to. 0 is the first team. 0 if no team is using it.

AnalogMove

The analog movement input data.A vector with the analog movement data, both axes ranging form -1.0 to 1.0.

AnalogAim

The analog aiming input data.A vector with the analog aiming data, both axes ranging form -1.0 to 1.0.

AnalogCursor

Read-only property. The analog menu input data.A vector with the analog menu data, both axes ranging form -1.0 to 1.0.

Player

Gets which player's input this is listening to, if in player input mode.The player number, or -1 if not in player input mode.

MouseMovement

Read-only property. The relative movement of the mouse since last update. Only returns true if this' player is actually set up to be using the mouse.The relative mouse movements, in both axes.

Disabled

Shows whether this is disabled.Whether disabled.


Functions

IsPlayerControlled

Shortcut to indicate if in player input mode.

Arguments:

  • If you want to check if it's controlled by a player, AND that player is someone else than a specific one, pass in that player number here.

Return value:

Whether input mode is set to player input.


RelativeCursorMovement

Adds relative movement to a passed-in vector. Uses the appropriate input method currently of this.

Arguments:

  • The vector to alter.
  • The scale of the input. 1.0 is 'normal'.

Return value:

Whether the vector was altered or not.


IsMouseControlled

Indicated whether this is listening to mouse input at all.

Arguments:

  • None.

Return value:

Whether this is using mouse input at all.


SetState

Sets one of this controller's states.

Arguments:

  • Which state to set and which value to set it to.

Return value:

None.


IsState

Shows whether the current controller is in a specific state.

Arguments:

  • Which state to check.

Return value:

Whether the controller is in the specified state.


Go back to Class Index

Personal tools