Difference between revisions of "User talk:Lisselli"
Jump to navigation
Jump to search
imported>Lisselli |
imported>Lisselli |
||
Line 2: | Line 2: | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
Function AdvanceSkillEx(String asSkillName, Float afValue, Int aiClampValue=0) | |||
if (bLockLevel == true) | |||
; Let's say Player is level 50. This variable will store that. | |||
CurrentPlayerLevel = PlayerRef.GetLevel() | |||
debug.notification("CurrentPlayerLevel: " +CurrentPlayerLevel) | |||
; Lock this level so its not updated, UNLESS the player levels up and becomes higher than this value. | |||
else | |||
CurrentPlayerLevel = PlayerRef.GetLevel() | |||
bLockLevel = true | |||
endif | |||
;If the player is still level 50. Keep counting the times advance skill was called. | |||
if CurrentPlayerLevel == PlayerRef.GetLevel() | |||
;If the | |||
if | |||
if iCount != aiClampValue | if iCount != aiClampValue | ||
Game.AdvanceSkill(asSkillName, afValue) | Game.AdvanceSkill(asSkillName, afValue) | ||
iCount += 1 | iCount += 1 | ||
debug.notification("iCount: " +iCount) | |||
; Everytime advanceskill is called, iCount goes up until it reaches the clamp value. | ; Everytime advanceskill is called, iCount goes up until it reaches the clamp value. | ||
endif | endif | ||
endif | endif | ||
EndFunction | EndFunction | ||
</source> | </source> |
Revision as of 14:48, 6 November 2016
Sandbox Page for when I need to post code on the forums. Because it doesn't allow indention..
Function AdvanceSkillEx(String asSkillName, Float afValue, Int aiClampValue=0)
if (bLockLevel == true)
; Let's say Player is level 50. This variable will store that.
CurrentPlayerLevel = PlayerRef.GetLevel()
debug.notification("CurrentPlayerLevel: " +CurrentPlayerLevel)
; Lock this level so its not updated, UNLESS the player levels up and becomes higher than this value.
else
CurrentPlayerLevel = PlayerRef.GetLevel()
bLockLevel = true
endif
;If the player is still level 50. Keep counting the times advance skill was called.
if CurrentPlayerLevel == PlayerRef.GetLevel()
if iCount != aiClampValue
Game.AdvanceSkill(asSkillName, afValue)
iCount += 1
debug.notification("iCount: " +iCount)
; Everytime advanceskill is called, iCount goes up until it reaches the clamp value.
endif
endif
EndFunction