enderalse/source/scripts/_00e_akropolisfloatingstonescript.psc

106 lines
2.7 KiB
Plaintext

Scriptname _00E_AkropolisFloatingStoneScript extends ObjectReference
;=====================================================================================
; EVENTS
;=====================================================================================
Event OnCellAttach()
If self.Is3DLoaded()
Self.MoveTo(GetLinkedRef())
StartAngleX = Self.GetAngleX()
StartAngleY = Self.GetAngleY()
StartAngleZ = Self.GetAngleZ()
NextMarker = Self.GetLinkedRef()
FloatToMarker(NextMarker)
EndIf
EndEvent
Event OnTranslationAlmostComplete()
NextMarker = NextMarker.GetLinkedRef()
FloatToMarker(NextMarker)
EndEvent
;=====================================================================================
; FUNCTIONS
;=====================================================================================
Function FloatToMarker(ObjectReference MarkerTo)
SetRotationAngles()
MarkerTo.SetAngle(AngleX, AngleY, AngleZ)
Self.TranslateToRef(MarkerTo, MovementSpeed, RotationSpeed)
EndFunction
Function SetRotationAngles()
if Positive
if Config_RotateX
AngleX = (Self.GetAngleX() + 180)
Elseif !(Config_RotateX)
AngleX = StartAngleX
EndIf
if Config_RotateY
AngleY = (Self.GetAngleY() + 180)
Elseif !(Config_RotateY)
AngleY = StartAngleY
EndIf
if Config_RotateZ
AngleZ = (Self.GetAngleZ() + 180)
Elseif !(Config_RotateZ)
AngleZ = StartAngleZ
EndIf
Positive = False
ElseIf !(Positive)
if Config_RotateX
AngleX = (Self.GetAngleX() - 180)
Elseif !(Config_RotateX)
AngleX = StartAngleX
EndIf
if Config_RotateY
AngleY = (Self.GetAngleY() - 180)
Elseif !(Config_RotateY)
AngleY = StartAngleY
EndIf
if Config_RotateZ
AngleZ = (Self.GetAngleZ() - 180)
Elseif !(Config_RotateZ)
AngleZ = StartAngleZ
EndIf
Positive = true
EndIf
EndFunction
;=====================================================================================
; PROPERTIES
;=====================================================================================
float StartAngleX
float StartAngleY
float StartAngleZ
float AngleX
float AngleY
float AngleZ
float Property RotationSpeed = 30.0 Auto
{The rotation speed of the floating objects. Default: 30}
float Property MovementSpeed = 15.0 Auto
{The movement speed of the floating objects. Default: 15}
bool Property Config_RotateX = True Auto
{Shall the object rotate around the X-Axis?}
bool Property Config_RotateY = True Auto
{Shall the object rotate around the Y-Axis?}
bool Property Config_RotateZ = True Auto
{Shall the object rotate around the Z-Axis?}
bool Positive = True
ObjectReference Property NextMarker Auto Hidden