Difference between revisions of "UpdateCurrentInstanceGlobal - Quest"

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search
imported>Plplecuyer
 
imported>Docclox
m (→‎Examples: Re-wrote the cut-and-pasted comment as it didn't make any sense in the context of the example given.)
 
Line 18: Line 18:
== Examples ==
== Examples ==
<source lang="papyrus">
<source lang="papyrus">
; Sets the side quest stage to 10 - and logs a message if it succeeds
; Attempts to update the current instance of the GameHour global variable - and logs a message if it fails
if (!UpdateCurrentInstanceGlobal(GameHour))
if (!UpdateCurrentInstanceGlobal(GameHour))
   Debug.Trace("Failed to update GameHour value for quest")
   Debug.Trace("Failed to update GameHour value for quest")

Latest revision as of 18:49, 23 April 2018

Member of: Quest Script

Attempts to update the stored value of the given global in the instance data for the quest's current instance. The function only returns false on failure which can be caused by calling the function when there is no active instance on the quest or by passing a global not in the quest's text global list.

Syntax[edit | edit source]

bool Function UpdateCurrentInstanceGlobal(GlobalVariable aUpdateGlobal) native

Parameters[edit | edit source]

  • aUpdateGlobal: The global on the quest whose cached value should be reset to its current value.

Return Value[edit | edit source]

True, if the global value is successfully updated, false if it is not.

Examples[edit | edit source]

; Attempts to update the current instance of the GameHour global variable - and logs a message if it fails
if (!UpdateCurrentInstanceGlobal(GameHour))
  Debug.Trace("Failed to update GameHour value for quest")
endIf

See Also[edit | edit source]