Difference between revisions of "Osiris/API/CharacterMoveToPosition"
From Divinity Engine Wiki
m |
|||
(6 intermediate revisions by 2 users not shown) | |||
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'''. | + | 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. | ||
− | + | * If the path to the destination is blocked somewhere, '''_Character''' will immediately teleport 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. | ||
+ | * Multiple movements started using [[Osiris/API/CharacterMoveTo|CharacterMoveTo]] or this routine the same character will be queued: once the previous movement ends, the next one will start immediately. | ||
+ | * Aborting a movement in progress can be done using [[Osiris/API/CharacterPurgeQueue|CharacterPurgeQueue]]. Similarly, [[Osiris/API/CharacterFlushQueue|CharacterFlushQueue]] will force-complete the character's current movement, by teleporting it to its current movement task's destination. | ||
+ | * Use [[Osiris/Shared/ProcCharacterMoveTo|ProcCharacterMoveTo]] to avoid the problems mentioned above and several others, except for not participating in combat. | ||
+ | * Use [[Osiris/Shared/ProcStateManagerCharacterMoveTo|ProcStateManagerCharacterMoveTo]] if you also want the character to join combats it encounters on its way. | ||
+ | * Use [[Osiris/API/CharacterLookFromTrigger|CharacterLookFromTrigger]] or [[Osiris/API/CharacterLookAt|CharacterLookAt]] if the character needs to look in a specific direction upon arrival. | ||
===== See Also ===== | ===== See Also ===== | ||
+ | * [[Osiris/API/CharacterFlushQueue|CharacterFlushQueue]] | ||
* [[Osiris/API/CharacterMoveTo|CharacterMoveTo]] | * [[Osiris/API/CharacterMoveTo|CharacterMoveTo]] | ||
− | * [[Osiris/API/ | + | * [[Osiris/API/CharacterPurgeQueue|CharacterPurgeQueue]] |
− | * [[Osiris/API/ | + | * [[Osiris/API/ItemMoveToPosition|ItemMoveToPosition]] |
+ | * [[Osiris/API/StoryEvent|StoryEvent]] | ||
+ | * [[Osiris/API/TeleportToPosition|TeleportToPosition]] | ||
+ | * Helper [[Osiris/Shared/ProcCharacterMoveTo|ProcCharacterMoveTo]] | ||
+ | * Helper [[Osiris/Shared/ProcStateManagerCharacterMoveTo|ProcStateManagerCharacterMoveTo]] | ||
[[Category:Osiris Calls|CharacterMoveToPosition]] | [[Category:Osiris Calls|CharacterMoveToPosition]] |
Latest revision as of 12:18, 1 December 2018
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.
- If the path to the destination is blocked somewhere, _Character will immediately teleport 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.
- Multiple movements started using CharacterMoveTo or this routine the same character will be queued: once the previous movement ends, the next one will start immediately.
- Aborting a movement in progress can be done using CharacterPurgeQueue. Similarly, CharacterFlushQueue will force-complete the character's current movement, by teleporting it to its current movement task's destination.
- 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.
- Use CharacterLookFromTrigger or CharacterLookAt if the character needs to look in a specific direction upon arrival.