ModObjectiveGlobal - Quest: Difference between revisions

Jump to navigation Jump to search
m
Convert source tags to syntaxhighlight
imported>Lisselli
m (→‎Syntax: changed value to GetValue() to make the function a little faster.)
m (Convert source tags to syntaxhighlight)
 
Line 6: Line 6:


== Syntax ==
== Syntax ==
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
bool Function ModObjectiveGlobal(float afModValue, GlobalVariable aModGlobal, int aiObjectiveID = -1, float afTargetValue = -1.0, \
bool Function ModObjectiveGlobal(float afModValue, GlobalVariable aModGlobal, int aiObjectiveID = -1, float afTargetValue = -1.0, \
   bool abCountingUp = true, bool abCompleteObjective = true, bool abRedisplayObjective = true)
   bool abCountingUp = true, bool abCompleteObjective = true, bool abRedisplayObjective = true)
Line 34: Line 34:
return false
return false
endFunction
endFunction
</source>
</syntaxhighlight>


== Parameters ==
== Parameters ==
Line 54: Line 54:


== Examples ==
== Examples ==
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
; Adds 1 to MyGlobal
; Adds 1 to MyGlobal
MyQuest.ModObjectiveGlobal(1, MyGlobal)
MyQuest.ModObjectiveGlobal(1, MyGlobal)
</source>
</syntaxhighlight>
<br>
<br>
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
; Adds 1 to MyGlobal, updates objective 10
; Adds 1 to MyGlobal, updates objective 10
MyQuest.ModObjectiveGlobal(1, MyGlobal, 10)
MyQuest.ModObjectiveGlobal(1, MyGlobal, 10)
</source>
</syntaxhighlight>
<br>
<br>
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
; adds 1 to ExteriorDefenderDeadCount, updates objective 30, sets stage 60 when it reaches ExteriorDefenderTotal
; adds 1 to ExteriorDefenderDeadCount, updates objective 30, sets stage 60 when it reaches ExteriorDefenderTotal
if MyQuest.ModObjectiveGlobal(1, ExteriorDefenderDeadCount, 30, ExteriorDefenderTotal.value)
if MyQuest.ModObjectiveGlobal(1, ExteriorDefenderDeadCount, 30, ExteriorDefenderTotal.value)
   SetStage(60)
   SetStage(60)
endif
endif
</source>
</syntaxhighlight>


== See Also ==
== See Also ==
*[[Quest Script]]
*[[Quest Script]]
*[[UpdateCurrentInstanceGlobal - Quest]]
*[[UpdateCurrentInstanceGlobal - Quest]]

Navigation menu