Difference between revisions of "Osiris/API/CharacterMoveToPosition"

From Divinity Engine Wiki
Jump to: navigation, search
Line 2: Line 2:
 
* call '''CharacterMoveToPosition'''(''(CHARACTERGUID)'''''_Character''', ''(REAL)'''''_X''', ''(REAL)'''''_Y''', ''(REAL)'''''_Z''',''(INTEGER)'''''_Running''', ''(STRING)'''''_Event''')
 
* call '''CharacterMoveToPosition'''(''(CHARACTERGUID)'''''_Character''', ''(REAL)'''''_X''', ''(REAL)'''''_Y''', ''(REAL)'''''_Z''',''(INTEGER)'''''_Running''', ''(STRING)'''''_Event''')
 
===== Description =====
 
===== Description =====
Makes the character walk (if '''_Running''' is '''0''') or run (if '''_Running''' is '''1''') to ('''_X''', '''_Y''', '''_Z'''). Once the character arrives there, the [[Osiris/API/StoryEvent|event]] '''_Event''' will be sent to '''_Character'''. The movement will ignore combat, meaning it will also move out of turn and if out of AP, and will fallback to a teleport if the character fails to reach that point for any reason.
+
Makes the character walk (if '''_Running''' is '''0''') or run (if '''_Running''' is '''1''') to ('''_X''', '''_Y''', '''_Z'''). Once the character arrives there, the [[Osiris/API/StoryEvent|event]] '''_Event''' will be sent to '''_Character'''. If the '''_Character''' is in combat, they will move out of turn and ignoring remaining AP. If the destination is blocked, the call will fallback to a teleport to the destination or the nearest available position.
 
===== Notes =====
 
===== Notes =====
 
* In practice, the '''_Y''' coordinate will be ignored and the character will snap to the floor at the destination location. If the destination location is not valid on the [[AI_grid|AI grid]], the game will find a nearby valid location on the AI grid and move the character there.
 
* In practice, the '''_Y''' coordinate will be ignored and the character will snap to the floor at the destination location. If the destination location is not valid on the [[AI_grid|AI grid]], the game will find a nearby valid location on the AI grid and move the character there.
 
+
* '''_Character''' will not participate in combats while it is moving.
 +
* If a player starts a conversation with '''_Character''', '''_Character''' will not stop and just keep moving.
 +
* Use '''ProcCharacterMoveTo''' to avoid the problems mentioned above and several others, except for not participating in combat.
 +
* Use '''ProcStateManagerCharacterMoveTo''' if you also want the character to join combats it encounters on its way.
 
===== See Also =====
 
===== See Also =====
 
* [[Osiris/API/StoryEvent|StoryEvent]]
 
* [[Osiris/API/StoryEvent|StoryEvent]]

Revision as of 15:16, 21 December 2017

Full Definition(s)
  • call CharacterMoveToPosition((CHARACTERGUID)_Character, (REAL)_X, (REAL)_Y, (REAL)_Z,(INTEGER)_Running, (STRING)_Event)
Description

Makes the character walk (if _Running is 0) or run (if _Running is 1) to (_X, _Y, _Z). Once the character arrives there, the event _Event will be sent to _Character. If the _Character is in combat, they will move out of turn and ignoring remaining AP. If the destination is blocked, the call will fallback to a teleport to the destination or the nearest available position.

Notes
  • In practice, the _Y coordinate will be ignored and the character will snap to the floor at the destination location. If the destination location is not valid on the AI grid, the game will find a nearby valid location on the AI grid and move the character there.
  • _Character will not participate in combats while it is moving.
  • If a player starts a conversation with _Character, _Character will not stop and just keep moving.
  • Use ProcCharacterMoveTo to avoid the problems mentioned above and several others, except for not participating in combat.
  • Use ProcStateManagerCharacterMoveTo if you also want the character to join combats it encounters on its way.
See Also