ESCActionManager
Extends: Resource
Description
Manages actions currently being carried out.
Constants
AWAITING_VERB_OR_ITEM
const AWAITING_VERB_OR_ITEM = 0 # enum "ActionInputState"
Initial state
AWAITING_ITEM
const AWAITING_ITEM = 1 # enum "ActionInputState"
After initial state, verb is defined
AWAITING_TARGET_ITEM
const AWAITING_TARGET_ITEM = 2 # enum "ActionInputState"
Item defined requires a target object
AWAITING_VERB
const AWAITING_VERB = 3 # enum "ActionInputState"
After initial state, item is defined
AWAITING_VERB_CONFIRMATION
const AWAITING_VERB_CONFIRMATION = 4 # enum "ActionInputState"
Item was defined first, next verb, need verb confirmation
COMPLETED
const COMPLETED = 5 # enum "ActionInputState"
Final state
BACKGROUND_CLICK
const BACKGROUND_CLICK = 0 # enum "ACTION"
ITEM_LEFT_CLICK
const ITEM_LEFT_CLICK = 1 # enum "ACTION"
ITEM_RIGHT_CLICK
const ITEM_RIGHT_CLICK = 2 # enum "ACTION"
TRIGGER_IN
const TRIGGER_IN = 3 # enum "ACTION"
TRIGGER_OUT
const TRIGGER_OUT = 4 # enum "ACTION"
ESCPlayer
const ESCPlayer = <Object>
ESCPlayer resource
ACTION_ARRIVED
const ACTION_ARRIVED = "arrived"
Action (event) triggered when a character has reached a destination.
ACTION_EXIT_SCENE
const ACTION_EXIT_SCENE = "exit_scene"
Action (event) triggered when a scene is being exited.
ACTION_WALK
const ACTION_WALK = "walk"
Action (event) triggered when a character is walking.
Members
current_action
var current_action: String
Current verb used.
current_tool
var current_tool: ESCObject
Current tool (ESCItem/ESCInventoryItem) used.
current_target
var current_target: ESCObject
Current target where the tool is being used on/with (if any).
action_state
var action_state: Variant
Current action input state.
Signals
action_changed
signal action_changed()
The current action verb was changed.
Parameters
None.
action_finished
signal action_finished()
Emitted when an action has been completed.
Parameters
None.
action_input_state_changed
signal action_input_state_changed()
Emitted when the action input state has changed.
Parameters
None.
Methods
do
func do(action: int, params: Array, can_interrupt: bool) -> void
Runs a generic action.
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
action |
|
type of the action to run |
yes |
params |
|
Parameters for the action |
no |
can_interrupt |
|
if true, this command will interrupt any ongoing event before it is finished BACKGROUND_CLICK [moving_obj, target, walk_fast] ITEM_LEFT_CLICK [item, input_event] ITEM_RIGHT_CLICK [item, input_event] TRIGGER_IN [trigger_id, object_id, trigger_in_verb] TRIGGER_OUT [trigger_id, object_id, trigger_out_verb] |
no |
Returns
Returns nothing.
set_action_input_state
func set_action_input_state(p_state: Variant) -> void
Sets the current state of action input. ## Parameters
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
p_state |
|
the action input state to set |
yes |
Returns
Returns nothing.
set_current_action
func set_current_action(action: String) -> void
Sets the current action verb.
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
action |
|
the action verb to set |
yes |
Returns
Returns nothing.
clear_current_action
func clear_current_action() -> void
Clears the current action.
Parameters
None.
Returns
Returns nothing.
clear_current_tool
func clear_current_tool() -> void
Clears the current tool.
Parameters
None.
Returns
Returns nothing.
perform_walk
func perform_walk(moving_obj: ESCObject, destination: Variant, is_fast: bool) -> void
Makes an object walk to a destination. This can be either a 2D position or another object.
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
moving_obj |
|
Escoria object that should move toward the destination. |
yes |
destination |
|
Either a |
yes |
is_fast |
|
Whether to use the object’s fast movement speed when walking. |
no |
Returns
Returns nothing.
perform_inputevent_on_object
func perform_inputevent_on_object(obj: ESCObject, event: InputEvent, default_action: bool) -> void
Event handler called when an object/item is clicked.
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
obj |
|
Object that was left clicked. |
yes |
event |
|
Input event that was received. |
yes |
default_action |
|
If |
no |
Returns
Returns nothing.
is_object_actionable
func is_object_actionable(global_id: String) -> bool
Determines whether the object in question can be acted upon.
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
global_id |
|
The global ID of the item to examine. |
yes |
Returns
Returns a bool value. (bool)