[Messy Script] Lift Controls & DisablePlayerControls

Post » Sat Nov 17, 2012 2:45 am

I know my way around scripts and understand them but doing them myself they end up getting all messy and sometimes work, then i think i can improve it so i do and then it doesn't work...

So here is a messy script of mine using translatetoref to move a moveable platform so that i can make it a lift, i had it working so when you enter the place you are on the lift and 5 secs later it disables the player controls so they can move and then the lift goes down, that was working fine, but then i had to make it go up, do i had to redo the code so lines don't conflict and now i have made it all messy and it doesn't work....

The main problem is that it doesn't seem to complete its transition, although the lift stops the player controls are still disabled.

if anyone is kind enough to redo or help me out with me script to its tidier and works i would be grateful.
Scriptname SLD_LiftLoad extends ObjectReferenceimport gameimport debugObjectReference Property Lift  AutoObjectReference Property Liftup  AutoObjectReference Property Liftdown  AutoObjectReference Property AutoDoor Auto;************************************auto State waitingEvent OnCellLoad()  Lift.MoveTo(Liftup)  Utility.Wait(5)  Self.Disable()  Game.DisablePlayerControls(true, true, true, false, true, false, true)  Lift.TranslateToRef(Liftdown, 80.0, 0.0)   gotostate("BusyDown")endEVENTEvent onTriggerEnter(objectReference triggerRef)   Lift.MoveTo(Liftdown)  AutoDoor.disable()  self.Disable()  Utility.Wait(2)  Game.DisablePlayerControls(true, true, true, false, true, false, true)  Lift.TranslateToRef(Liftup, 80.0, 0.0)   gotostate("BusyUp")endEventendStateState BusyDownEvent OnTranslationComplete()  Lift.StopTranslation()Game.EnablePlayerControls()Lift.MoveTo(Liftdown)Utility.Wait(5)self.enable()gotostate("Waiting")EndEventendStatestate BusyUpevent OnTranslationComplete()  Lift.StopTranslation()  self.enable()Game.EnablePlayerControls()Lift.MoveTo(Liftup)AutoDoor.enable()gotostate("Waiting")EndEventendState
(P.S. For some reason the forum doesn't keep Tab and Returns in coping over text, it is Tabed in my script though)
User avatar
Elisha KIng
 
Posts: 3285
Joined: Sat Aug 18, 2007 12:18 am

Return to V - Skyrim