CMultiStateMoverPosition

From The DarkMod Wiki
Jump to navigationJump to search

CMultiStateMoverPosition

The corresponding entityDefs is atdm:mover_multistate_position.

Defines a position for a multistate mover entity. Must be targetted by the multistate mover, so that the mover knows which positions to associate with at spawn time.

The CMultiStateMoverPosition also knows which func_aas_obstacle entities to activate/deactivate when the mover arrives or leaves.

Spawnargs

  • position (string) The name of the position, e.g. "second_floor"
  • call_on_leave (local script function) Specifies which scriptobject function should be called when the multistatemover leaves this position.
  • call_on_arrive (local script function) Specifies which scriptobject function should be called when the multistatemover arrives at this position.
  • always_trigger_targets (1/0) If set to 1 the position entity will trigger its targets, when the multistatemover arrives or leaves (default is 1). Set this to 0 to let the scriptfunctions handle the triggering.

Script Events

  • <no special script events>

C++ Methods and Events

CMultiStateMoverButton* GetFetchButton();
returns the fetch button for this elevator position. Used by AI to know which button to press.
CMultiStateMoverButton* GetRideButton(CMultiStateMoverPosition* toPosition);
Returns the button entity which can be used to move the associated elevator to the given 'toPosition'. Used by AI to find out which button to press when standing on an elevator.
virtual void OnMultistateMoverArrive(CMultiStateMover* mover);
virtual void OnMultistateMoverLeave(CMultiStateMover* mover);
These two events are called when the multistate mover leaves/arrives the position.