Difference between revisions of "Osiris/Shared/ProcStateManagerCharacterMoveTo"

From Divinity Engine Wiki
Jump to: navigation, search
m
m (ProcStateManagerCharacterMoveTo does not force-synch by default, but does have implicit support for it via a variable.)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
===== Full Definition(s) =====
 
===== Full Definition(s) =====
* PROC '''ProcStateManagerCharacterMoveTo'''(''(CHARACTERGUID)'''''_Char''',''(GUIDSTRING)'''''_Destination''',''(INTEGER)'''''_Running''',''(REAL)'''''_MaxDist''',''(STRING)'''''_Event''',''(STRING)'''''_AfterArrivalState''')
+
* PROC '''ProcStateManagerCharacterMoveTo'''(''(CHARACTERGUID)'''''_Char''', ''(GUIDSTRING)'''''_Destination''', ''(INTEGER)'''''_Running''', ''(REAL)'''''_MaxDist''', ''(STRING)'''''_Event''', ''(STRING)'''''_AfterArrivalState''')
 
===== Description =====
 
===== Description =====
 
Uses a behaviour script's ''CharacterMoveTo'' to move '''_Char''' to '''_Destination''' (can be a character, item or trigger). '''_Running''' can be 0 or 1 to indicate walking resp. running. '''_MaxDist''' indicates the maximum distance between '''_Char''' and '''_Destination''' before the routine can assume that '''_Char''' has arrived. If '''_Event''' is a non-empty string, a Character Event will be raised for '''_Char''' once it arrives. '''_AfterArrivalState''' specifies the state to which the character should go when it arrives (can be an empty string to disable the state manager afterwards).
 
Uses a behaviour script's ''CharacterMoveTo'' to move '''_Char''' to '''_Destination''' (can be a character, item or trigger). '''_Running''' can be 0 or 1 to indicate walking resp. running. '''_MaxDist''' indicates the maximum distance between '''_Char''' and '''_Destination''' before the routine can assume that '''_Char''' has arrived. If '''_Event''' is a non-empty string, a Character Event will be raised for '''_Char''' once it arrives. '''_AfterArrivalState''' specifies the state to which the character should go when it arrives (can be an empty string to disable the state manager afterwards).
Line 8: Line 8:
 
* This routine requires that the ''State_Manager_GoTo'' character script has been assigned to '''_Char'''
 
* This routine requires that the ''State_Manager_GoTo'' character script has been assigned to '''_Char'''
 
* This routine can be used instead of the regular [[Osiris/Shared/ProcCharacterMoveTo|ProcCharacterMoveTo]] if you want a character to join combats it encounters on its way.
 
* This routine can be used instead of the regular [[Osiris/Shared/ProcCharacterMoveTo|ProcCharacterMoveTo]] if you want a character to join combats it encounters on its way.
 +
* If you wish to [[Osiris/API/CharacterSetForceUpdate|force update]] for the character while it is walking, so it will work even if no players are nearby, [[Osiris/API/SetVarInteger|set the ForceSynchWhileMoving integer variable]] of '''_Char''' to 1 before calling this routine (it will be set to 0 again once the move has finished, and force updating will also stop at that moment).
 
* Preferably always use this routine or [[Osiris/Shared/ProcCharacterMoveTo|ProcCharacterMoveTo]] instead of [[Osiris/API/CharacterMoveTo|CharacterMoveTo]]
 
* Preferably always use this routine or [[Osiris/Shared/ProcCharacterMoveTo|ProcCharacterMoveTo]] instead of [[Osiris/API/CharacterMoveTo|CharacterMoveTo]]
 +
 
===== See Also =====
 
===== See Also =====
 
* [[Osiris/API/CharacterMoveTo|CharacterMoveTo]]
 
* [[Osiris/API/CharacterMoveTo|CharacterMoveTo]]
 
* Helper [[Osiris/Shared/ProcCharacterMoveTo|ProcCharacterMoveTo]]
 
* Helper [[Osiris/Shared/ProcCharacterMoveTo|ProcCharacterMoveTo]]
  
[[Category:Osiris Shared Mod Helpers]]
+
[[Category:Osiris Shared Mod Helpers|StateManagerCharacterMoveTo]]

Latest revision as of 11:09, 13 April 2018

Full Definition(s)
  • PROC ProcStateManagerCharacterMoveTo((CHARACTERGUID)_Char, (GUIDSTRING)_Destination, (INTEGER)_Running, (REAL)_MaxDist, (STRING)_Event, (STRING)_AfterArrivalState)
Description

Uses a behaviour script's CharacterMoveTo to move _Char to _Destination (can be a character, item or trigger). _Running can be 0 or 1 to indicate walking resp. running. _MaxDist indicates the maximum distance between _Char and _Destination before the routine can assume that _Char has arrived. If _Event is a non-empty string, a Character Event will be raised for _Char once it arrives. _AfterArrivalState specifies the state to which the character should go when it arrives (can be an empty string to disable the state manager afterwards).

Return Values
  • /
Notes
  • This routine requires that the State_Manager_GoTo character script has been assigned to _Char
  • This routine can be used instead of the regular ProcCharacterMoveTo if you want a character to join combats it encounters on its way.
  • If you wish to force update for the character while it is walking, so it will work even if no players are nearby, set the ForceSynchWhileMoving integer variable of _Char to 1 before calling this routine (it will be set to 0 again once the move has finished, and force updating will also stop at that moment).
  • Preferably always use this routine or ProcCharacterMoveTo instead of CharacterMoveTo
See Also