Skip to content

Commit

Permalink
Make sure level scaling is applied in OnLoad.
Browse files Browse the repository at this point in the history
See #112.
  • Loading branch information
Verteiron committed Jan 3, 2015
1 parent 0ac495e commit 18e7c9b
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions dist/Data/scripts/Source/vMYC_CharacterDummyActorScript.psc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Event OnLoad()
SetNINodes()
CheckArmor()
CheckWeapons()

SetAutolevelOptions()
;Extra stuff to make sure NPC responds when activated
BlockActivation(False)
_bWarnedVoiceTypeNoFollower = False
Expand Down Expand Up @@ -746,17 +746,7 @@ Function SetNonpersistent()
EndIf
EndIf
SetFactions()
If !CharacterManager.GetCharacterForm(CharacterName,"Class")
If CharacterManager.GetLocalInt(CharacterName,"DisableAutoLevel") == 1
SetCustomActorValues(False)
ElseIf GetConfigBool("AUTOLEVEL_CHARACTERS")
SetCustomActorValues(True)
EndIf
Else
Debug.Trace("MYC/Actor/" + CharacterName + ": has an assigned class, ignoring saved actor values!")
AddItem(vMYC_DummyArmor, 1, true)
RemoveItem(vMYC_DummyArmor, 1)
EndIf
SetAutolevelOptions()
SetAV("Confidence",3)
SetAV("Assistance",2)
;Force stat recalc
Expand Down Expand Up @@ -855,6 +845,20 @@ Function SetFactions()
EndIf
EndFunction

Function SetAutolevelOptions()
If GetConfigBool("AUTOLEVEL_CHARACTERS") || CharacterManager.GetLocalInt(CharacterName,"DisableAutoLevel") == 0
SetCustomActorValues(True)
Else
If CharacterManager.GetCharacterForm(CharacterName,"Class")
Debug.Trace("MYC/Actor/" + CharacterName + ": has an assigned class, ignoring saved actor values and recalculating!")
AddItem(vMYC_DummyArmor, 1, true)
RemoveItem(vMYC_DummyArmor, 1)
Else
SetCustomActorValues(False)
EndIf
EndIf
EndFunction

Function UpdateCombatStyle()
If IsDisabled()
Debug.Trace("MYC/Actor/" + CharacterName + ": UpdateCombatStyle was called but actor is disabled so we can't get weapon type. Try again later!")
Expand Down Expand Up @@ -1190,6 +1194,7 @@ Function SetCustomActorValues(Bool bScaleToLevel = False)
If sAVNames[i]
Float fAV = CharacterManager.GetCharacterAV(CharacterName,sAVNames[i])
SetActorValue(sAVName,fAV As Int)
Debug.Trace("MYC: (" + CharacterName + ") Set dummy's " + sAVName + " to " + fAV)
EndIf
EndWhile
EndIf
Expand Down

0 comments on commit 18e7c9b

Please sign in to comment.