4
Fork 0
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.
 
 
 

92 lines
4.1 KiB

Scriptname _00E_DungeonLiftScript extends ObjectReference
{Place this on a lift platform (and follow the tutorial in the comments!) to make a platform move when a trigger is activated.}
Event OnActivate(ObjectReference akActionRef)
if akActionRef == Game.GetPlayer()
if DisablePlayerControlsDuringRide == True
Game.DisablePlayerControls()
EndIf
if UpDown == 0
LiftMarkerTop.SetAngle(self.GetAngleX(), self.GetAngleY(), self.GetAngleZ())
self.TranslateToRef(LiftMarkerTop, MovementSpeed, 10.0)
ElseIf UpDown == 1
self.TranslateToRef(LiftMarkerBottom, MovementSpeed, 10.0)
LiftMarkerBottom.SetAngle(self.GetAngleX(), self.GetAngleY(), self.GetAngleZ())
EndIf
if doubleclick == False
if MechanicalLift == True
MoveSound = _00E_SternenstadtLifeSoundMarker.Play(Self)
Else
MoveSound = DRSStoneRotatingDiscLPM.Play(Self)
EndIf
doubleclick = True
endif
EndIf
EndEvent
Event OnTranslationAlmostComplete()
if DisablePlayerControlsDuringRide == True
Game.EnablePlayerControls()
EndIf
Sound.StopInstance(MoveSound) ; Stops the loop Sound
if UpDown == 0
UpDown = 1
ElseIf UpDown == 1
UpDown = 0
EndIf
doubleclick = False
EndEvent
int UpDown ; 1 = Lift is at the top, 0 = Lift is at the bottom
int MoveSound
bool doubleclick = False ; True = player is activating while the lift is in
; motion (hence, don't play sound again)
float Property MovementSpeed = 100.0 Auto
{How fast the platform should move - Start at 100.0 and work your way up! 1 is barely visible to the human eye.}
Bool Property DisablePlayerControlsDuringRide Auto
{Should the player controls be disabled once the switch has been hit?}
Bool Property MechanicalLift = False Auto ; Check this if the lift is mechanical
{Set this to true if the lift should play a mechanical sound instead of a "crumbling stone"-sound}
ObjectReference Property LiftMarkerTop Auto
{The X-Marker Reference where the lift will stop moving at the top}
ObjectReference Property LiftMarkerBottom Auto
{The X-Marker Reference where the lift will stop moving at the bottom (Set this XMarker's coordinates to match the platforms coordinates!}
Sound Property DRSStoneRotatingDiscLPM Auto
Sound Property _00E_SternenstadtLifeSoundMarker Auto
;"WICHTIG!
;- Lifte nirgendwo platzieren, wo es GEGNER gibt!
;- KEIN Navmesh auf der Liftplattform , da sich Navmesh nicht mitbewegt! Ergo keine Litftplattformen in Dungeons f<EFBFBD>r Begleiter!
;TUTORIAL ZUM ERSTELLEN BEWEGBARER PLATTFORMEN!
;1.) Sucht das .nif des Objektes, das ihr als Plattform verwenden wollt
;2.) <EFBFBD>ffnet es mit NifSkope
;3.) <EFBFBD>ndert in den bhkRigidBody settings des Objektes folgendes:
; - Layer: OL_STATIC in OL_ANIM_STATIC un<EFBFBD>ndern
; - Layer Copy: OL_STATIC in OL_ANIM_STATIC um<EFBFBD>ndern
; - Motion System: MO_SYS_BOX_STAILIZED in MO_SYS_BOX um<EFBFBD>ndern
;4.) Speichert das .nif ab, unter dem Pfad meshes/Enderal/Dungeons/NameEuresObjektes.nif
;5.) Erstellt ein neues MoveableStatic mit dem Objekt als .nif
;6.) Legt dieses Skript auf die Referenz der Plattform, d.h. geht zu eurem Dungeon, platziert die Plattform, doppelklickt sie und geht zum Tab "Scripts" und f<EFBFBD>gt dieses Skript zu
;7.) Dr<EFBFBD>ckt auf Properties, dr<EFBFBD>ckt Auto-Fill, die Sound-Properties sollte nun gef<EFBFBD>llt sein
;8.) Setzt die "DisablePlayer..." und "MechanicalLift" Properties auf TRUE wenn sie es sein sollen - Das hei<EFBFBD>t, wenn der Spieler sich w<EFBFBD>hrend der Liftfahrt nicht bewegen k<EFBFBD>nnen soll oder der Lift mechanisch ist.
;9.) Wei<EFBFBD>t dem LiftMarkerTop und dem LiftMarkerBottom jeweils zwei XMarker zu, die ihr an den Start und an den Endpunkten des Liftes platziert. Der Liftmarker Bottom sollte GENAU dieselben Koordinaten wie die Liftplattform
; im Ursprungszustand haben
;10.) Nun platziert eine Kette, einen Hebel, oder eine Triggerbox (oder sonst etwas), mit dem der Lift aktiviert werden soll. Nun doppelklickt ihr den Lift und geht zum Tab "ActivateParents". Dort doppelklickt ihr
; und w<EFBFBD>hlt die Kette oder den Hebel aus.
; 11.) Alles sollte klappen. Hurra! :)@"