Enderal SE https://mod.pub/enderal-se/38-enderal-se
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
780 B
14 lines
780 B
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
|
|
|