Moved SetActorScale from _00E_QuestFunctions to a dedicated script to workaround the issue, when users overwrite _00E_QuestFunctions installing outdated mods and break player rescaling
parent
17eda9b80c
commit
4af0bac863
13 changed files with 21 additions and 6 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,14 @@ |
||||
Scriptname _00E_SetActorScale Hidden |
||||
|
||||
Float Function Change(Actor akActor, Float fNewScale) Global |
||||
|
||||
; Sets the scale of akActor to fNewScale and returns the old scale. |
||||
; This is a workaround for GetScale() returning the cumulative scale of Race.Height * Actor.Scale for actors. |
||||
; So it results in a messed up scale if the value returned by GetScale() is used to revert the scale change for an actor whose race has a non-1.00 height (for example, HighElfRace) |
||||
|
||||
Float fOriginalScale = akActor.GetScale() |
||||
akActor.SetScale(fNewScale) |
||||
; Now use the known fNewScale and the return of GetScale() to get the race height coeff, and apply that coeff to fOriginalScale to calculate the true actor's reference scale. |
||||
Return fOriginalScale * fNewScale / akActor.GetScale() |
||||
|
||||
EndFunction |
Loading…
Reference in new issue