Osiris/Shared/ProcCharacterMoveTo: Difference between revisions

From Divinity Engine Wiki
Jump to navigation Jump to search
mNo edit summary
(Document QueryOnlyOnce)
Line 1: Line 1:
===== Full Definition(s) =====
===== Full Definition(s) =====
* PROC '''ProcCharacterMoveTo'''(''(CHARACTERGUID)'''''_Char''',''(GUIDSTRING)'''''_Point''',''(INTEGER)'''''_Running''',''(STRING)'''''_Event''')
* query '''QueryOnlyOnce'''(''(STRING)'''''_OnlyOnceUUID''')
===== Description =====
===== Description =====
This is a wrapper around the '''CharacterMoveTo''' API call that takes care of interactions with various other behaviours. A.o.,
Helper to ensure a rule gets executed only once.
 
* It disables all dialogs while the character is moving.
* It disables all reactions to crimes while the character is moving.
* If the move is interrupted in one way or another, the character will resume moving after the interruption
===== Return Values =====
===== Return Values =====
* /
* '''Success/Failure''': Fails if '''QueryOnlyOnce''' was previously called with '''_OnlyOnceUUID''' as parameter, otherwise succeeds.
===== Notes =====
===== Notes =====
* If you wish to abort a move initiated this way, in addition to calling [[Osiris/API/CharacterPurgeQueue|CharacterPurgeQueue]], you also have to call [[Osiris/Shared/ProcClearMovingFacts|ProcClearMovingFacts]]. This will restore all of the suspended behaviours and prevent the resumption of the movement at a later moment.
* This query defines '''DB_OnlyOnce(_OnlyOnceUUID)''', so you can test that afterwards to determine whether this query has been executed already.
* Preferably always use this routine or [[Osiris/Shared/ProcStateManagerCharacterMoveTo|ProcStateManagerCharacterMoveTo]] instead of [[Osiris/API/CharacterMoveTo|CharacterMoveTo]]
===== Example =====
IF
GameStarted("TUT_Tutorial_A",_)
AND
QueryOnlyOnce("FTJ_IfanStoryInit_TUT")
THEN
ItemToInventory(ITEMGUID_S_FTJ_IfanNoteFromDarkFaction_51899f0f-6ea2-4522-893b-69ccd87b97fb,CHARACTERGUID_S_Player_Ifan_ad9a3327-4456-42a7-9bf4-7ad60cc9e54f,-1,0);
===== See Also =====
===== See Also =====
* [[Osiris/API/CharacterMoveTo|CharacterMoveTo]]
/
* Helper [[Osiris/Shared/ProcStateManagerCharacterMoveTo|ProcStateManagerCharacterMoveTo]]
 
[[Category:Osiris Queries]]
[[Category:Osiris Shared Mod Helpers]]

Revision as of 18:58, 12 October 2017

Full Definition(s)
  • query QueryOnlyOnce((STRING)_OnlyOnceUUID)
Description

Helper to ensure a rule gets executed only once.

Return Values
  • Success/Failure: Fails if QueryOnlyOnce was previously called with _OnlyOnceUUID as parameter, otherwise succeeds.
Notes
  • This query defines DB_OnlyOnce(_OnlyOnceUUID), so you can test that afterwards to determine whether this query has been executed already.
Example
IF
GameStarted("TUT_Tutorial_A",_)
AND
QueryOnlyOnce("FTJ_IfanStoryInit_TUT")
THEN
ItemToInventory(ITEMGUID_S_FTJ_IfanNoteFromDarkFaction_51899f0f-6ea2-4522-893b-69ccd87b97fb,CHARACTERGUID_S_Player_Ifan_ad9a3327-4456-42a7-9bf4-7ad60cc9e54f,-1,0);
See Also

/