diff --git a/sourcemap.json b/sourcemap.json index 5660021..c649b86 100644 --- a/sourcemap.json +++ b/sourcemap.json @@ -1 +1 @@ -{"name":"ElevatorGame","className":"DataModel","filePaths":["default.project.json"],"children":[{"name":"ReplicatedFirst","className":"ReplicatedFirst","children":[{"name":"intro","className":"LocalScript","filePaths":["src/load/intro/init.client.luau"],"children":[{"name":"IntroGui","className":"ModuleScript","filePaths":["src/load/intro/IntroGui.luau"]}]}]},{"name":"ReplicatedStorage","className":"ReplicatedStorage","children":[{"name":"Algebra","className":"ModuleScript","filePaths":["src/shared/Algebra.luau"]},{"name":"Client","className":"Folder","children":[{"name":"Camera","className":"ModuleScript","filePaths":["src/shared/Client/Camera.luau"]},{"name":"KeyBinds","className":"ModuleScript","filePaths":["src/shared/Client/KeyBinds.luau"]}]},{"name":"Delta","className":"ModuleScript","filePaths":["src/shared/Delta.luau"]},{"name":"Enums","className":"ModuleScript","filePaths":["src/shared/Enums.luau"]},{"name":"Output","className":"ModuleScript","filePaths":["src/shared/Output.luau"]},{"name":"Server","className":"Folder","children":[{"name":"holder","className":"ModuleScript","filePaths":["src/shared/Server/holder.luau"]}]},{"name":"Tween","className":"ModuleScript","filePaths":["src/shared/Tween.luau"]}]},{"name":"ServerScriptService","className":"ServerScriptService","children":[{"name":"rapid/server","className":"Actor","children":[{"name":"main","className":"Script","filePaths":["src/server/main/init.server.luau"],"children":[{"name":"Elevators","className":"Folder","children":[{"name":"Configs","className":"ModuleScript","filePaths":["src/server/main/Elevators/Configs.luau"]},{"name":"Elevator","className":"ModuleScript","filePaths":["src/server/main/Elevators/Elevator/init.luau"],"children":[{"name":"ButtonsManager","className":"ModuleScript","filePaths":["src/server/main/Elevators/Elevator/ButtonsManager.luau"]},{"name":"Haughton","className":"ModuleScript","filePaths":["src/server/main/Elevators/Elevator/Haughton/init.luau"]},{"name":"Otis1960","className":"ModuleScript","filePaths":["src/server/main/Elevators/Elevator/Otis1960/init.luau"],"children":[{"name":"MovingObjects","className":"ModuleScript","filePaths":["src/server/main/Elevators/Elevator/Otis1960/MovingObjects.luau"]},{"name":"PhysicalRelay","className":"ModuleScript","filePaths":["src/server/main/Elevators/Elevator/Otis1960/PhysicalRelay.luau"]}]},{"name":"RelayAlgorithm","className":"ModuleScript","filePaths":["src/server/main/Elevators/Elevator/RelayAlgorithm.luau"]}]},{"name":"Lanterns","className":"ModuleScript","filePaths":["src/server/main/Elevators/Lanterns.luau"]},{"name":"Leveling","className":"ModuleScript","filePaths":["src/server/main/Elevators/Leveling.luau"]},{"name":"TractionRopes","className":"ModuleScript","filePaths":["src/server/main/Elevators/TractionRopes.luau"]}]},{"name":"Enums","className":"Folder","children":[{"name":"Sounds","className":"ModuleScript","filePaths":["src/server/main/Enums/Sounds.luau"]}]},{"name":"Lighting","className":"ModuleScript","filePaths":["src/server/main/Lighting/init.luau"]},{"name":"Load","className":"Folder","children":[{"name":"EditorEntities","className":"ModuleScript","filePaths":["src/server/main/Load/EditorEntities.luau"]},{"name":"StarterPlayer","className":"ModuleScript","filePaths":["src/server/main/Load/StarterPlayer.luau"]},{"name":"Tags","className":"ModuleScript","filePaths":["src/server/main/Load/Tags/init.luau"],"children":[{"name":"Buttons","className":"ModuleScript","filePaths":["src/server/main/Load/Tags/Buttons.luau"]},{"name":"Lights","className":"ModuleScript","filePaths":["src/server/main/Load/Tags/Lights.luau"]}]},{"name":"Workspace","className":"ModuleScript","filePaths":["src/server/main/Load/Workspace.luau"]}]},{"name":"Map","className":"Folder","children":[{"name":"Interactions","className":"Folder","children":[{"name":"LightSwitches","className":"ModuleScript","filePaths":["src/server/main/Map/Interactions/LightSwitches.luau"]}]},{"name":"Prompts","className":"ModuleScript","filePaths":["src/server/main/Map/Prompts.luau"]}]},{"name":"PlayerAdded","className":"ModuleScript","filePaths":["src/server/main/PlayerAdded/init.luau"],"children":[{"name":"Character","className":"ModuleScript","filePaths":["src/server/main/PlayerAdded/Character/init.luau"],"children":[{"name":"Actions","className":"ModuleScript","filePaths":["src/server/main/PlayerAdded/Character/Actions.luau"]},{"name":"Flashlight","className":"ModuleScript","filePaths":["src/server/main/PlayerAdded/Character/Flashlight.luau"]},{"name":"Shadows","className":"ModuleScript","filePaths":["src/server/main/PlayerAdded/Character/Shadows.luau"]},{"name":"SpineKinematics","className":"ModuleScript","filePaths":["src/server/main/PlayerAdded/Character/SpineKinematics.luau"]}]},{"name":"Users","className":"ModuleScript","filePaths":["src/server/main/PlayerAdded/Users.luau"]}]},{"name":"Types","className":"Folder","children":[{"name":"Elevator","className":"ModuleScript","filePaths":["src/server/main/Types/Elevator.luau"]}]}]}]}]},{"name":"StarterPlayer","className":"StarterPlayer","children":[{"name":"StarterPlayerScripts","className":"StarterPlayerScripts","children":[{"name":"rapid/client","className":"Folder","children":[{"name":"Player","className":"LocalScript","filePaths":["src/client/init.client.luau"],"children":[{"name":"Character","className":"ModuleScript","filePaths":["src/client/Character/init.luau"],"children":[{"name":"Actions","className":"ModuleScript","filePaths":["src/client/Character/Actions.luau"]},{"name":"Camera","className":"ModuleScript","filePaths":["src/client/Character/Camera/init.luau"],"children":[{"name":"Bobbing","className":"ModuleScript","filePaths":["src/client/Character/Camera/Bobbing.luau"]}]},{"name":"Humanoid","className":"ModuleScript","filePaths":["src/client/Character/Humanoid.luau"]},{"name":"HumanoidRootPart","className":"ModuleScript","filePaths":["src/client/Character/HumanoidRootPart.luau"]},{"name":"Sound","className":"Folder","children":[{"name":"Relays","className":"ModuleScript","filePaths":["src/client/Character/Sound/Relays.luau"]}]},{"name":"SpineKinematics","className":"ModuleScript","filePaths":["src/client/Character/SpineKinematics.luau"]}]},{"name":"CoreGuis","className":"ModuleScript","filePaths":["src/client/CoreGuis.luau"]},{"name":"GuiService","className":"ModuleScript","filePaths":["src/client/GuiService.luau"]},{"name":"Mouse","className":"ModuleScript","filePaths":["src/client/Mouse.luau"]},{"name":"UI","className":"Folder","children":[{"name":"Crosshair","className":"ModuleScript","filePaths":["src/client/UI/Crosshair.luau"]},{"name":"Iris","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/init.lua","src/client/UI/Iris/default.project.json"],"children":[{"name":"API","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/API.lua"]},{"name":"Internal","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/Internal.lua"]},{"name":"Types","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/Types.lua"]},{"name":"config","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/config.lua"]},{"name":"demoWindow","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/demoWindow.lua"]},{"name":"widgets","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/init.lua"],"children":[{"name":"Button","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Button.lua"]},{"name":"Checkbox","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Checkbox.lua"]},{"name":"Combo","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Combo.lua"]},{"name":"Format","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Format.lua"]},{"name":"Image","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Image.lua"]},{"name":"Input","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Input.lua"]},{"name":"Menu","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Menu.lua"]},{"name":"Plot","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Plot.lua"]},{"name":"RadioButton","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/RadioButton.lua"]},{"name":"Root","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Root.lua"]},{"name":"Table","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Table.lua"]},{"name":"Text","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Text.lua"]},{"name":"Tree","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Tree.lua"]},{"name":"Window","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Window.lua"]}]}]},{"name":"Vignette","className":"ModuleScript","filePaths":["src/client/UI/Vignette.luau"]}]}]}]}]}]}]} \ No newline at end of file +{"name":"ElevatorGame","className":"DataModel","filePaths":["default.project.json"],"children":[{"name":"ReplicatedFirst","className":"ReplicatedFirst","children":[{"name":"intro","className":"LocalScript","filePaths":["src/load/intro/init.client.luau"],"children":[{"name":"IntroGui","className":"ModuleScript","filePaths":["src/load/intro/IntroGui.luau"]}]}]},{"name":"ReplicatedStorage","className":"ReplicatedStorage","children":[{"name":"Algebra","className":"ModuleScript","filePaths":["src/shared/Algebra.luau"]},{"name":"Client","className":"Folder","children":[{"name":"Camera","className":"ModuleScript","filePaths":["src/shared/Client/Camera.luau"]},{"name":"KeyBinds","className":"ModuleScript","filePaths":["src/shared/Client/KeyBinds.luau"]}]},{"name":"Delta","className":"ModuleScript","filePaths":["src/shared/Delta.luau"]},{"name":"Enums","className":"ModuleScript","filePaths":["src/shared/Enums.luau"]},{"name":"Output","className":"ModuleScript","filePaths":["src/shared/Output.luau"]},{"name":"Server","className":"Folder","children":[{"name":"holder","className":"ModuleScript","filePaths":["src/shared/Server/holder.luau"]}]},{"name":"Tween","className":"ModuleScript","filePaths":["src/shared/Tween.luau"]}]},{"name":"ServerScriptService","className":"ServerScriptService","children":[{"name":"rapid/server","className":"Actor","children":[{"name":"main","className":"Script","filePaths":["src/server/main/init.server.luau"],"children":[{"name":"Elevators","className":"Folder","children":[{"name":"Buttons","className":"ModuleScript","filePaths":["src/server/main/Elevators/Buttons.luau"]},{"name":"Lanterns","className":"ModuleScript","filePaths":["src/server/main/Elevators/Lanterns.luau"]},{"name":"Map","className":"Folder","children":[{"name":"Haughton","className":"ModuleScript","filePaths":["src/server/main/Elevators/Map/Haughton/init.luau"],"children":[{"name":"Config","className":"ModuleScript","filePaths":["src/server/main/Elevators/Map/Haughton/Config.luau"]},{"name":"Leveling","className":"ModuleScript","filePaths":["src/server/main/Elevators/Map/Haughton/Leveling.luau"]},{"name":"MovingObjects","className":"ModuleScript","filePaths":["src/server/main/Elevators/Map/Haughton/MovingObjects.luau"]}]},{"name":"Otis1960","className":"ModuleScript","filePaths":["src/server/main/Elevators/Map/Otis1960/init.luau"],"children":[{"name":"Config","className":"ModuleScript","filePaths":["src/server/main/Elevators/Map/Otis1960/Config.luau"]},{"name":"Leveling","className":"ModuleScript","filePaths":["src/server/main/Elevators/Map/Otis1960/Leveling.luau"]},{"name":"MovingObjects","className":"ModuleScript","filePaths":["src/server/main/Elevators/Map/Otis1960/MovingObjects.luau"]},{"name":"PhysicalRelay","className":"ModuleScript","filePaths":["src/server/main/Elevators/Map/Otis1960/PhysicalRelay.luau"]}]}]},{"name":"System","className":"ModuleScript","filePaths":["src/server/main/Elevators/System/init.luau"],"children":[{"name":"RelayAlgorithm","className":"ModuleScript","filePaths":["src/server/main/Elevators/System/RelayAlgorithm.luau"]}]},{"name":"TractionRopes","className":"ModuleScript","filePaths":["src/server/main/Elevators/TractionRopes.luau"]}]},{"name":"Map","className":"Folder","children":[{"name":"Interactions","className":"Folder","children":[{"name":"LightSwitches","className":"ModuleScript","filePaths":["src/server/main/Map/Interactions/LightSwitches.luau"]}]},{"name":"Lighting","className":"ModuleScript","filePaths":["src/server/main/Map/Lighting/init.luau"]},{"name":"Load","className":"Folder","children":[{"name":"EditorEntities","className":"ModuleScript","filePaths":["src/server/main/Map/Load/EditorEntities.luau"]},{"name":"StarterPlayer","className":"ModuleScript","filePaths":["src/server/main/Map/Load/StarterPlayer.luau"]},{"name":"Tags","className":"ModuleScript","filePaths":["src/server/main/Map/Load/Tags/init.luau"],"children":[{"name":"Buttons","className":"ModuleScript","filePaths":["src/server/main/Map/Load/Tags/Buttons.luau"]},{"name":"Lights","className":"ModuleScript","filePaths":["src/server/main/Map/Load/Tags/Lights.luau"]}]},{"name":"Workspace","className":"ModuleScript","filePaths":["src/server/main/Map/Load/Workspace.luau"]}]},{"name":"Prompts","className":"ModuleScript","filePaths":["src/server/main/Map/Prompts.luau"]}]},{"name":"PlayerAdded","className":"ModuleScript","filePaths":["src/server/main/PlayerAdded/init.luau"],"children":[{"name":"Character","className":"ModuleScript","filePaths":["src/server/main/PlayerAdded/Character/init.luau"],"children":[{"name":"Actions","className":"ModuleScript","filePaths":["src/server/main/PlayerAdded/Character/Actions.luau"]},{"name":"Flashlight","className":"ModuleScript","filePaths":["src/server/main/PlayerAdded/Character/Flashlight.luau"]},{"name":"Shadows","className":"ModuleScript","filePaths":["src/server/main/PlayerAdded/Character/Shadows.luau"]},{"name":"SpineKinematics","className":"ModuleScript","filePaths":["src/server/main/PlayerAdded/Character/SpineKinematics.luau"]}]},{"name":"Users","className":"ModuleScript","filePaths":["src/server/main/PlayerAdded/Users.luau"]}]},{"name":"Types","className":"Folder","children":[{"name":"Elevator","className":"ModuleScript","filePaths":["src/server/main/Types/Elevator.luau"]},{"name":"Enums","className":"Folder","children":[{"name":"Sounds","className":"ModuleScript","filePaths":["src/server/main/Types/Enums/Sounds.luau"]}]}]}]}]}]},{"name":"StarterPlayer","className":"StarterPlayer","children":[{"name":"StarterPlayerScripts","className":"StarterPlayerScripts","children":[{"name":"rapid/client","className":"Folder","children":[{"name":"Player","className":"LocalScript","filePaths":["src/client/init.client.luau"],"children":[{"name":"Character","className":"ModuleScript","filePaths":["src/client/Character/init.luau"],"children":[{"name":"Actions","className":"ModuleScript","filePaths":["src/client/Character/Actions.luau"]},{"name":"Camera","className":"ModuleScript","filePaths":["src/client/Character/Camera/init.luau"],"children":[{"name":"Bobbing","className":"ModuleScript","filePaths":["src/client/Character/Camera/Bobbing.luau"]}]},{"name":"Humanoid","className":"ModuleScript","filePaths":["src/client/Character/Humanoid.luau"]},{"name":"HumanoidRootPart","className":"ModuleScript","filePaths":["src/client/Character/HumanoidRootPart.luau"]},{"name":"Sound","className":"Folder","children":[{"name":"Relays","className":"ModuleScript","filePaths":["src/client/Character/Sound/Relays.luau"]}]},{"name":"SpineKinematics","className":"ModuleScript","filePaths":["src/client/Character/SpineKinematics.luau"]}]},{"name":"CoreGuis","className":"ModuleScript","filePaths":["src/client/CoreGuis.luau"]},{"name":"GuiService","className":"ModuleScript","filePaths":["src/client/GuiService.luau"]},{"name":"Mouse","className":"ModuleScript","filePaths":["src/client/Mouse.luau"]},{"name":"UI","className":"Folder","children":[{"name":"Crosshair","className":"ModuleScript","filePaths":["src/client/UI/Crosshair.luau"]},{"name":"Iris","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/init.lua","src/client/UI/Iris/default.project.json"],"children":[{"name":"API","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/API.lua"]},{"name":"Internal","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/Internal.lua"]},{"name":"Types","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/Types.lua"]},{"name":"config","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/config.lua"]},{"name":"demoWindow","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/demoWindow.lua"]},{"name":"widgets","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/init.lua"],"children":[{"name":"Button","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Button.lua"]},{"name":"Checkbox","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Checkbox.lua"]},{"name":"Combo","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Combo.lua"]},{"name":"Format","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Format.lua"]},{"name":"Image","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Image.lua"]},{"name":"Input","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Input.lua"]},{"name":"Menu","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Menu.lua"]},{"name":"Plot","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Plot.lua"]},{"name":"RadioButton","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/RadioButton.lua"]},{"name":"Root","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Root.lua"]},{"name":"Table","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Table.lua"]},{"name":"Text","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Text.lua"]},{"name":"Tree","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Tree.lua"]},{"name":"Window","className":"ModuleScript","filePaths":["src/client/UI/Iris/lib/widgets/Window.lua"]}]}]},{"name":"Vignette","className":"ModuleScript","filePaths":["src/client/UI/Vignette.luau"]}]}]}]}]}]}]} \ No newline at end of file diff --git a/src/server/main/Elevators/Elevator/Buttons.luau b/src/server/main/Elevators/Buttons.luau similarity index 100% rename from src/server/main/Elevators/Elevator/Buttons.luau rename to src/server/main/Elevators/Buttons.luau diff --git a/src/server/main/Elevators/Elevator/Haughton/init.luau b/src/server/main/Elevators/Elevator/Haughton/init.luau deleted file mode 100644 index c16feb9..0000000 --- a/src/server/main/Elevators/Elevator/Haughton/init.luau +++ /dev/null @@ -1,38 +0,0 @@ ---!optimize 2 ---!native ---!strict - -local ParentDir = script.Parent -local ElevatorDir = ParentDir.Parent -local MainDir = ElevatorDir.Parent - -local StorageService = game:GetService("ReplicatedStorage") - -local InitElevator = require(ParentDir) -local TagsModule = require(MainDir:WaitForChild("Load"):WaitForChild("Tags")) -local Enums = require(StorageService:WaitForChild("Enums")) - -local ElevatorConfigurationTable = require(ElevatorDir:WaitForChild("Configs")) -local FloorLevelingPositions = require(ElevatorDir:WaitForChild("Leveling")) -local TractionRopes = require(ElevatorDir:WaitForChild("TractionRopes")) - -return function(TagsConstructor: TagsModule.TagsConstructor, ButtonTags: TagsModule.ElevatorButtons, LanternTags: TagsModule.Lanterns, LandingDoorTags: TagsModule.LandingTags) - local ElevatorBoxModel = TagsConstructor:Request("ElevatorMover_Haughton") :: BasePart - local RopeTags = TagsConstructor:Request("ElevatorRope_Haughton") :: {Instance} - - local Elevator = InitElevator.constructor(ElevatorBoxModel, ElevatorConfigurationTable.HaughtonConfiguration, FloorLevelingPositions.HaughtonLeveling) - local TractionRopesConstructor = TractionRopes.constructor(RopeTags, ElevatorBoxModel, FloorLevelingPositions.HaughtonLeveling) - - task.wait(3) - task.spawn(function() - Elevator:RequestLevelAsync(2, Enums.ElevatorCallDirection.Down) - end) - - Elevator.Events.Traveling:Connect(function(deltaTime: number, cabPosition: Vector3) - --TractionRopesConstructor:Move(10, cabPosition) - warn("This is impossible to be firing during parked") - end) - Elevator:StartTraveling() - Elevator.Events.Parked:Wait() - Elevator.__Connections.Moving:Disconnect() -end diff --git a/src/server/main/Elevators/Map/Haughton/Config.luau b/src/server/main/Elevators/Map/Haughton/Config.luau new file mode 100644 index 0000000..f74f985 --- /dev/null +++ b/src/server/main/Elevators/Map/Haughton/Config.luau @@ -0,0 +1,35 @@ +--!optimize 2 +--!native +--!strict + +local ParentDir = script.Parent +local ElevatorDir = ParentDir.Parent +local MainDir = ElevatorDir.Parent.Parent + +local StorageService = game:GetService("ReplicatedStorage") + +local Types = MainDir:WaitForChild("Types") +local Enums = require(StorageService:WaitForChild("Enums")) +local ElevatorTypes = require(Types:WaitForChild("Elevator")) +local SoundEnums = require(Types:WaitForChild("Enums"):WaitForChild("Sounds")) + +local HaughtonConfiguration = {} :: ElevatorTypes.ElevatorConfigurationTable +HaughtonConfiguration.Name = Enums.Elevator.Haughton +HaughtonConfiguration.FloorLevelingDistance = 4 +HaughtonConfiguration.FloorLeveling3PhaseDistance = 1.5 +HaughtonConfiguration.LevelingVelocity = 1 +HaughtonConfiguration.Phase3LevelingVelocity = 1 +HaughtonConfiguration.ParkedDistance = 0.2 +HaughtonConfiguration.Responsiveness = 5 +HaughtonConfiguration.MaxVelocity = 10 +HaughtonConfiguration.Functions = { + ManualTravelStart = true +} +HaughtonConfiguration.Colors = { + ButtonActivated = Color3.fromRGB(180,0,0), + ButtonDeactivated = Color3.fromRGB(139,139,139), + LanternDisplayOn = Color3.fromRGB(44,255,157), + LanternDisplayOff = Color3.fromRGB(255,29,101), +} + +return HaughtonConfiguration diff --git a/src/server/main/Elevators/Map/Haughton/Leveling.luau b/src/server/main/Elevators/Map/Haughton/Leveling.luau new file mode 100644 index 0000000..6ee2552 --- /dev/null +++ b/src/server/main/Elevators/Map/Haughton/Leveling.luau @@ -0,0 +1,8 @@ +--!optimize 2 +--!native +--!strict + +return { + [1] = 1.163, + [2] = 19.163, +} diff --git a/src/server/main/Elevators/Map/Haughton/MovingObjects.luau b/src/server/main/Elevators/Map/Haughton/MovingObjects.luau new file mode 100644 index 0000000..2a6ed36 --- /dev/null +++ b/src/server/main/Elevators/Map/Haughton/MovingObjects.luau @@ -0,0 +1,50 @@ +--!optimize 2 +--!native +--!strict + +type ClassConstructor = typeof(setmetatable({} :: Constructor_Return_Props, {} :: Impl_Constructor)) +type Impl_Constructor = { + __index: Impl_Constructor, + constructor: Constructor_Fun, + --Class functions + RotateRelayCogs: (self: ClassConstructor, InwardsDirection: boolean, SextetRow: boolean, Faulting: boolean, MagnetCog: BasePart, Cog2: BasePart, CounterWeight: BasePart, Row3_RelayDown: BasePart) -> Tween +} + +type Constructor_Fun = () -> ClassConstructor +type Constructor_Return_Props = {} + +local TS = game:GetService("TweenService") + +local MovingObjects = {} :: Impl_Constructor +MovingObjects.__index = MovingObjects + +function MovingObjects.constructor() + return setmetatable({}, MovingObjects) +end + +function MovingObjects:RotateRelayCogs(InwardsDirection, SextetRow, Faulting, MagnetCog, Cog2, CounterWeight, Row_Relays) + local CogTweenInfo = TweenInfo.new(InwardsDirection and .25 or (Faulting and 5 or 3), InwardsDirection and Enum.EasingStyle.Quad or Enum.EasingStyle.Elastic) + + local MagnetCogTween = TS:Create(MagnetCog, CogTweenInfo, { + CFrame = MagnetCog.CFrame*CFrame.Angles(math.rad(InwardsDirection and -90 or 90), 0, 0) + }) + local Cog2Tween = TS:Create(Cog2, CogTweenInfo, { + CFrame = Cog2.CFrame*CFrame.Angles(math.rad(InwardsDirection and 90 or -90), 0, 0) + }) + + local CounterWeightTween = TS:Create(CounterWeight, TweenInfo.new(.105, Enum.EasingStyle.Linear), { + Position = InwardsDirection and CounterWeight.Position+Vector3.new(0,.23,0) or CounterWeight.Position-Vector3.new(0,.23,0) + }) + local RelaysTween = TS:Create(Row_Relays, TweenInfo.new(.105, Enum.EasingStyle.Linear), { + CFrame = Row_Relays.CFrame*CFrame.Angles(0,0,math.rad(SextetRow and (InwardsDirection and 6 or -6) or InwardsDirection and -6 or 6)) + }) + + MagnetCogTween:Play() + Cog2Tween:Play() + CounterWeightTween:Play() + RelaysTween:Play() + + return MagnetCogTween +end + +return MovingObjects \ No newline at end of file diff --git a/src/server/main/Elevators/Map/Haughton/init.luau b/src/server/main/Elevators/Map/Haughton/init.luau new file mode 100644 index 0000000..d3cc896 --- /dev/null +++ b/src/server/main/Elevators/Map/Haughton/init.luau @@ -0,0 +1,108 @@ +--!optimize 2 +--!native +--!strict + +local ParentDir = script.Parent +local ElevatorsDir = ParentDir.Parent +local MainDir = ElevatorsDir.Parent + +local StorageService = game:GetService("ReplicatedStorage") + +local Enums = require(StorageService:WaitForChild("Enums")) +local InitElevator = require(ElevatorsDir:WaitForChild("System")) +local Config = require(script:WaitForChild("Config")) +local Leveling = require(script:WaitForChild("Leveling")) +local MovingObjects = require(script:WaitForChild("MovingObjects")) +local TagsModule = require(MainDir:WaitForChild("Map"):WaitForChild("Load"):WaitForChild("Tags")) + +local function ElectricalFlash(Flash: PointLight) + Flash.Enabled = true + task.delay(.07, function() + Flash.Enabled = false + end) +end + +return function(TagsConstructor: TagsModule.TagsConstructor, ButtonTags: TagsModule.ElevatorButtons, LanternTags: TagsModule.Lanterns, LandingDoorTags: TagsModule.LandingTags) + local ElevatorModel = TagsConstructor:Request("Elevator_Haughton") :: Model + local ElevatorBoxModel = ElevatorModel:WaitForChild("Mover") :: BasePart + + local MagnetCog_Row3 = TagsConstructor:Request("Haughton_MagnetCog_Row3") :: BasePart + local Cog2_Row3 = TagsConstructor:Request("Haughton_Cog2_Row3") :: BasePart + local Row3_CounterWeight = TagsConstructor:Request("Haughton_Row3_CounterWeight") :: BasePart + local Row3_RelayDown = TagsConstructor:Request("Haughton_Row3_Relay_Down") :: BasePart + + local Haughton_Relay_Close = TagsConstructor:Request("Haughton_Relay_Close") :: Sound + local Haughton_Relay_Open = TagsConstructor:Request("Haughton_Relay_Open") :: Sound + local Haughton_Relay_FullOpen = TagsConstructor:Request("Haughton_Relay_FullOpen") :: Sound + + local MagnetCog_Row1 = TagsConstructor:Request("Haughton_MagnetCog_Row1") :: BasePart + local Cog2_Row1 = TagsConstructor:Request("Haughton_Cog2_Row1") :: BasePart + local Row1_CounterWeight = TagsConstructor:Request("Haughton_Row1_CounterWeight") :: BasePart + local Row1_Relays = TagsConstructor:Request("Haughton_Row1_Relays") :: BasePart + local Row1_Flash = TagsConstructor:Request("Haughton_Row1_Flash") :: PointLight + + local MagnetCog_Row2 = TagsConstructor:Request("Haughton_MagnetCog_Row2") :: BasePart + local Cog2_Row2 = TagsConstructor:Request("Haughton_Cog2_Row2") :: BasePart + local Row2_CounterWeight = TagsConstructor:Request("Haughton_Row2_CounterWeight") :: BasePart + local Row2_Relays = TagsConstructor:Request("Haughton_Row2_Relays") :: BasePart + local Row2_Flash = TagsConstructor:Request("Haughton_Row2_Flash") :: PointLight + + local MagnetCog_Row4 = TagsConstructor:Request("Haughton_MagnetCog_Row4") :: BasePart + local Cog2_Row4 = TagsConstructor:Request("Haughton_Cog2_Row4") :: BasePart + local Row4_CounterWeight = TagsConstructor:Request("Haughton_Row4_CounterWeight") :: BasePart + local Row4_Relays = TagsConstructor:Request("Haughton_Row4_Relays") :: BasePart + local Row4_Flash = TagsConstructor:Request("Haughton_Row4_Flash") :: PointLight + + --sneaky Machine room stuff hehe + local PulleyWheel = TagsConstructor:Request("Haughton_PulleyWheel") :: BasePart + + local Elevator = InitElevator.constructor(ElevatorBoxModel, Config, Leveling) + local MovingObjectsConstructor = MovingObjects.constructor() + + task.wait(3) + task.spawn(function() + Elevator:RequestLevelAsync(2, Enums.ElevatorCallDirection.Down) + end) + + Elevator.Events.Traveling:Connect(function(_DeltaTime: number, CabPosition: Vector3) + local CabVelocity = ElevatorBoxModel:GetVelocityAtPosition(CabPosition) + local Pulley_Y_Direction = (Elevator.Attributes.TravelingUpwards.Value and -CabVelocity.Y or CabVelocity.Y) + + PulleyWheel.CFrame*=CFrame.Angles(math.rad(Pulley_Y_Direction/2),0,0) + end) + Elevator.Events.Progression:Connect(function(previousFloor: number, CurrentFloor: number, NextFloor: number) + warn("previousFloor=",previousFloor,"CurrentFloor=", CurrentFloor, "NextFloor=",NextFloor) + end) + + Elevator.Events.Leveling:Connect(function() + Haughton_Relay_Open:Play() + MovingObjectsConstructor:RotateRelayCogs(false, false, false, MagnetCog_Row2, Cog2_Row2, Row2_CounterWeight, Row2_Relays) + ElectricalFlash(Row2_Flash) + + MovingObjectsConstructor:RotateRelayCogs(true, true, false, MagnetCog_Row1, Cog2_Row1, Row1_CounterWeight, Row1_Relays) + task.wait(.1) + MovingObjectsConstructor:RotateRelayCogs(false, true, false, MagnetCog_Row4, Cog2_Row4, Row4_CounterWeight, Row4_Relays) + ElectricalFlash(Row4_Flash) + end) + + Elevator.Events.Parked:Connect(function() + MovingObjectsConstructor:RotateRelayCogs(false, true, false, MagnetCog_Row1, Cog2_Row1, Row1_CounterWeight, Row1_Relays) + ElectricalFlash(Row1_Flash) + + MovingObjectsConstructor:RotateRelayCogs(false, false, false, MagnetCog_Row3, Cog2_Row3, Row3_CounterWeight, Row3_RelayDown) + Haughton_Relay_FullOpen:Play() + end) + + Haughton_Relay_Close:Play() + MovingObjectsConstructor:RotateRelayCogs(true, false, false, MagnetCog_Row3, Cog2_Row3, Row3_CounterWeight, Row3_RelayDown) + task.wait(.30) + MovingObjectsConstructor:RotateRelayCogs(true, false, false, MagnetCog_Row2, Cog2_Row2, Row2_CounterWeight, Row2_Relays).Completed:Once(function() + MovingObjectsConstructor:RotateRelayCogs(true, true, true, MagnetCog_Row1, Cog2_Row1, Row1_CounterWeight, Row1_Relays) + task.wait(.35) + MovingObjectsConstructor:RotateRelayCogs(false, true, true, MagnetCog_Row1, Cog2_Row1, Row1_CounterWeight, Row1_Relays) + end) + task.wait(.30) + MovingObjectsConstructor:RotateRelayCogs(true, true, false, MagnetCog_Row4, Cog2_Row4, Row4_CounterWeight, Row4_Relays) + + Elevator:StartTraveling() +end diff --git a/src/server/main/Elevators/Configs.luau b/src/server/main/Elevators/Map/Otis1960/Config.luau similarity index 50% rename from src/server/main/Elevators/Configs.luau rename to src/server/main/Elevators/Map/Otis1960/Config.luau index 428d039..451cc50 100644 --- a/src/server/main/Elevators/Configs.luau +++ b/src/server/main/Elevators/Map/Otis1960/Config.luau @@ -2,29 +2,36 @@ --!native --!strict -local MainDir = script.Parent.Parent +local ParentDir = script.Parent +local ElevatorDir = ParentDir.Parent +local MainDir = ElevatorDir.Parent.Parent + local StorageService = game:GetService("ReplicatedStorage") +local Types = MainDir:WaitForChild("Types") local Enums = require(StorageService:WaitForChild("Enums")) -local SoundEnums = require(MainDir:WaitForChild("Enums"):WaitForChild("Sounds")) -local ElevatorTypes = require(MainDir:WaitForChild("Types"):WaitForChild("Elevator")) +local ElevatorTypes = require(Types:WaitForChild("Elevator")) +local SoundEnums = require(Types:WaitForChild("Enums"):WaitForChild("Sounds")) local Otis1960Configuration = {} :: ElevatorTypes.ElevatorConfigurationTable Otis1960Configuration.Name = Enums.Elevator.Otis1960 Otis1960Configuration.FloorLevelingDistance = 4 Otis1960Configuration.FloorLeveling3PhaseDistance = 1.5 +Otis1960Configuration.Phase3LevelingVelocity = .5 +Otis1960Configuration.LevelingVelocity = 2 Otis1960Configuration.ParkedDistance = 0.2 Otis1960Configuration.Responsiveness = 20 Otis1960Configuration.MaxVelocity = 7 -Otis1960Configuration.LevelingVelocity = 2 -Otis1960Configuration.Phase3LevelingVelocity = .5 + Otis1960Configuration.Functions = { ManualTravelStart = false } + Otis1960Configuration.Sounds = { LanternChimeDirection = SoundEnums.Otis1960.LanternChimeDirection, LanternChimeLanding = SoundEnums.Otis1960.LanternChimeLanding } + Otis1960Configuration.Colors = { ButtonActivated = Color3.fromRGB(180,0,0), ButtonDeactivated = Color3.fromRGB(139,139,139), @@ -32,26 +39,4 @@ Otis1960Configuration.Colors = { LanternDisplayOff = Color3.fromRGB(55,55,55), } -local HaughtonConfiguration = {} :: ElevatorTypes.ElevatorConfigurationTable -HaughtonConfiguration.Name = Enums.Elevator.Haughton -HaughtonConfiguration.FloorLevelingDistance = 4 -HaughtonConfiguration.FloorLeveling3PhaseDistance = 1.5 -HaughtonConfiguration.ParkedDistance = 0.2 -HaughtonConfiguration.Responsiveness = 20 -HaughtonConfiguration.MaxVelocity = 7 -HaughtonConfiguration.LevelingVelocity = 2 -HaughtonConfiguration.Phase3LevelingVelocity = .5 -HaughtonConfiguration.Functions = { - ManualTravelStart = true -} -HaughtonConfiguration.Colors = { - ButtonActivated = Color3.fromRGB(180,0,0), - ButtonDeactivated = Color3.fromRGB(139,139,139), - LanternDisplayOn = Color3.fromRGB(44,255,157), - LanternDisplayOff = Color3.fromRGB(255,29,101), -} - -return { - Otis1960Configuration = Otis1960Configuration, - HaughtonConfiguration = HaughtonConfiguration -} +return Otis1960Configuration diff --git a/src/server/main/Elevators/Leveling.luau b/src/server/main/Elevators/Map/Otis1960/Leveling.luau similarity index 52% rename from src/server/main/Elevators/Leveling.luau rename to src/server/main/Elevators/Map/Otis1960/Leveling.luau index 02d76e7..6b45b1c 100644 --- a/src/server/main/Elevators/Leveling.luau +++ b/src/server/main/Elevators/Map/Otis1960/Leveling.luau @@ -2,7 +2,7 @@ --!native --!strict -local Otis1960Leveling: {number} = { +return { [1] = 13.041, [2] = 37.973, [3] = 62.978, @@ -14,13 +14,3 @@ local Otis1960Leveling: {number} = { [9] = 213.058, [10] = 239.245, } - -local HaughtonLeveling: {number} = { - [1] = 1.163, - [2] = 19.163, -} - -return { - Otis1960Leveling = Otis1960Leveling, - HaughtonLeveling = HaughtonLeveling -} diff --git a/src/server/main/Elevators/Elevator/Otis1960/MovingObjects.luau b/src/server/main/Elevators/Map/Otis1960/MovingObjects.luau similarity index 98% rename from src/server/main/Elevators/Elevator/Otis1960/MovingObjects.luau rename to src/server/main/Elevators/Map/Otis1960/MovingObjects.luau index 3c5e5d6..ff82daa 100644 --- a/src/server/main/Elevators/Elevator/Otis1960/MovingObjects.luau +++ b/src/server/main/Elevators/Map/Otis1960/MovingObjects.luau @@ -7,7 +7,7 @@ type Impl_Constructor = { __index: Impl_Constructor, constructor: Constructor_Fun, --Class functions - UpdateCFrame: (self: ClassConstructor) -> (), + UpdateCFrame: (self: ClassConstructor) -> (), FramePullies: (self: ClassConstructor, Delta: number, ElevatorVelocity_Y: number) -> (), FramePiePlate: (self: ClassConstructor, Delta: number, ElevatorVelocity_Y: number) -> () } @@ -46,7 +46,7 @@ MovingObjects.__index = MovingObjects function MovingObjects.constructor(InstanceTree) local self = InstanceTree :: Constructor_Return_Props - + self.MachineRoom._CFrame.PulleyCFrame = InstanceTree.MachineRoom.Pulley.CFrame self.MachineRoom._CFrame.Pulley2CFrame = InstanceTree.MachineRoom.Pulley2.CFrame self.MachineRoom._CFrame.GovernorCFrame = InstanceTree.MachineRoom.Governor.CFrame @@ -92,4 +92,4 @@ function MovingObjects:FramePiePlate(Delta, ElevatorVelocity_Y) MR.PiePlatePlates.CFrame = MR_C.PiePlatePlatesCFrame *CFrame.Angles(-math.rad(Delta*5), 0, 0) end -return MovingObjects \ No newline at end of file +return MovingObjects diff --git a/src/server/main/Elevators/Elevator/Otis1960/PhysicalRelay.luau b/src/server/main/Elevators/Map/Otis1960/PhysicalRelay.luau similarity index 100% rename from src/server/main/Elevators/Elevator/Otis1960/PhysicalRelay.luau rename to src/server/main/Elevators/Map/Otis1960/PhysicalRelay.luau diff --git a/src/server/main/Elevators/Elevator/Otis1960/init.luau b/src/server/main/Elevators/Map/Otis1960/init.luau similarity index 75% rename from src/server/main/Elevators/Elevator/Otis1960/init.luau rename to src/server/main/Elevators/Map/Otis1960/init.luau index b9c38af..64fc40e 100644 --- a/src/server/main/Elevators/Elevator/Otis1960/init.luau +++ b/src/server/main/Elevators/Map/Otis1960/init.luau @@ -2,18 +2,6 @@ --!native --!strict -local ParentDir = script.Parent -local MainDir = ParentDir.Parent - -local StorageService = game:GetService("ReplicatedStorage") - -local Enums = require(StorageService:WaitForChild("Enums")) -local InitElevator = require(ParentDir:WaitForChild("InitElevator")) -local TagsModule = require(MainDir:WaitForChild("Load"):WaitForChild("Tags")) - -local ElevatorConfigurationTable = require(ParentDir:WaitForChild("Configs")) -local FloorLevelingPositions = require(ParentDir:WaitForChild("Leveling")) - -- self.ElevatorBox_1960 = TagsConstructor:Request("ElevatorMover_1960") :: UnionOperation -- self.ElevatorDoor1 = TagsConstructor:Request("ElevatorDoor_1960_1") :: BasePart -- self.ElevatorDoor2 = TagsConstructor:Request("ElevatorDoor_1960_2") :: BasePart @@ -29,8 +17,18 @@ local FloorLevelingPositions = require(ParentDir:WaitForChild("Leveling")) -- self.MachineRoom.PiePlatePlates = TagsConstructor:Request("Otis1960_PiePlatePlates") :: UnionOperation -- self.MachineRoom.PiePlateSelector = TagsConstructor:Request("Otis1960_PiePlateSelector") :: UnionOperation -return function(TagsConstructor: TagsModule.TagsConstructor, ButtonTags: TagsModule.ElevatorButtons, LanternTags: TagsModule.Lanterns, LandingDoorTags: TagsModule.LandingTags) - --local ElevatorBoxModel = TagsConstructor:Request("ElevatorMover_1960") :: UnionOperation +local ParentDir = script.Parent +local ElevatorsDir = ParentDir.Parent +local MainDir = ElevatorsDir.Parent + +local StorageService = game:GetService("ReplicatedStorage") + +local InitElevator = require(ElevatorsDir:WaitForChild("System")) +local Config = require(script:WaitForChild("Config")) +local Leveling = require(script:WaitForChild("Leveling")) +local Enums = require(StorageService:WaitForChild("Enums")) +local TagsModule = require(MainDir:WaitForChild("Map"):WaitForChild("Load"):WaitForChild("Tags")) + +return function(TagsConstructor: TagsModule.TagsConstructor, ButtonTags: TagsModule.ElevatorButtons, LanternTags: TagsModule.Lanterns, LandingDoorTags: TagsModule.LandingTags) - --local Elevator = InitElevator.constructor(ElevatorBoxModel, ElevatorConfigurationTable.Otis1960Configuration, FloorLevelingPositions) end diff --git a/src/server/main/Elevators/Elevator/RelayAlgorithm.luau b/src/server/main/Elevators/System/RelayAlgorithm.luau similarity index 100% rename from src/server/main/Elevators/Elevator/RelayAlgorithm.luau rename to src/server/main/Elevators/System/RelayAlgorithm.luau diff --git a/src/server/main/Elevators/Elevator/init.luau b/src/server/main/Elevators/System/init.luau similarity index 84% rename from src/server/main/Elevators/Elevator/init.luau rename to src/server/main/Elevators/System/init.luau index f549235..e954a9e 100644 --- a/src/server/main/Elevators/Elevator/init.luau +++ b/src/server/main/Elevators/System/init.luau @@ -4,10 +4,12 @@ local Elevators = script.Parent local MainDir = Elevators.Parent -local LoadDir = MainDir:WaitForChild("Load") +local MapDir = MainDir:WaitForChild("Map") +local LoadDir = MapDir:WaitForChild("Load") local RunService = game:GetService("RunService") local StorageService = game:GetService("ReplicatedStorage") +local TweenService = game:GetService("TweenService") local Enums = require(StorageService:WaitForChild("Enums")) local Out = require(StorageService:WaitForChild("Output")) @@ -47,28 +49,8 @@ type Constructor_Return_Props = { AlignPosition: AlignPosition, Configuration: ElevatorTypes.ElevatorConfigurationTable }, - Attributes: { - PreviousFloor: IntValue, - CurrentFloor: IntValue, - NextFloor: IntValue, - Goal: IntValue, - TravelingUpwards: BoolValue, - Stopped: BoolValue - }, - Events: { - Progression: RBXScriptSignal, - Traveling: RBXScriptSignal, - Parked: RBXScriptSignal, - Leveling: RBXScriptSignal, - Leveling3Phase: RBXScriptSignal, - __eventInstances__: { - Progression: BindableEvent, - Traveling: BindableEvent, - Parked: BindableEvent, - Leveling: BindableEvent, - Leveling3Phase: BindableEvent, - } - }, + Attributes: Attributes, + Events: Events, __functionEvents: { StartTraveling: BindableEvent }, @@ -77,6 +59,30 @@ type Constructor_Return_Props = { } } +export type Attributes = { + PreviousFloor: IntValue, + CurrentFloor: IntValue, + NextFloor: IntValue, + Goal: IntValue, + TravelingUpwards: BoolValue, + Stopped: BoolValue +} + +export type Events = { + Progression: RBXScriptSignal, + Traveling: RBXScriptSignal, + Parked: RBXScriptSignal, + Leveling: RBXScriptSignal, + Leveling3Phase: RBXScriptSignal, + __eventInstances__: { + Progression: BindableEvent, + Traveling: BindableEvent, + Parked: BindableEvent, + Leveling: BindableEvent, + Leveling3Phase: BindableEvent, + } +} + local Elevator = {} :: Impl_Constructor Elevator.__index = Elevator @@ -86,7 +92,7 @@ local function ElevatorGoingUpDirection(CurrentFloor: number, RequestedFloor: nu return CurrentFloor=AtFloorY-self.Elevator.Configuration.FloorLevelingDistance then + if ElevatorPosition.Y>=AtFloorY-self.Elevator.Configuration.FloorLevelingDistance and self.Attributes.CurrentFloor.Value~=self.Attributes.Goal.Value then self.Attributes.PreviousFloor.Value = self.Attributes.CurrentFloor.Value self.Attributes.CurrentFloor.Value+=1 self.Attributes.NextFloor.Value = FloorsClamp(self, self.Attributes.CurrentFloor.Value+1) @@ -282,12 +304,19 @@ local function CabTraveling(self: ClassConstructor, deltaTime: number, LEVEL_VEC --Elevator is riding upwards towards the destination if ElevatorPosition.Y>=LEVEL_VEC3_Y_WRAP.Y-self.Elevator.Configuration.FloorLevelingDistance then - self.Events.__eventInstances__.Leveling:Fire() - self.Elevator.AlignPosition.MaxVelocity = self.Elevator.Configuration.LevelingVelocity + if not Debounce.Leveling then + self.Events.__eventInstances__.Leveling:Fire() + SmoothVelocity(self, self.Elevator.Configuration.LevelingVelocity, .5) + Debounce.Leveling = true + end if ElevatorPosition.Y>=LEVEL_VEC3_Y_WRAP.Y-self.Elevator.Configuration.FloorLeveling3PhaseDistance then - self.Events.__eventInstances__.Leveling3Phase:Fire() - self.Elevator.AlignPosition.MaxVelocity = self.Elevator.Configuration.Phase3LevelingVelocity + if not Debounce.Leveling3Phase then + self.Events.__eventInstances__.Leveling3Phase:Fire() + --I dont think 3 phase leveling should need smoothing + self.Elevator.AlignPosition.MaxVelocity = self.Elevator.Configuration.Phase3LevelingVelocity + Debounce.Leveling3Phase = true + end if ElevatorPosition.Y>=LEVEL_VEC3_Y_WRAP.Y-self.Elevator.Configuration.ParkedDistance then self.Events.__eventInstances__.Parked:Fire() @@ -297,7 +326,7 @@ local function CabTraveling(self: ClassConstructor, deltaTime: number, LEVEL_VEC end end else - if ElevatorPosition.Y<=AtFloorY+self.Elevator.Configuration.FloorLevelingDistance then + if ElevatorPosition.Y<=AtFloorY+self.Elevator.Configuration.FloorLevelingDistance and self.Attributes.CurrentFloor.Value~=self.Attributes.Goal.Value then self.Attributes.PreviousFloor.Value = self.Attributes.CurrentFloor.Value self.Attributes.CurrentFloor.Value-=1 self.Attributes.NextFloor.Value = FloorsClamp(self, self.Attributes.CurrentFloor.Value-1) @@ -307,12 +336,19 @@ local function CabTraveling(self: ClassConstructor, deltaTime: number, LEVEL_VEC --Elevator is riding upwards towards the destination if ElevatorPosition.Y<=LEVEL_VEC3_Y_WRAP.Y+self.Elevator.Configuration.FloorLevelingDistance then - self.Events.__eventInstances__.Leveling:Fire() - self.Elevator.AlignPosition.MaxVelocity = self.Elevator.Configuration.LevelingVelocity + if not Debounce.Leveling then + self.Events.__eventInstances__.Leveling:Fire() + SmoothVelocity(self, self.Elevator.Configuration.LevelingVelocity, .5) + Debounce.Leveling = true + end if ElevatorPosition.Y<=LEVEL_VEC3_Y_WRAP.Y+self.Elevator.Configuration.FloorLeveling3PhaseDistance then - self.Events.__eventInstances__.Leveling3Phase:Fire() - self.Elevator.AlignPosition.MaxVelocity = self.Elevator.Configuration.Phase3LevelingVelocity + if not Debounce.Leveling then + self.Events.__eventInstances__.Leveling3Phase:Fire() + --I dont think 3 phase leveling should need smoothing + self.Elevator.AlignPosition.MaxVelocity = self.Elevator.Configuration.Phase3LevelingVelocity + Debounce.Leveling3Phase = true + end if ElevatorPosition.Y<=LEVEL_VEC3_Y_WRAP.Y+self.Elevator.Configuration.ParkedDistance then self.Events.__eventInstances__.Parked:Fire() @@ -349,13 +385,16 @@ function Elevator:__TravelToFloorAsync(Level_Int, LEVEL_VEC3_Y_WRAP) self.Attributes.Goal.Value = Level_Int self.Attributes.TravelingUpwards.Value = ElevatorTravelingUpwards - self.__Connections.Moving = RunService.Heartbeat:Connect(function(deltaTime: number) + Debounce.Leveling = false + Debounce.Leveling3Phase = false + self.__Connections.Moving = RunService.Stepped:Connect(function(deltaTime: number) CabTraveling(self, deltaTime, LEVEL_VEC3_Y_WRAP) end) + --Set the elevator's AlignPosition to the floor Y vector self.Elevator.AlignPosition.Position = Vector3.new(self.Elevator.AlignPosition.Position.X, LEVEL_VEC3_Y_WRAP.Y, self.Elevator.AlignPosition.Position.Z) - --Set the elevator's max velocity to its fastest speed when moving starts - self.Elevator.AlignPosition.MaxVelocity = self.Elevator.Configuration.MaxVelocity + --Set the elevator's velocity + SmoothVelocity(self, self.Elevator.Configuration.MaxVelocity, 10) end function Elevator:RequestLevelAsync(RequestedLevel, Direction) diff --git a/src/server/main/Map/Interactions/LightSwitches.luau b/src/server/main/Map/Interactions/LightSwitches.luau index 8e6a1ac..8e76db8 100644 --- a/src/server/main/Map/Interactions/LightSwitches.luau +++ b/src/server/main/Map/Interactions/LightSwitches.luau @@ -3,8 +3,7 @@ --!strict local MapDir = script.Parent.Parent -local MainDir = MapDir.Parent -local LoadDir = MainDir:WaitForChild("Load") +local LoadDir = MapDir:WaitForChild("Load") local Storage = game:GetService("ReplicatedStorage") @@ -46,7 +45,7 @@ end local EnumMaterials: {Enum.Material} = Enum.Material:GetEnumItems() local EnumMaterialsNames: {string} = {} ---Convert it all to string values, couldnt figure out any hacks to make it a true one liner + for k: number, v: Enum.Material in EnumMaterials do EnumMaterialsNames[k] = v.Name end @@ -96,7 +95,7 @@ end local function ToggleSwitch(EnabledState: boolean, LightProperties: LightProperties, Sounds: boolean) SwitchAnimation(EnabledState, LightProperties) - + if Sounds and LightProperties.ClickSound then LightProperties.ClickSound:Play() end @@ -125,7 +124,7 @@ function Lights:Init() LightProperties.Lights and LightProperties.LightSources and LightProperties.ActivatedMaterial and - LightProperties.DeactivatedMaterial + LightProperties.DeactivatedMaterial then if LightProperties.Enabled then EnabledState = true @@ -136,7 +135,7 @@ function Lights:Init() local ActivatedMaterial = table.find(EnumMaterialsNames, LightProperties.ActivatedMaterial) local DeactivatedMaterial = table.find(EnumMaterialsNames, LightProperties.DeactivatedMaterial) - + if not ActivatedMaterial then ActivatedMaterial = 1 warn() @@ -162,4 +161,4 @@ function Lights:Init() end end -return Lights \ No newline at end of file +return Lights diff --git a/src/server/main/Lighting/init.luau b/src/server/main/Map/Lighting/init.luau similarity index 100% rename from src/server/main/Lighting/init.luau rename to src/server/main/Map/Lighting/init.luau diff --git a/src/server/main/Load/EditorEntities.luau b/src/server/main/Map/Load/EditorEntities.luau similarity index 100% rename from src/server/main/Load/EditorEntities.luau rename to src/server/main/Map/Load/EditorEntities.luau diff --git a/src/server/main/Load/StarterPlayer.luau b/src/server/main/Map/Load/StarterPlayer.luau similarity index 100% rename from src/server/main/Load/StarterPlayer.luau rename to src/server/main/Map/Load/StarterPlayer.luau diff --git a/src/server/main/Load/Tags/Buttons.luau b/src/server/main/Map/Load/Tags/Buttons.luau similarity index 100% rename from src/server/main/Load/Tags/Buttons.luau rename to src/server/main/Map/Load/Tags/Buttons.luau diff --git a/src/server/main/Load/Tags/Lights.luau b/src/server/main/Map/Load/Tags/Lights.luau similarity index 100% rename from src/server/main/Load/Tags/Lights.luau rename to src/server/main/Map/Load/Tags/Lights.luau diff --git a/src/server/main/Load/Tags/init.luau b/src/server/main/Map/Load/Tags/init.luau similarity index 94% rename from src/server/main/Load/Tags/init.luau rename to src/server/main/Map/Load/Tags/init.luau index a92b662..c110942 100644 --- a/src/server/main/Load/Tags/init.luau +++ b/src/server/main/Map/Load/Tags/init.luau @@ -32,7 +32,7 @@ type Impl_Static_Props = { type Constructor_Fun = () -> ClassConstructor type Constructor_Return_Props = { - __export: ExportedTags + __dump: ExportedTags } export type Lantern = { @@ -58,7 +58,7 @@ export type Lanterns = { export type LanternsTree = { [Enums.ElevatorValues]: Lanterns -} +} export type LightSwitchProperties = { Switch: Instance?, @@ -91,7 +91,7 @@ export type LightSwitchTree = { } export type InteractablesTree = { - LightSwitches: LightSwitchTree + LightSwitches: LightSwitchTree } export type ButtonDictionary = { @@ -112,7 +112,7 @@ export type RelayDictionary = { } export type ButtonsTree = { - [Enums.ElevatorValues]: { + [Enums.ElevatorValues]: { Car: ButtonDictionary, Landing: ButtonDictionary, Special: ButtonDictionary, @@ -171,7 +171,7 @@ Tags.Decoders = { function Tags.constructor() local Exports: ExportedTags = {} local AllTags = CS:GetAllTags() - + for n: number = 1, #AllTags do local TagName = AllTags[n] local Tagged = CS:GetTagged(TagName) @@ -179,16 +179,16 @@ function Tags.constructor() end return setmetatable({ - __export = Exports + __dump = Exports }, Tags) end function Tags:Request(Name) - return self.__export[Name] or error(`Error requesting tag name, tag name "{Name}" does not exist.`, 2) + return self.__dump[Name] or error(`Error requesting tag name, tag name "{Name}" does not exist.`, 2) end function Tags:Nuke() - for i: string, v: TagProduct in self.__export do + for i: string, v: TagProduct in self.__dump do if type(v) == "table" then for n: number = 1, #v do CS:RemoveTag(v[n], i) @@ -208,7 +208,7 @@ function Tags:__ElevatorLanterns() for _, EnumValue in Enums.Elevator do Lanterns[EnumValue :: Enums.ElevatorValues] = {} - for TagName: string, Inst: TagProduct in self.__export do + for TagName: string, Inst: TagProduct in self.__dump do local Split = TagName:split('_') local LanternModel = Split[1] local IndicatorType = Split[2] @@ -216,7 +216,7 @@ function Tags:__ElevatorLanterns() if LanternModel == (EnumValue :: string) and IndicatorType == "DirectionIndicator" then local Floor = tonumber(FloorHint) - + if Floor then if not Lanterns[EnumValue :: Enums.ElevatorValues][Floor] then local Light = ((Inst :: BasePart).Parent :: Instance):FindFirstChild("Light") :: BasePart? @@ -266,7 +266,7 @@ function Tags:__ElevatorButtons() for _, EnumValue in Enums.Elevator do Buttons[EnumValue :: Enums.ElevatorValues] = {} - for TagName: string, Inst: TagProduct in self.__export do + for TagName: string, Inst: TagProduct in self.__dump do local Split = TagName:split('_') local ModelHint = Split[1] local ButtonHint = Split[2] @@ -291,7 +291,7 @@ function Tags:__ElevatorDoors() for _, EnumValue in Enums.Elevator do Doors[EnumValue :: Enums.ElevatorValues] = {} - for TagName: string, Inst: TagProduct in self.__export do + for TagName: string, Inst: TagProduct in self.__dump do local Split = TagName:split('_') local ModelHint = Split[1] local FloorHint = Split[2] @@ -306,7 +306,7 @@ function Tags:__ElevatorDoors() if FloorNumber then local DoorNumberPlacement = tonumber(DoorNumber) - + if DoorNumberPlacement then if not Doors[ModelHint][FloorNumber] then Doors[ModelHint][FloorNumber] = {} @@ -314,7 +314,7 @@ function Tags:__ElevatorDoors() if typeof(Inst) ~= "Instance" then Inst = Inst[1] warn(`[{ModelHint}] Door {Inst} was not a single instance, duplicate doors detected Tag={TagName}`) - end + end table.insert(Doors[ModelHint][FloorNumber], DoorNumberPlacement, Inst :: Instance) else @@ -338,7 +338,7 @@ function Tags:__Interactables() LightSwitches = {} } - for TagName: string, Inst: TagProduct in self.__export do + for TagName: string, Inst: TagProduct in self.__dump do local Split = TagName:split('_') local InteractHint = Split[1] local InteractType = Split[2] @@ -377,7 +377,7 @@ function Tags:__Interactables() ptr.Lights = {} table.insert(ptr.Lights :: {Instance}, Inst) end - + elseif InteractType == Enums.InteractType.LightSource then ptr.LightSources = (type(Inst) == "table" and Inst or {Inst :: Instance}) :: {Instance} end @@ -387,4 +387,4 @@ function Tags:__Interactables() return Interactables end -return Tags \ No newline at end of file +return Tags diff --git a/src/server/main/Load/Workspace.luau b/src/server/main/Map/Load/Workspace.luau similarity index 100% rename from src/server/main/Load/Workspace.luau rename to src/server/main/Map/Load/Workspace.luau diff --git a/src/server/main/Types/Elevator.luau b/src/server/main/Types/Elevator.luau index e67d7aa..94f9dcc 100644 --- a/src/server/main/Types/Elevator.luau +++ b/src/server/main/Types/Elevator.luau @@ -1,5 +1,4 @@ -local MainDir = script.Parent.Parent -local EnumsDir = MainDir:WaitForChild("Enums") +local EnumsDir = script.Parent:WaitForChild("Enums") local StorageService = game:GetService("ReplicatedStorage") diff --git a/src/server/main/Enums/Sounds.luau b/src/server/main/Types/Enums/Sounds.luau similarity index 100% rename from src/server/main/Enums/Sounds.luau rename to src/server/main/Types/Enums/Sounds.luau diff --git a/src/server/main/init.server.luau b/src/server/main/init.server.luau index 0e26ab6..9580762 100644 --- a/src/server/main/init.server.luau +++ b/src/server/main/init.server.luau @@ -6,29 +6,33 @@ local ShowEditorEntities = true local Storage = game:GetService("ReplicatedStorage") -local _PlayerAdded = require(script:WaitForChild("PlayerAdded")) -local Lighting_Stuff = require(script:WaitForChild("Lighting")) +--Prerequisite loading, do not put more code above this +local _PlayerAdded = require(script:WaitForChild("PlayerAdded")) +-- -local Load = script:WaitForChild("Load") +local MapDir = script:WaitForChild("Map") +local Lighting_Stuff = require(MapDir:WaitForChild("Lighting")) + +local Load = MapDir:WaitForChild("Load") local TagsModule = require(Load:WaitForChild("Tags")) local HideEditorEntities = require(Load:WaitForChild("EditorEntities")) local Workspace_Stuff = require(Load:WaitForChild("Workspace")) local StarterPlayer_Stuff = require(Load:WaitForChild("StarterPlayer")) -local Elevators = script:WaitForChild("Elevators") -local Elevator = Elevators:WaitForChild("Elevator") -local Maps = script:WaitForChild("Map") +local Elevators = script:WaitForChild("Elevators") +local MapElevators = Elevators:WaitForChild("Map") +local Map = script:WaitForChild("Map") -local Interactions = Maps:WaitForChild("Interactions") +local Interactions = Map:WaitForChild("Interactions") local LightSwitches = require(Interactions:WaitForChild("LightSwitches")) ---local Otis1960 = require(Elevators:WaitForChild("Elevator"):WaitForChild("Otis1960")) -local Haughton = require(Elevator:WaitForChild("Haughton")) +--local Otis1960 = require(Elevators:WaitForChild("Elevator"):WaitForChild("Otis1960")) +local Haughton = require(MapElevators:WaitForChild("Haughton")) local Enums = require(Storage:WaitForChild("Enums")) local TagsConstructor = TagsModule.constructor() -print("[DEBUG] Tags=", TagsConstructor.__export) +print("[DEBUG] Tags=", TagsConstructor.__dump) HideEditorEntities.indexAll(ShowEditorEntities) TagsConstructor:Nuke()