ModObjectiveGlobal - Quest: Difference between revisions
Jump to navigation
Jump to search
→Syntax
imported>Thingy Person (→Syntax: This is a non-native function, so why not put the whole thing here?) |
imported>Thingy Person (→Syntax) |
||
| Line 7: | Line 7: | ||
== Syntax == | == Syntax == | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
bool Function ModObjectiveGlobal(float afModValue, GlobalVariable aModGlobal, int aiObjectiveID = -1, float afTargetValue = -1.0, bool abCountingUp = true, bool abCompleteObjective = true, bool abRedisplayObjective = true) | bool Function ModObjectiveGlobal(float afModValue, GlobalVariable aModGlobal, int aiObjectiveID = -1, float afTargetValue = -1.0, bool abCountingUp = true, | ||
bool abCompleteObjective = true, bool abRedisplayObjective = true) | |||
aModGlobal.Mod(afModValue) | aModGlobal.Mod(afModValue) | ||
UpdateCurrentInstanceGlobal(aModGlobal) | UpdateCurrentInstanceGlobal(aModGlobal) | ||
if aiObjectiveID >= 0 | if aiObjectiveID >= 0 | ||
if afTargetValue > -1 | if afTargetValue > -1 | ||
if (abCountingUp && aModGlobal.value >= afTargetValue) || (!abCountingUp && aModGlobal.value <= afTargetValue) | if (abCountingUp && aModGlobal.value >= afTargetValue) || (!abCountingUp && aModGlobal.value <= afTargetValue) | ||
if (abCompleteObjective) | if (abCompleteObjective) | ||
SetObjectiveCompleted(aiObjectiveID) | SetObjectiveCompleted(aiObjectiveID) | ||
return true | return true | ||
Else | Else | ||
SetObjectiveFailed(aiObjectiveID) | SetObjectiveFailed(aiObjectiveID) | ||
return true | return true | ||
Endif | Endif | ||
elseIf (abRedisplayObjective) | elseIf (abRedisplayObjective) | ||
SetObjectiveDisplayed(aiObjectiveID, true, true) | SetObjectiveDisplayed(aiObjectiveID, true, true) | ||
Else | Else | ||
| Line 30: | Line 27: | ||
endif | endif | ||
elseIf (abRedisplayObjective) | elseIf (abRedisplayObjective) | ||
SetObjectiveDisplayed(aiObjectiveID, true, true) | SetObjectiveDisplayed(aiObjectiveID, true, true) | ||
Else | Else | ||