Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;### BETA SCRIPT ###
- ;Made By: NoxyGame
- ;Last Edited By: Deapri
- ScriptName _DA_Skyship_v1 Extends ObjectReference
- Import Utility
- Import Debug
- Import Game
- Import Math
- Import Input
- Import Sound
- Import Form
- Import _DA_Skyship_MCM_ConfigMenu_v1
- int Property iDA_Debug = 0 Auto Hidden
- int Property iDA_Armed = 0 Auto Hidden
- int Property iDA_Cruise = 0 Auto Hidden
- int Property iDA_Fly = 0 Auto Hidden
- int Property iDA_Anim = 0 Auto Hidden
- int Property iDA_Beacon = 0 Auto Hidden
- int Property iCruise = 0xC7 Auto Hidden
- int Property iUp = 0x36 Auto Hidden
- int Property iDown = 0x9D Auto Hidden
- int Property iLeft = 0xCB Auto Hidden
- int Property iRight = 0xCD Auto Hidden
- int Property iForward = 0xC8 Auto Hidden
- int Property iBackward = 0xD0 Auto Hidden
- int Property iStrafeLeft = 0xD3 Auto Hidden
- int Property iStrafeRight = 0xD1 Auto Hidden
- int Property iStop = 0x52 Auto Hidden
- int Property iExit = 0x1C Auto Hidden
- int Property iTest = 0xCF Auto Hidden
- int Property iFlyMode = 0 Auto Hidden
- int Property iDASlideFix = 0 Auto Hidden
- Bool Property bFastTravel = True Auto Hidden
- ;### Get the Mapped Keys not to correct on ###
- int Property iDAPCJump Auto Hidden
- int Property iDAPCForward Auto Hidden
- int Property iDAPCBack Auto Hidden
- int Property iDAPCLeft Auto Hidden
- int Property iDAPCRight Auto Hidden
- ;### Engine Power affects Acceleration and max. Velocity ###
- float Property fDefaultUpwardPower = 4500.0 Auto Hidden
- float Property fDefaultDownwardPower = 4000.0 Auto Hidden
- float Property fDefaultForwardPower = 15000.0 Auto Hidden
- float Property fDefaultBackwardPower = 10000.0 Auto Hidden
- float Property fDefaultTurnPower = 100000.0 Auto Hidden
- float Property fDefaultStrafePower = 2000.0 Auto Hidden
- float Property fUpwardPower Auto Hidden
- float Property fDownwardPower Auto Hidden
- float Property fForwardPower Auto Hidden
- float Property fBackwardPower Auto Hidden
- float Property fTurnPower Auto Hidden
- float Property fStrafePower Auto Hidden
- ;### Mass effects Acceleration ###
- float Property fDefaultMass = 8000.0 Auto Hidden
- float Property fDefaultAngularMass = 60000.0 Auto Hidden
- float Property fMass Auto Hidden
- float Property fAngularMass Auto Hidden
- float Property fXZPlaneArea = 415.0 Auto Hidden
- float Property fXYPlaneArea = 880.0 Auto Hidden
- float Property fYZPlaneArea = 805.0 Auto Hidden
- Sound Property sndShipBell Auto
- Sound Property sndShipCreak Auto
- Sound Property sndShipWind Auto
- ;### Location References ###
- ;Location property DevAvezaLocation Auto
- ;### Assigns Object References ###
- ActorBase Property aZCheckFox Auto
- ObjectReference Property rSkyship_Havok Auto
- ObjectReference Property rSkyship_Stopped Auto
- ObjectReference Property rSkyship Auto
- ObjectReference Property rSkyship_Wheel Auto
- ObjectReference Property rSkyship_Marker Auto
- ObjectReference Property rSkyship_Hatch Auto
- ObjectReference Property rSkyship_CreakSND Auto
- ObjectReference Property rSkyship_Plank Auto
- ObjectReference Property rSkyship_Switch_Plank Auto
- ObjectReference Property rSkyship_Light_1 Auto
- ObjectReference Property rSkyship_Light_2 Auto
- ObjectReference Property rSkyship_Light_3 Auto
- ObjectReference Property rSkyship_Light_4 Auto
- ObjectReference Property rSkyship_Light_5 Auto
- ObjectReference Property rSkyship_Light_6 Auto
- ObjectReference Property rSkyship_Light_7 Auto
- ObjectReference Property rSkyship_Switch_Ladder_1 Auto
- ObjectReference Property rSkyship_Ladder_Marker Auto
- ObjectReference Property rSkyship_Ladder_1 Auto
- ObjectReference Property rSkyship_Ladder_2 Auto
- ObjectReference Property rSkyship_Ladder_3 Auto
- ObjectReference Property rSkyship_Ladder_4 Auto
- ObjectReference Property rSkyship_Ladder_5 Auto
- ObjectReference Property rSkyship_Ladder_6 Auto
- ObjectReference Property rSkyship_Ladder_7 Auto
- ObjectReference Property rSkyship_Ladder_8 Auto
- ObjectReference Property rSkyship_Ladder_9 Auto
- ObjectReference Property rSkyship_Ladder_10 Auto
- ObjectReference Property rSkyship_Ladder_11 Auto
- ObjectReference Property rSkyship_Ladder_12 Auto
- ObjectReference Property rSkyship_Ladder_13 Auto
- ObjectReference Property rSkyship_Ladder_14 Auto
- ObjectReference Property rSkyship_Ladder_15 Auto
- ObjectReference Property rSkyship_Ladder_16 Auto
- ObjectReference Property rSkyship_Ladder_17 Auto
- ObjectReference Property rSkyship_Ladder_18 Auto
- ObjectReference Property rSkyship_Ladder_19 Auto
- ObjectReference Property rSkyship_Ladder_20 Auto
- ObjectReference Property rSkyship_Ladder_21 Auto
- ObjectReference Property rSkyship_Ladder_22 Auto
- ObjectReference Property rSkyship_Ladder_23 Auto
- ObjectReference Property rSkyship_Ladder_24 Auto
- ObjectReference Property rSkyship_Ladder_25 Auto
- ObjectReference Property rSkyship_Ladder_26 Auto
- ObjectReference Property rSkyship_Ladder_27 Auto
- ObjectReference Property rSkyship_Ladder_28 Auto
- ObjectReference Property rSkyship_Ladder_29 Auto
- ObjectReference Property rSkyship_Ladder_30 Auto
- ObjectReference Property rSkyship_Ladder_31 Auto
- ObjectReference Property rSkyship_Ladder_32 Auto
- ObjectReference Property rSkyship_Ladder_33 Auto
- ObjectReference Property rSkyship_Ladder_34 Auto
- ObjectReference Property rSkyship_Ladder_35 Auto
- ObjectReference Property rSkyship_Ladder_36 Auto
- ObjectReference Property rSkyship_Ladder_37 Auto
- ObjectReference Property rSkyship_Ladder_38 Auto
- ObjectReference Property rSkyship_Ladder_39 Auto
- ObjectReference Property rSkyship_Ladder_40 Auto
- ObjectReference Property rSkyship_Ladder_41 Auto
- ObjectReference Property rSkyship_Cannon_R1 Auto
- ObjectReference Property rSkyship_Cannon_R2 Auto
- ObjectReference Property rSkyship_Cannon_R3 Auto
- ObjectReference Property rSkyship_Cannon_R4 Auto
- ObjectReference Property rSkyship_Cannon_L1 Auto
- ObjectReference Property rSkyship_Cannon_L2 Auto
- ObjectReference Property rSkyship_Cannon_L3 Auto
- ObjectReference Property rSkyship_Cannon_L4 Auto
- ObjectReference Property rSkyship_Cannon_Bore_R1 Auto
- ObjectReference Property rSkyship_Cannon_Bore_R2 Auto
- ObjectReference Property rSkyship_Cannon_Bore_R3 Auto
- ObjectReference Property rSkyship_Cannon_Bore_R4 Auto
- ObjectReference Property rSkyship_Cannon_Bore_L1 Auto
- ObjectReference Property rSkyship_Cannon_Bore_L2 Auto
- ObjectReference Property rSkyship_Cannon_Bore_L3 Auto
- ObjectReference Property rSkyship_Cannon_Bore_L4 Auto
- ObjectReference Property rSkyship_CannonBall_R1 Auto
- ObjectReference Property rSkyship_CannonBall_R2 Auto
- ObjectReference Property rSkyship_CannonBall_R3 Auto
- ObjectReference Property rSkyship_CannonBall_R4 Auto
- ObjectReference Property rSkyship_CannonBall_L1 Auto
- ObjectReference Property rSkyship_CannonBall_L2 Auto
- ObjectReference Property rSkyship_CannonBall_L3 Auto
- ObjectReference Property rSkyship_CannonBall_L4 Auto
- ;### Assigns Flight Integers ###
- int iFlyModeTemp
- int iLanding
- int iCreakID
- int iWindID
- float fZPosAccelerationCruise
- float fXYPosAccelerationCruise
- float fZAngleAccelerationCruise
- float fXYStrafingAccelerationCruise
- float fXYPosSpeedCruise
- float fZPosSpeedCruise
- float fXYStrafingSpeedCruise
- float fUpwardPowerCruise
- float fDownwardPowerCruise
- float fForwardPowerCruise
- float fBackwardPowerCruise
- float fTurnPowerCruise
- float fStrafePowerCruise
- float fDeltaT
- float fDeltaT2
- float fDeltaTAvg
- float fPrevTime
- float fUnitsPerMeter
- float fXYPosAcceleration
- float fZPosAcceleration
- float fXYStrafingAcceleration
- float fXYPosSpeed
- float fZPosSpeed
- float fXYStrafingSpeed
- float fXYDAPCPosSpeed
- float fZDAPCPosSpeed
- float fXYDAPCStrafingSpeed
- float fXYDAPCSpeedVar
- float fXYPosDelta
- float fZPosDelta
- float fXYStrafingDelta
- float fXPosDest
- float fYPosDest
- float fZPosDest
- float fXDAPCDif
- float fYDAPCDif
- float fZDAPCDif
- float fXPosDistance
- float fYPosDistance
- float fZPosDistance
- float fXDAPCPosDistance
- float fYDAPCPosDistance
- float fZDAPCPosDistance
- float fXYZPosDistance
- float fXYZPosSpeed
- float fXYZDAPCPosDistance
- float fXYZDAPCPosSpeed
- float fZAngleAcceleration
- float fZAngleSpeed
- float fYAngleLocal
- float fZAngleLocal
- float fXAngleDest
- float fYAngleDest
- float fZAngleDest
- float fXDAPCAngleDif
- float fYDAPCAngleDif
- float fZDAPCAngleDif
- float fDAPCDistance
- float Property fDAPCFallMult Auto Hidden
- float fXAngleDistance
- float fYAngleDistance
- float fZAngleDistance
- float fXYZAngleDistance
- float fXYZAngleSpeed
- float sy
- float cy
- float sz
- float cz
- ;### Initialization on Install Script ###
- Event OnInit()
- Notification("Dev Aveza v1.8")
- fUnitsPerMeter = 70
- fUpwardPower = fDefaultUpwardPower
- fDownwardPower = fDefaultDownwardPower
- fForwardPower = fDefaultForwardPower
- fBackwardPower = fDefaultBackwardPower
- fTurnPower = fDefaultTurnPower
- fStrafePower = fDefaultStrafePower
- fMass = fDefaultMass
- fAngularMass = fDefaultAngularMass
- Endevent
- ;### Activation of Flight Script (0 = Attached To Ship 1 = Movable On Deck) ###
- Event OnActivate(ObjectReference akActionRef)
- iDA_Fly = 1
- RegisterForMenu("MapMenu")
- Gotostate("Flying")
- SetGodMode(True)
- iFlyModeTemp = iFlyMode
- If(iFlyModeTemp == 0)
- While(!rSkyship.Is3DLoaded())
- rSkyship.Enable()
- Endwhile
- While(!rSkyShip_Havok.Is3DLoaded())
- rSkyship.MoveTo(rSkyship_Havok)
- rSkyShip_Havok.Enable()
- Endwhile
- GetPlayer().MoveTo(rSkyShip, 0, 0, 100)
- GetPlayer().SetAlpha(0)
- GetPlayer().SetVehicle(rSkyship)
- If (iDA_Debug == 1)
- Trace("Dev Aveza Debug Log: Player Moved to Ship via Activation Function 'Attached to Ship'")
- Endif
- Elseif(iFlyModeTemp == 1)
- While(!rSkyShip.Is3DLoaded())
- rSkyShip.Enable()
- Endwhile
- While(!rSkyShip_Havok.Is3DLoaded())
- rSkyship.MoveTo(rSkyship_Havok)
- rSkyShip_Havok.Enable()
- Endwhile
- rSkyship.MoveTo(rSkyship_Havok)
- GetPlayer().MoveTo(rSkyShip_Havok, 0, 0, 100)
- GetPlayer().MoveToNode(rSkyShip_Havok, "PlayerNode")
- SetGodMode(False)
- fDAPCFallMult = GetGameSettingFloat("fJumpFallHeightMult")
- If (iDA_Debug == 1)
- Trace("Dev Aveza Debug Log: Player Moved to Ship via Activation Function 'Movable on Deck'")
- Endif
- Endif
- While(rSkyShip_Wheel.Is3DLoaded())
- rSkyShip_Wheel.Disable()
- Endwhile
- While(rSkyShip_Hatch.Is3DLoaded())
- rSkyShip_Hatch.Disable()
- Endwhile
- While(rSkyShip_Plank.Is3DLoaded())
- rSkyShip_Plank.Disable()
- Endwhile
- While(rSkyShip_Light_1.Is3DLoaded())
- rSkyShip_Light_1.Disable()
- Endwhile
- While(rSkyShip_Ladder_1.Is3DLoaded())
- rSkyShip_Ladder_1.Disable()
- Endwhile
- While(rSkyShip_Ladder_2.Is3DLoaded())
- rSkyShip_Ladder_2.Disable()
- Endwhile
- While(rSkyShip_Ladder_3.Is3DLoaded())
- rSkyShip_Ladder_3.Disable()
- Endwhile
- While(rSkyShip_Ladder_4.Is3DLoaded())
- rSkyShip_Ladder_4.Disable()
- Endwhile
- While(rSkyShip_Ladder_5.Is3DLoaded())
- rSkyShip_Ladder_5.Disable()
- Endwhile
- While(rSkyShip_Ladder_6.Is3DLoaded())
- rSkyShip_Ladder_6.Disable()
- Endwhile
- While(rSkyShip_Ladder_7.Is3DLoaded())
- rSkyShip_Ladder_7.Disable()
- Endwhile
- While(rSkyShip_Ladder_8.Is3DLoaded())
- rSkyShip_Ladder_8.Disable()
- Endwhile
- While(rSkyShip_Ladder_9.Is3DLoaded())
- rSkyShip_Ladder_9.Disable()
- Endwhile
- While(rSkyShip_Ladder_10.Is3DLoaded())
- rSkyShip_Ladder_10.Disable()
- Endwhile
- While(rSkyShip_Ladder_11.Is3DLoaded())
- rSkyShip_Ladder_11.Disable()
- Endwhile
- While(rSkyShip_Ladder_12.Is3DLoaded())
- rSkyShip_Ladder_12.Disable()
- Endwhile
- While(rSkyShip_Ladder_13.Is3DLoaded())
- rSkyShip_Ladder_13.Disable()
- Endwhile
- While(rSkyShip_Ladder_14.Is3DLoaded())
- rSkyShip_Ladder_14.Disable()
- Endwhile
- While(rSkyShip_Ladder_15.Is3DLoaded())
- rSkyShip_Ladder_15.Disable()
- Endwhile
- While(rSkyShip_Ladder_16.Is3DLoaded())
- rSkyShip_Ladder_16.Disable()
- Endwhile
- While(rSkyShip_Ladder_17.Is3DLoaded())
- rSkyShip_Ladder_17.Disable()
- Endwhile
- While(rSkyShip_Ladder_18.Is3DLoaded())
- rSkyShip_Ladder_18.Disable()
- Endwhile
- While(rSkyShip_Ladder_19.Is3DLoaded())
- rSkyShip_Ladder_19.Disable()
- Endwhile
- While(rSkyShip_Ladder_20.Is3DLoaded())
- rSkyShip_Ladder_20.Disable()
- Endwhile
- While(rSkyShip_Ladder_21.Is3DLoaded())
- rSkyShip_Ladder_21.Disable()
- Endwhile
- While(rSkyShip_Ladder_22.Is3DLoaded())
- rSkyShip_Ladder_22.Disable()
- Endwhile
- While(rSkyShip_Ladder_23.Is3DLoaded())
- rSkyShip_Ladder_23.Disable()
- Endwhile
- While(rSkyShip_Ladder_24.Is3DLoaded())
- rSkyShip_Ladder_24.Disable()
- Endwhile
- While(rSkyShip_Ladder_25.Is3DLoaded())
- rSkyShip_Ladder_25.Disable()
- Endwhile
- While(rSkyShip_Ladder_26.Is3DLoaded())
- rSkyShip_Ladder_26.Disable()
- Endwhile
- While(rSkyShip_Ladder_27.Is3DLoaded())
- rSkyShip_Ladder_27.Disable()
- Endwhile
- While(rSkyShip_Ladder_28.Is3DLoaded())
- rSkyShip_Ladder_28.Disable()
- Endwhile
- While(rSkyShip_Ladder_29.Is3DLoaded())
- rSkyShip_Ladder_29.Disable()
- Endwhile
- While(rSkyShip_Ladder_30.Is3DLoaded())
- rSkyShip_Ladder_30.Disable()
- Endwhile
- While(rSkyShip_Ladder_31.Is3DLoaded())
- rSkyShip_Ladder_31.Disable()
- Endwhile
- While(rSkyShip_Ladder_32.Is3DLoaded())
- rSkyShip_Ladder_32.Disable()
- Endwhile
- While(rSkyShip_Ladder_33.Is3DLoaded())
- rSkyShip_Ladder_33.Disable()
- Endwhile
- While(rSkyShip_Ladder_34.Is3DLoaded())
- rSkyShip_Ladder_34.Disable()
- Endwhile
- While(rSkyShip_Ladder_35.Is3DLoaded())
- rSkyShip_Ladder_35.Disable()
- Endwhile
- While(rSkyShip_Ladder_36.Is3DLoaded())
- rSkyShip_Ladder_36.Disable()
- Endwhile
- While(rSkyShip_Ladder_37.Is3DLoaded())
- rSkyShip_Ladder_37.Disable()
- Endwhile
- While(rSkyShip_Ladder_38.Is3DLoaded())
- rSkyShip_Ladder_38.Disable()
- Endwhile
- While(rSkyShip_Ladder_39.Is3DLoaded())
- rSkyShip_Ladder_39.Disable()
- Endwhile
- While(rSkyShip_Ladder_40.Is3DLoaded())
- rSkyShip_Ladder_40.Disable()
- Endwhile
- While(rSkyShip_Ladder_41.Is3DLoaded())
- rSkyShip_Ladder_41.Disable()
- Endwhile
- If (iDA_Armed == 1)
- While(rSkyShip_Stopped.Is3DLoaded())
- rSkyShip_Stopped.Disable()
- Endwhile
- Else
- Endif
- If IsFastTravelEnabled() == True
- bFastTravel = True
- Elseif IsFastTravelEnabled() == False
- bFastTravel = False
- Debug.Notification("Fast Travel Is Already Disabled")
- Endif
- ;Debug.Notification(IsFastTravelControlsEnabled() As String)
- fPrevTime = GetCurrentRealTime()
- If(iDASlideFix == 1)
- iDAPCJump = GetMappedKey("Jump")
- iDAPCForward = GetMappedKey("Forward")
- iDAPCBack = GetMappedKey("Back")
- iDAPCLeft = GetMappedKey("Strafe Left")
- iDAPCRight = GetMappedKey("Strafe Right")
- SetGameSettingFloat("fJumpFallHeightMult", 0)
- Endif
- iLanding = 0
- fZPosSpeed = 0
- fXYPosSpeed = 0
- fZAngleSpeed = 0
- fXYStrafingSpeed = 0
- fXPosDest = rSkyShip.GetPositionX()
- fYPosDest = rSkyShip.GetPositionY()
- fZPosDest = rSkyShip.GetPositionZ()
- fZAngleLocal = rSkyShip.GetAngleZ()
- sndShipBell.Play(GetPlayer())
- iCreakID = sndShipCreak.Play(GetPlayer())
- SetInstanceVolume(iCreakID, 0.5)
- iWindID = sndShipWind.Play(GetPlayer())
- SetInstanceVolume(iWindID, 0.0)
- RegisterForSingleUpdate(0)
- Endevent
- State Flying
- ;### Resets Ship in Case of Control Response Failure ###
- Event OnActivate(ObjectReference akActionRef)
- Notification("Flight system error, resetting.")
- sndShipBell.Play(GetPlayer())
- StopShipReset()
- StopInstance(iCreakID)
- StopInstance(iWindID)
- iDA_Fly = 0
- Endevent
- Event OnMenuOpen(String MenuName)
- If (Getstate() == "Flying")
- If Game.IsFastTravelEnabled() == True && iDA_Fly == 1 && bFastTravel == True
- Game.EnableFastTravel(false)
- Else
- Endif
- Else
- Endif
- Endevent
- Event OnMenuClose(String MenuName)
- If (Getstate() == "Flying")
- If Game.IsFastTravelEnabled() == False && iDA_Fly == 0 && bFastTravel == True
- Game.EnableFastTravel()
- Else
- Endif
- Else
- Endif
- Endevent
- Event OnUpdate()
- ;### Stops Scripts in Case of Player Death While Active ###
- If(GetPlayer().IsDead())
- sndShipBell.Play(GetPlayer())
- StopShipReset()
- StopInstance(iCreakID)
- StopInstance(iWindID)
- Endif
- While((fPrevTime + 0.01) > GetCurrentRealTime())
- wait(0.001)
- Endwhile
- fDeltaT = GetCurrentRealTime() - fPrevTime
- fPrevTime = fPrevTime + fDeltaT
- If(fDeltaT > 1)
- fDeltaT = fDeltaTAvg
- Endif
- fDeltaTAvg = fDeltaTAvg * 0.9 + fDeltaT * 0.1
- If(IsKeyPressed(iUp))
- If(iDA_Cruise == 1)
- Notification("Cruise Control Released")
- iDA_Cruise = 0
- Endif
- iDA_Cruise = 0
- fZPosAcceleration = fUpwardPower / fMass
- Elseif(IsKeyPressed(iDown))
- If(iDA_Cruise == 1)
- Notification("Cruise Control Released")
- iDA_Cruise = 0
- Endif
- fZPosAcceleration = -fDownwardPower / fMass
- Else
- fZPosAcceleration = 0
- Endif
- If(IsKeyPressed(iForward))
- If(iDA_Cruise == 1)
- Notification("Cruise Control Released")
- iDA_Cruise = 0
- Endif
- fXYPosAcceleration = fForwardPower / fMass
- Elseif(IsKeyPressed(iBackward))
- If(iDA_Cruise == 1)
- Notification("Cruise Control Released")
- iDA_Cruise = 0
- Endif
- fXYPosAcceleration = -fBackwardPower / fMass
- Else
- fXYPosAcceleration = 0
- Endif
- If(IsKeyPressed(iLeft))
- If(iDA_Cruise == 1)
- Notification("Cruise Control Released")
- iDA_Cruise = 0
- Endif
- fZAngleAcceleration = -fTurnPower / fAngularMass
- Elseif(IsKeyPressed(iRight))
- If(iDA_Cruise == 1)
- Notification("Cruise Control Released")
- iDA_Cruise = 0
- Endif
- fZAngleAcceleration = fTurnPower / fAngularMass
- Else
- fZAngleAcceleration = 0
- Endif
- If(IsKeyPressed(iStrafeLeft))
- If(iDA_Cruise == 1)
- Notification("Cruise Control Released")
- iDA_Cruise = 0
- Endif
- fXYStrafingAcceleration = -fStrafePower / fMass
- Elseif(IsKeyPressed(iStrafeRight))
- If(iDA_Cruise == 1)
- Notification("Cruise Control Released")
- iDA_Cruise = 0
- Endif
- fXYStrafingAcceleration = fStrafePower / fMass
- Else
- fXYStrafingAcceleration = 0
- Endif
- If(IsKeyPressed(iStop) || iLanding)
- If(iDA_Cruise == 1)
- Notification("Cruise Control Released")
- iDA_Cruise = 0
- Endif
- fZPosAcceleration = -fZPosSpeed * 0.5
- fXYPosAcceleration = -fXYPosSpeed * 0.5
- fZAngleAcceleration = -fZAngleSpeed * 0.5
- fXYStrafingAcceleration = -fXYStrafingSpeed * 0.5
- Endif
- If(IsKeyPressed(iExit) && !iLanding)
- If(iDA_Cruise == 1)
- Notification("Cruise Control Released")
- iDA_Cruise = 0
- Endif
- sndShipBell.Play(GetPlayer())
- iLanding = 1
- Endif
- If(IsKeyPressed(iCruise))
- Notification("Cruise Control Set")
- iDA_Cruise = 1
- fZPosAccelerationCruise = fZPosAcceleration
- fXYPosAccelerationCruise = fXYPosAcceleration
- fZAngleAccelerationCruise = fZAngleAcceleration
- fXYStrafingAccelerationCruise = fXYStrafingAcceleration
- fXYPosSpeedCruise = fXYPosSpeed
- fZPosSpeedCruise = fZPosSpeed
- fXYStrafingSpeedCruise = fXYStrafingSpeed
- fUpwardPowerCruise = fUpwardPower
- fDownwardPowerCruise = fDownwardPower
- fForwardPowerCruise = fForwardPower
- fBackwardPowerCruise = fBackwardPower
- fTurnPowerCruise = fTurnPower
- fStrafePowerCruise = fStrafePower
- Endif
- fZAngleSpeed = fZAngleSpeed + (fZAngleAcceleration - fZAngleSpeed * 10000 / fAngularMass) * fDeltaT
- fDeltaT2 = fDeltaT
- While(fDeltaT2 > 0.1)
- fDeltaT2 = fDeltaT2 - 0.1
- If(fXYPosSpeed > 0)
- fXYPosSpeed = fXYPosSpeed + (fXYPosAcceleration - (0.25 * fXYPosSpeed * fXYPosSpeed * 1.2 * fXZPlaneArea) / fMass) * 0.1
- Else
- fXYPosSpeed = fXYPosSpeed + (fXYPosAcceleration + (0.25 * fXYPosSpeed * fXYPosSpeed * 1.2 * fXZPlaneArea) / fMass) * 0.1
- Endif
- If(fZPosSpeed > 0)
- fZPosSpeed = fZPosSpeed + (fZPosAcceleration - (0.25 * fZPosSpeed * fZPosSpeed * 1.2 * fXYPlaneArea) / fMass) * 0.1
- Else
- fZPosSpeed = fZPosSpeed + (fZPosAcceleration + (0.25 * fZPosSpeed * fZPosSpeed * 1.2 * fXYPlaneArea) / fMass) * 0.1
- Endif
- If(fXYStrafingSpeed > 0)
- fXYStrafingSpeed = fXYStrafingSpeed + (fXYStrafingAcceleration - (0.25 * fXYStrafingSpeed * fXYStrafingSpeed * 1.2 * fYZPlaneArea) / fMass) * 0.1
- Else
- fXYStrafingSpeed = fXYStrafingSpeed + (fXYStrafingAcceleration + (0.25 * fXYStrafingSpeed * fXYStrafingSpeed * 1.2 * fYZPlaneArea) / fMass) * 0.1
- Endif
- Endwhile
- If(fXYPosSpeed > 0)
- fXYPosSpeed = fXYPosSpeed + (fXYPosAcceleration - (0.25 * fXYPosSpeed * fXYPosSpeed * 1.2 * fXZPlaneArea) / fMass) * fDeltaT2
- Else
- fXYPosSpeed = fXYPosSpeed + (fXYPosAcceleration + (0.25 * fXYPosSpeed * fXYPosSpeed * 1.2 * fXZPlaneArea) / fMass) * fDeltaT2
- Endif
- If(fZPosSpeed > 0)
- fZPosSpeed = fZPosSpeed + (fZPosAcceleration - (0.25 * fZPosSpeed * fZPosSpeed * 1.2 * fXYPlaneArea) / fMass) * fDeltaT2
- Else
- fZPosSpeed = fZPosSpeed + (fZPosAcceleration + (0.25 * fZPosSpeed * fZPosSpeed * 1.2 * fXYPlaneArea) / fMass) * fDeltaT2
- Endif
- If(fXYStrafingSpeed > 0)
- fXYStrafingSpeed = fXYStrafingSpeed + (fXYStrafingAcceleration - (0.25 * fXYStrafingSpeed * fXYStrafingSpeed * 1.2 * fYZPlaneArea) / fMass) * fDeltaT2
- Else
- fXYStrafingSpeed = fXYStrafingSpeed + (fXYStrafingAcceleration + (0.25 * fXYStrafingSpeed * fXYStrafingSpeed * 1.2 * fYZPlaneArea) / fMass) * fDeltaT2
- Endif
- fXYPosDelta = (fXYPosSpeed * fDeltaT) * fUnitsPerMeter
- fZPosDelta = (fZPosSpeed * fDeltaT) * fUnitsPerMeter
- fXYStrafingDelta = (fXYStrafingSpeed * fDeltaT) * fUnitsPerMeter
- fYAngleLocal = -atan((fZAngleSpeed * 3.14159 / 180) * fXYPosSpeed / 9.81)
- fZAngleLocal = LimitAngle180(fZAngleLocal + fZAngleSpeed * fDeltaT)
- sy = sin(fYAngleLocal)
- cy = cos(fYAngleLocal)
- sz = sin(fZAngleLocal)
- cz = cos(fZAngleLocal)
- If(sy * cz == 1) ;### Gimbal Lock condition 1 ###
- fXAngleDest = 0
- fYAngleDest = 90
- fZAngleDest = fZAngleLocal
- Elseif(sy * cz == -1) ;### Gimbal Lock condition 2 ###
- fXAngleDest = 0
- fYAngleDest = -90
- fZAngleDest = fZAngleLocal
- Else ;### Local Rotation to Global Rotation (reduced formula, only allows local Y and Z rotation) ###
- fXAngleDest = atan2(sz * sy, cy)
- fYAngleDest = asin(sy * cz)
- fZAngleDest = atan2(sz, cz * cy)
- Endif
- fXPosDest = fXPosDest + sin(fZAngleLocal) * fXYPosDelta + cos(fZAngleLocal) * fXYStrafingDelta
- fYPosDest = fYPosDest + cos(fZAngleLocal) * fXYPosDelta - sin(fZAngleLocal) * fXYStrafingDelta
- fZPosDest = fZPosDest + fZPosDelta
- ;### Player Stationary Translation Control ###
- If(iDASlideFix == 1)
- fDAPCDistance = GetPlayer().GetDistance(rSkyship)
- fXDAPCAngleDif = LimitAngle180(GetPlayer().GetAngleX()) - LimitAngle180(rSkyship.GetAngleX())
- fYDAPCAngleDif = LimitAngle180(GetPlayer().GetAngleY()) - LimitAngle180(rSkyship.GetAngleY())
- fZDAPCAngleDif = LimitAngle180(GetPlayer().GetAngleZ()) - LimitAngle180(rSkyship.GetAngleZ())
- fXDAPCDif = GetPlayer().GetPositionX() - rSkyship.GetPositionX()
- fYDAPCDif = GetPlayer().GetPositionY() - rSkyship.GetPositionY()
- fZDAPCDif = GetPlayer().GetPositionZ() - rSkyship.GetPositionZ()
- If(fZDAPCDif > 600 || fZDAPCDif < -100) ; Emergency stop
- If(iDA_Cruise == 1)
- Notification("Cruise Control Released")
- iDA_Cruise = 0
- Endif
- sndShipBell.Play(GetPlayer())
- rSkyShip.StopTranslation()
- rSkyShip_Havok.StopTranslation()
- StopInstance(iCreakID)
- StopInstance(iWindID)
- While(!rSkyShip.Is3DLoaded())
- rSkyShip.Enable()
- Endwhile
- GetPlayer().StopTranslation()
- If(fDAPCFallMult != 0)
- SetGameSettingFloat("fJumpFallHeightMult", fDAPCFallMult)
- Endif
- If (iDA_Armed == 1)
- rSkyship.MoveTo(rSkyship_Havok)
- While(rSkyShip_Havok.Is3DLoaded())
- rSkyShip_Havok.Disable()
- Endwhile
- ShipSetup_Stopped()
- rSkyship_Stopped.MoveTo(rSkyship)
- While(!rSkyShip_Stopped.Is3DLoaded())
- rSkyShip_Stopped.Enable()
- Endwhile
- Elseif (iDA_Armed == 0)
- rSkyship.MoveTo(rSkyship_Havok)
- While(!rSkyShip_Havok.Is3DLoaded())
- rSkyShip_Havok.Enable()
- Endwhile
- ShipSetup_Havok()
- rSkyship_Stopped.MoveTo(rSkyship)
- While(rSkyShip_Stopped.Is3DLoaded())
- rSkyShip_Stopped.Disable()
- Endwhile
- Endif
- If (iDA_Debug == 1)
- Trace("Dev Aveza Debug Log: Player Moved to Ship via distance from ship Function")
- Endif
- Gotostate("")
- iDA_Fly = 0
- Endif
- If (fZPosSpeed > 0.5)
- fZDAPCDif = ((GetPlayer().GetPositionZ()) + (fZPosSpeed / 500)) - rSkyship.GetPositionZ()
- Elseif (fZPosSpeed < 0.5)
- fZDAPCDif = ((GetPlayer().GetPositionZ()) - (fZPosSpeed / 500)) - rSkyship.GetPositionZ()
- Endif
- Endif
- ;If(IsKeyPressed(iTest))
- ;Endif
- fXPosDistance = fXPosDest - rSkyShip.GetPositionX()
- fYPosDistance = fYPosDest - rSkyShip.GetPositionY()
- fZPosDistance = fZPosDest - rSkyShip.GetPositionZ()
- fXYZPosDistance = sqrt(fXPosDistance * fXPosDistance + fYPosDistance * fYPosDistance + fZPosDistance * fZPosDistance)
- fXYZPosSpeed = fXYZPosDistance / (fDeltaTAvg + 0.25)
- If(iDASlideFix == 1)
- fXDAPCPosDistance = (fXDAPCDif + fXPosDest) - GetPlayer().GetPositionX()
- fYDAPCPosDistance = (fYDAPCDif + fYPosDest) - GetPlayer().GetPositionY()
- fZDAPCPosDistance = (fZDAPCDif + fZPosDest) - GetPlayer().GetPositionZ()
- fXYZDAPCPosDistance = sqrt(fXDAPCPosDistance * fXDAPCPosDistance + fYDAPCPosDistance * fYDAPCPosDistance + fZDAPCPosDistance * fZDAPCPosDistance)
- fXYZDAPCPosSpeed = (fXYZDAPCPosDistance / (fDeltaTAvg + 0.25)) - fXYZPosSpeed
- Endif
- If(fXYZPosSpeed < 4)
- fXYZAngleDistance = GetAngleDistance(fZAngleDest, rSkyShip.GetAngleZ())
- fXYZAngleSpeed = fXYZAngleDistance / (fDeltaTAvg + 0.25)
- Else
- fXYZAngleSpeed = 0
- Endif
- rSkyShip.TranslateTo(fXPosDest, fYPosDest, fZPosDest, fXAngleDest, fYAngleDest, fZAngleDest, fXYZPosSpeed, fXYZAngleSpeed)
- rSkyShip_Havok.TranslateTo(fXPosDest, fYPosDest, fZPosDest, fXAngleDest, fYAngleDest, fZAngleDest, fXYZPosSpeed, fXYZAngleSpeed)
- ;### Attached for Ship Collision Fix ###
- If(iDASlideFix == 1)
- If(IsKeyPressed(iDAPCForward)||IsKeyPressed(iDAPCBack)||IsKeyPressed(iDAPCLeft)||IsKeyPressed(iDAPCRight)||IsKeyPressed(iDAPCJump))
- GetPlayer().StopTranslation()
- Elseif (fDAPCDistance > 1700)
- rSkyShip.StopTranslation()
- rSkyShip_Havok.StopTranslation()
- GetPlayer().StopTranslation()
- Elseif (fZPosSpeed > 0.5 || fZPosSpeed < -0.5)
- fZAngleSpeed = 0
- GetPlayer().TranslateTo(fXDAPCDif + fXPosDest, fYDAPCDif + fYPosDest, fZDAPCDif + fZPosDest, fXDAPCAngleDif + fXAngleDest, fYDAPCAngleDif + fYAngleDest, fZDAPCAngleDif + fZAngleDest, fXYZPosSpeed, fXYZAngleSpeed)
- Elseif (fZAngleSpeed > 0.2 || fZAngleSpeed < -0.2)
- fZPosSpeed = 0
- GetPlayer().StopTranslation()
- Else
- GetPlayer().TranslateTo(fXDAPCDif + fXPosDest, fYDAPCDif + fYPosDest, fZDAPCDif + fZPosDest, fXDAPCAngleDif + fXAngleDest, fYDAPCAngleDif + fYAngleDest, fZDAPCAngleDif + fZAngleDest, fXYZPosSpeed, fXYZAngleSpeed)
- Endif
- Endif
- SetInstanceVolume(iWindID, fXYZPosSpeed / 1250)
- If(iDA_Cruise == 1)
- fZPosAcceleration = fZPosAccelerationCruise
- fXYPosAcceleration = fXYPosAccelerationCruise
- fZAngleAcceleration = fZAngleAccelerationCruise
- fXYStrafingAcceleration = fXYStrafingAccelerationCruise
- fXYPosSpeed = fXYPosSpeedCruise
- fZPosSpeed = fZPosSpeedCruise
- fXYStrafingSpeed = fXYStrafingSpeedCruise
- fUpwardPower = fUpwardPowerCruise
- fDownwardPower = fDownwardPowerCruise
- fForwardPower = fForwardPowerCruise
- fBackwardPower = fBackwardPowerCruise
- fTurnPower = fTurnPowerCruise
- fStrafePower = fStrafePowerCruise
- Else
- Endif
- If(iLanding && fZPosSpeed < 0.5 && fXYPosSpeed < 0.5 && fZAngleSpeed < 0.5 && fXYStrafingSpeed < 0.5)
- UnregisterForMenu("MapMenu")
- StopShipReset()
- StopInstance(iCreakID)
- StopInstance(iWindID)
- iDA_Fly = 0
- Else
- RegisterForSingleUpdate(0)
- Endif
- Endevent
- Endstate
- float Function atan2(float fY, float fX)
- float fAngle
- If(fX == 0)
- If(fY == 0)
- fAngle = 0
- Elseif(fY > 0)
- fAngle = 90
- Elseif(fY < 0)
- fAngle = -90
- Endif
- Else
- fAngle = atan(fY / fX)
- If(fX < 0)
- If(fY < 0)
- fAngle = fAngle - 180
- Else
- fAngle = fAngle + 180
- Endif
- Endif
- Endif
- Return fAngle
- Endfunction
- float Function GetAngleDistance(float fAngle1, float fAngle2)
- float fDistance = abs(fAngle1 - fAngle2)
- While(fDistance > 180)
- fDistance = fDistance - 360
- Endwhile
- Return abs(fDistance)
- Endfunction
- float Function LimitAngle180(float fAngle)
- While(fAngle < -180)
- fAngle = fAngle + 360
- Endwhile
- While(fAngle > 180)
- fAngle = fAngle - 360
- Endwhile
- Return fAngle
- Endfunction
- Function ShipSetup_Havok()
- rSkyship_Marker.MoveToNode(rSkyship_Havok, "PlayerNode")
- rSkyship_CreakSND.MoveTo(rSkyship_Havok)
- rSkyship_Switch_Plank.MoveToNode(rSkyship_Havok, "PlankswitchNode")
- rSkyShip_Plank.MoveToNode(rSkyShip_Havok, "PlankNode")
- rSkyShip_Light_1.MoveToNode(rSkyShip_Havok, "LampNode_1")
- rSkyShip_Light_2.MoveToNode(rSkyShip_Havok, "LampNode_2")
- rSkyShip_Light_3.MoveToNode(rSkyShip_Havok, "LampNode_3")
- rSkyShip_Light_4.MoveToNode(rSkyShip_Havok, "LampNode_4")
- rSkyShip_Light_5.MoveToNode(rSkyShip_Havok, "LampNode_5")
- rSkyShip_Light_6.MoveToNode(rSkyShip_Havok, "LampNode_6")
- rSkyShip_Light_7.MoveToNode(rSkyShip_Havok, "LampNode_7")
- rSkyship_Switch_Ladder_1.MoveToNode(rSkyship_Havok, "LadderClimbNode_1")
- rSkyShip_Ladder_1.Disable()
- rSkyShip_Ladder_2.Disable()
- rSkyShip_Ladder_3.Disable()
- rSkyShip_Ladder_4.Disable()
- rSkyShip_Ladder_5.Disable()
- rSkyShip_Ladder_6.Disable()
- rSkyShip_Ladder_7.Disable()
- rSkyShip_Ladder_8.Disable()
- rSkyShip_Ladder_9.Disable()
- rSkyShip_Ladder_10.Disable()
- rSkyShip_Ladder_11.Disable()
- rSkyShip_Ladder_12.Disable()
- rSkyShip_Ladder_13.Disable()
- rSkyShip_Ladder_14.Disable()
- rSkyShip_Ladder_15.Disable()
- rSkyShip_Ladder_16.Disable()
- rSkyShip_Ladder_17.Disable()
- rSkyShip_Ladder_18.Disable()
- rSkyShip_Ladder_19.Disable()
- rSkyShip_Ladder_20.Disable()
- rSkyShip_Ladder_21.Disable()
- rSkyShip_Ladder_22.Disable()
- rSkyShip_Ladder_23.Disable()
- rSkyShip_Ladder_24.Disable()
- rSkyShip_Ladder_25.Disable()
- rSkyShip_Ladder_26.Disable()
- rSkyShip_Ladder_27.Disable()
- rSkyShip_Ladder_28.Disable()
- rSkyShip_Ladder_29.Disable()
- rSkyShip_Ladder_30.Disable()
- rSkyShip_Ladder_31.Disable()
- rSkyShip_Ladder_32.Disable()
- rSkyShip_Ladder_33.Disable()
- rSkyShip_Ladder_34.Disable()
- rSkyShip_Ladder_35.Disable()
- rSkyShip_Ladder_36.Disable()
- rSkyShip_Ladder_37.Disable()
- rSkyShip_Ladder_38.Disable()
- rSkyShip_Ladder_39.Disable()
- rSkyShip_Ladder_40.Disable()
- rSkyShip_Ladder_41.Disable()
- rSkyship_Wheel.MoveToNode(rSkyship_Havok, "WheelNode")
- While(!rSkyship_Wheel.Is3DLoaded())
- rSkyship_Wheel.Enable()
- Endwhile
- rSkyship_Hatch.MoveToNode(rSkyship_Havok, "HatchNode")
- While(!rSkyShip_Hatch.Is3DLoaded())
- rSkyShip_Hatch.Enable()
- Endwhile
- rSkyship_Hatch.SetOpen(False)
- While(!rSkyShip_Light_1.Is3DLoaded())
- rSkyShip_Light_1.Enable()
- Endwhile
- Endfunction
- Function ShipSetup_Stopped()
- rSkyship_Marker.MoveToNode(rSkyship_Stopped, "PlayerNode")
- rSkyship_CreakSND.MoveTo(rSkyship_Stopped)
- rSkyship_Switch_Plank.MoveToNode(rSkyship_Stopped, "PlankswitchNode")
- rSkyShip_Plank.MoveToNode(rSkyShip_Stopped, "PlankNode")
- rSkyShip_Light_1.MoveToNode(rSkyShip_Stopped, "LampNode_1")
- rSkyShip_Light_2.MoveToNode(rSkyShip_Stopped, "LampNode_2")
- rSkyShip_Light_3.MoveToNode(rSkyShip_Stopped, "LampNode_3")
- rSkyShip_Light_4.MoveToNode(rSkyShip_Stopped, "LampNode_4")
- rSkyShip_Light_5.MoveToNode(rSkyShip_Stopped, "LampNode_5")
- rSkyShip_Light_6.MoveToNode(rSkyShip_Stopped, "LampNode_6")
- rSkyShip_Light_7.MoveToNode(rSkyShip_Stopped, "LampNode_7")
- rSkyship_Switch_Ladder_1.MoveToNode(rSkyship_Stopped, "LadderClimbNode_1")
- rSkyship_Ladder_1.MoveTo(rSkyship_Stopped)
- rSkyship_Ladder_2.MoveTo(rSkyship_Stopped)
- rSkyship_Ladder_3.MoveTo(rSkyship_Stopped)
- rSkyship_Ladder_4.MoveTo(rSkyship_Stopped)
- rSkyship_Ladder_5.MoveTo(rSkyship_Stopped)
- rSkyShip_Cannon_Bore_R1.MoveToNode(rSkyship_Stopped, "CannonBoreNode_R1")
- rSkyShip_Cannon_Bore_R2.MoveToNode(rSkyship_Stopped, "CannonBoreNode_R2")
- rSkyShip_Cannon_Bore_R3.MoveToNode(rSkyship_Stopped, "CannonBoreNode_R3")
- rSkyShip_Cannon_Bore_R4.MoveToNode(rSkyship_Stopped, "CannonBoreNode_R4")
- rSkyShip_Cannon_Bore_L1.MoveToNode(rSkyship_Stopped, "CannonBoreNode_L1")
- rSkyShip_Cannon_Bore_L2.MoveToNode(rSkyship_Stopped, "CannonBoreNode_L2")
- rSkyShip_Cannon_Bore_L3.MoveToNode(rSkyship_Stopped, "CannonBoreNode_L3")
- rSkyShip_Cannon_Bore_L4.MoveToNode(rSkyship_Stopped, "CannonBoreNode_L4")
- rSkyship_Cannon_R1.MoveToNode(rSkyship_Stopped, "CannonNode_R1")
- rSkyship_Cannon_R2.MoveToNode(rSkyship_Stopped, "CannonNode_R2")
- rSkyship_Cannon_R3.MoveToNode(rSkyship_Stopped, "CannonNode_R3")
- rSkyship_Cannon_R4.MoveToNode(rSkyship_Stopped, "CannonNode_R4")
- rSkyship_Cannon_L1.MoveToNode(rSkyship_Stopped, "CannonNode_L1")
- rSkyship_Cannon_L2.MoveToNode(rSkyship_Stopped, "CannonNode_L2")
- rSkyship_Cannon_L3.MoveToNode(rSkyship_Stopped, "CannonNode_L3")
- rSkyship_Cannon_L4.MoveToNode(rSkyship_Stopped, "CannonNode_L4")
- rSkyship_CannonBall_R1.MoveTo(rSkyship_Stopped, 0, 0, -100)
- rSkyship_CannonBall_R2.MoveTo(rSkyship_Stopped, 0, 0, -100)
- rSkyship_CannonBall_R3.MoveTo(rSkyship_Stopped, 0, 0, -100)
- rSkyship_CannonBall_R4.MoveTo(rSkyship_Stopped, 0, 0, -100)
- rSkyship_CannonBall_L1.MoveTo(rSkyship_Stopped, 0, 0, -100)
- rSkyship_CannonBall_L2.MoveTo(rSkyship_Stopped, 0, 0, -100)
- rSkyship_CannonBall_L3.MoveTo(rSkyship_Stopped, 0, 0, -100)
- rSkyship_CannonBall_L4.MoveTo(rSkyship_Stopped, 0, 0, -100)
- rSkyship_Wheel.MoveToNode(rSkyship_Stopped, "WheelNode")
- While(!rSkyship_Wheel.Is3DLoaded())
- rSkyship_Wheel.Enable()
- Endwhile
- rSkyship_Hatch.MoveToNode(rSkyship_Stopped, "HatchNode")
- While(!rSkyShip_Hatch.Is3DLoaded())
- rSkyShip_Hatch.Enable()
- Endwhile
- rSkyship_Hatch.SetOpen(False)
- While(!rSkyShip_Light_1.Is3DLoaded())
- rSkyShip_Light_1.Enable()
- Endwhile
- While(rSkyShip_Havok.Is3DLoaded())
- rSkyShip_Havok.Disable()
- Endwhile
- Endfunction
- Function StopShipReset()
- rSkyShip.StopTranslation()
- rSkyShip_Havok.StopTranslation()
- While(!rSkyShip.Is3DLoaded())
- rSkyShip.Enable()
- Endwhile
- If(iFlyModeTemp == 0)
- If (iDA_Armed == 1)
- rSkyship.MoveTo(rSkyship_Havok)
- rSkyship_Stopped.MoveTo(rSkyship)
- While(!rSkyShip_Stopped.Is3DLoaded())
- rSkyShip_Stopped.Enable()
- Endwhile
- GetPlayer().SetVehicle(None)
- If iDA_Beacon == 0
- GetPlayer().MoveToNode(rSkyShip_Stopped, "PlayerNode")
- Else
- Endif
- GetPlayer().SetAlpha(1)
- ShipSetup_Stopped()
- While(rSkyShip_Havok.Is3DLoaded())
- rSkyShip_Havok.Disable()
- Endwhile
- Elseif (iDA_Armed == 0)
- rSkyship.MoveTo(rSkyship_Havok)
- rSkyship_Stopped.MoveTo(rSkyship)
- While(!rSkyShip_Havok.Is3DLoaded())
- rSkyShip_Havok.Enable()
- Endwhile
- GetPlayer().SetVehicle(None)
- If iDA_Beacon == 0
- GetPlayer().MoveToNode(rSkyShip_Havok, "PlayerNode")
- Else
- Endif
- GetPlayer().SetAlpha(1)
- ShipSetup_Havok()
- While(rSkyShip_Stopped.Is3DLoaded())
- rSkyShip_Stopped.Disable()
- Endwhile
- Endif
- If (iDA_Debug == 1)
- Trace("Dev Aveza Debug Log: Player Moved to Ship via DeActivation Function 'Attached to Ship'")
- Endif
- Elseif(iFlyModeTemp == 1)
- If(iDASlideFix == 1)
- GetPlayer().StopTranslation()
- Endif
- If(fDAPCFallMult != 0)
- SetGameSettingFloat("fJumpFallHeightMult", fDAPCFallMult)
- Endif
- SetGodMode(True)
- If (iDA_Armed == 1)
- rSkyship.MoveTo(rSkyship_Havok)
- rSkyship_Stopped.MoveTo(rSkyship)
- While(!rSkyShip_Stopped.Is3DLoaded())
- rSkyShip_Stopped.Enable()
- Endwhile
- If iDA_Beacon == 0
- GetPlayer().MoveToNode(rSkyShip_Stopped, "PlayerNode")
- Else
- Endif
- ShipSetup_Stopped()
- Elseif (iDA_Armed == 0)
- rSkyship.MoveTo(rSkyship_Havok)
- rSkyship_Stopped.MoveTo(rSkyship)
- While(!rSkyShip_Havok.Is3DLoaded())
- rSkyShip_Havok.Enable()
- Endwhile
- If iDA_Beacon == 0
- GetPlayer().MoveToNode(rSkyShip_Havok, "PlayerNode")
- Else
- Endif
- ShipSetup_Havok()
- While(rSkyShip_Stopped.Is3DLoaded())
- rSkyShip_Stopped.Disable()
- Endwhile
- Endif
- If Game.IsFastTravelEnabled() == False && iDA_Fly == 0 && bFastTravel == True
- Game.EnableFastTravel()
- Else
- Endif
- If (iDA_Debug == 1)
- Trace("Dev Aveza Debug Log: Player Moved to Ship via DeActivation Function 'Movable on Deck'")
- Endif
- Endif
- SetGodMode(False)
- Gotostate("")
- Endfunction
Advertisement
Add Comment
Please, Sign In to add comment