Module CorsixTH.CorsixTH.Lua.humanoid_action
Humanoid action base class.
Functions
| HumanoidAction:HumanoidAction (name) | Construct a humanoid action (base class constructor). |
| HumanoidAction:disableTruncate () | Do not allow truncating the action. |
| HumanoidAction:setAfterUse (after_use) | Set the callback for performing updates afterwards. |
| HumanoidAction:setCount (count) | Set the number of times the action should happen. |
| HumanoidAction:setIsLeaving (is_leaving) | Set whether the humanoid is leaving. |
| HumanoidAction:setLoopCallback (loop_callback) | Set the callback for checking termination conditions. |
| HumanoidAction:setMustHappen (must_happen) | Set the 'must happen' flag (that is, action cannot be skipped). |
Functions
- HumanoidAction:HumanoidAction (name)
-
Construct a humanoid action (base class constructor).
Parameters:
- name (str) Name of the action.
- HumanoidAction:disableTruncate ()
-
Do not allow truncating the action.
Returns:
-
(action) Returning self, for daisy-chaining.
- HumanoidAction:setAfterUse (after_use)
-
Set the callback for performing updates afterwards.
Parameters:
- after_use (func) Callback function that is called after the action ends.
Returns:
-
(action) Returning self, for daisy-chaining.
- HumanoidAction:setCount (count)
-
Set the number of times the action should happen.
Parameters:
- count (int or nil) Set to 'nil' if 'forever', else integer count.
Returns:
-
(action) Returning self, for daisy-chaining.
- HumanoidAction:setIsLeaving (is_leaving)
-
Set whether the humanoid is leaving.
Parameters:
- is_leaving (bool) Whether or not the humanoid is leaving. If not specified, value is true.
Returns:
-
(action) Returning self, for daisy-chaining.
- HumanoidAction:setLoopCallback (loop_callback)
-
Set the callback for checking termination conditions.
Parameters:
- loop_callback (func) Callback function that is called each iteration to check for termination conditions.
Returns:
-
(action) Returning self, for daisy-chaining.
- HumanoidAction:setMustHappen (must_happen)
-
Set the 'must happen' flag (that is, action cannot be skipped).
Parameters:
- must_happen (bool) Whether or not the action must happen.
Returns:
-
(action) Returning self, for daisy-chaining.