mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 06:41:55 +00:00
Huge structural change and plumbing
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -3,17 +3,17 @@
|
||||
|
||||
local ParentDir = script.Parent
|
||||
local ElevatorDir = ParentDir.Parent
|
||||
local ElevatorsDir = ElevatorDir.Parent
|
||||
local MainDir = ElevatorsDir.Parent
|
||||
local MainDir = ElevatorDir.Parent
|
||||
local MapDir = MainDir.Parent
|
||||
|
||||
local StorageService = game:GetService("ReplicatedStorage")
|
||||
|
||||
local InitElevator = require(ElevatorDir)
|
||||
local Enums = require(StorageService:WaitForChild("Enums"))
|
||||
local InitElevator = require(ElevatorsDir:WaitForChild("System"))
|
||||
local Buttons = require(ElevatorDir:WaitForChild("Buttons"))
|
||||
local Doors = require(ElevatorDir:WaitForChild("Doors"))
|
||||
local TagsModule = require(MainDir:WaitForChild("Map"):WaitForChild("Load"):WaitForChild("Tags"))
|
||||
local ElevatorTypes = require(MainDir:WaitForChild("Types"):WaitForChild("Elevator"))
|
||||
local TagsModule = require(MapDir:WaitForChild("Load"):WaitForChild("Tags"))
|
||||
local ElevatorTypes = require(MapDir:WaitForChild("Types"):WaitForChild("Elevator"))
|
||||
|
||||
type ClassConstructor = typeof(setmetatable({} :: Constructor_Return_Props, {} :: Impl_Constructor))
|
||||
type Impl_Constructor = {
|
||||
|
||||
@@ -2,13 +2,12 @@
|
||||
--!strict
|
||||
|
||||
local Elevators = script.Parent.Parent.Parent
|
||||
local Main = Elevators.Parent
|
||||
local Map = Elevators.Parent
|
||||
|
||||
local Storage = game:GetService("ReplicatedStorage")
|
||||
|
||||
local Enums = require(Storage:WaitForChild("Enums"))
|
||||
|
||||
local Map = Main:WaitForChild("Map")
|
||||
local PromptModule = require(Map:WaitForChild("Prompts"))
|
||||
local Tags = require(Map:WaitForChild("Load"):WaitForChild("Tags"))
|
||||
|
||||
@@ -37,7 +36,9 @@ ButtonFunctions.__index = ButtonFunctions
|
||||
|
||||
--ButtonTags.ButtonsConstructor
|
||||
function ButtonFunctions.constructor(CurrentFloor)
|
||||
return setmetatable({CurrentFloor = CurrentFloor}, ButtonFunctions)
|
||||
return setmetatable({
|
||||
CurrentFloor = CurrentFloor
|
||||
}, ButtonFunctions)
|
||||
end
|
||||
|
||||
function ButtonFunctions:CarButton(ButtonID, ButtonTree, Callback, Fallback)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
local ParentDir = script.Parent
|
||||
local ElevatorDir = ParentDir.Parent
|
||||
local MainDir = ElevatorDir.Parent
|
||||
local TagsModule = MainDir:WaitForChild("Map"):WaitForChild("Load"):WaitForChild("Tags")
|
||||
local TagsModule = MainDir:WaitForChild("Load"):WaitForChild("Tags")
|
||||
|
||||
local StorageService = game:GetService("ReplicatedStorage")
|
||||
|
||||
|
||||
@@ -2,17 +2,16 @@
|
||||
--!strict
|
||||
|
||||
local ParentDir = script.Parent
|
||||
local ElevatorsDir = ParentDir.Parent
|
||||
local ElevatorsDir = ParentDir.Parent.Parent
|
||||
local MainDir = ElevatorsDir.Parent
|
||||
|
||||
local Storage = game:GetService("ReplicatedStorage")
|
||||
local RS = game:GetService("RunService")
|
||||
|
||||
local Types = MainDir:WaitForChild("Types")
|
||||
local Types = ElevatorsDir:WaitForChild("Types")
|
||||
|
||||
local GCSignal = require(Storage:WaitForChild("GCSignal"))
|
||||
local DoorEnums = require(Types:WaitForChild("Enums"):WaitForChild("Doors"))
|
||||
local ElevatorEnums = require(Types:WaitForChild("Elevator"))
|
||||
local ElevatorTypes = require(Types:WaitForChild("Elevator"))
|
||||
local Tags = require(MainDir:WaitForChild("Map"):WaitForChild("Load"):WaitForChild("Tags"))
|
||||
local Algebra = require(Storage:WaitForChild("Algebra"))
|
||||
|
||||
@@ -28,9 +27,8 @@ type Impl_Constructor = {
|
||||
}
|
||||
|
||||
type Constructor_Fun = (
|
||||
LevelingFloors: {number},
|
||||
Config: ElevatorTypes.ElevatorConfigurationTable,
|
||||
ElevatorBox: BasePart,
|
||||
DoorConfig: ElevatorEnums.DoorsConfig,
|
||||
DoorsTree: Tags.LandingTags
|
||||
) -> ClassConstructor
|
||||
|
||||
@@ -46,7 +44,7 @@ type Attributes = {
|
||||
}
|
||||
|
||||
type Constructor_Return_Props = {
|
||||
DoorConfig: ElevatorEnums.DoorsConfig,
|
||||
Config: ElevatorTypes.ElevatorConfigurationTable,
|
||||
ElevatorBox: BasePart,
|
||||
DoorsTree: Tags.LandingTags,
|
||||
Attributes: Attributes,
|
||||
@@ -64,7 +62,7 @@ export type constructor = ClassConstructor
|
||||
local Doors = {} :: Impl_Constructor
|
||||
Doors.__index = Doors
|
||||
|
||||
function Doors.constructor(LevelingFloors, ElevatorBox, DoorConfig, DoorsTree)
|
||||
function Doors.constructor(Config, ElevatorBox, DoorsTree)
|
||||
local CabOpenAttribute = Instance.new("BoolValue") :: BoolValue
|
||||
local DoorAttributes = {
|
||||
Hall = {},
|
||||
@@ -72,14 +70,14 @@ function Doors.constructor(LevelingFloors, ElevatorBox, DoorConfig, DoorsTree)
|
||||
Open = CabOpenAttribute
|
||||
}
|
||||
}
|
||||
for n: number = 1, #LevelingFloors do
|
||||
for n: number = 1, #Config.Leveling do
|
||||
DoorAttributes.Hall[n] = {
|
||||
Open = Instance.new("BoolValue") :: BoolValue
|
||||
}
|
||||
end
|
||||
|
||||
return setmetatable({
|
||||
DoorConfig = DoorConfig,
|
||||
Config = Config,
|
||||
ElevatorBox = ElevatorBox,
|
||||
DoorsTree = DoorsTree,
|
||||
Attributes = DoorAttributes,
|
||||
@@ -88,7 +86,7 @@ function Doors.constructor(LevelingFloors, ElevatorBox, DoorConfig, DoorsTree)
|
||||
end
|
||||
|
||||
type DoorAnimationCallback<T...> = (self: ClassConstructor, Time: number, T...) -> ()
|
||||
local function DoorAnimationRuntime(self: ClassConstructor, Time: number, Type: DoorEnums.DoorLocationValues, Callback: DoorAnimationCallback<()>): Signal
|
||||
local function DoorAnimationRuntime(self: ClassConstructor, Time: number, Type: ElevatorTypes.DoorLocations, Callback: DoorAnimationCallback<()>): Signal
|
||||
if self.__Connections[Type] and self.__Connections[Type].Connected then
|
||||
self.__Connections[Type]:Disconnect()
|
||||
end
|
||||
@@ -189,16 +187,16 @@ end
|
||||
---
|
||||
|
||||
--this is ridiculous optimization tech
|
||||
local function OpenVecTuple(self: ClassConstructor, Opening: boolean, Type: DoorEnums.DoorLocationValues, HallFloor: number?): ...Vector3?
|
||||
if Type == DoorEnums.DoorLocation.Landing and not HallFloor then
|
||||
local function OpenVecTuple(self: ClassConstructor, Opening: boolean, Type: ElevatorTypes.DoorLocations, HallFloor: number?): ...Vector3?
|
||||
if Type == "Landing" and not HallFloor then
|
||||
warn("Hall/landing doors were called but no HallFloor number was received")
|
||||
return nil
|
||||
end
|
||||
|
||||
local DoorsType: {Instance?}? = Type == DoorEnums.DoorLocation.Cab and self.DoorsTree.Cab or self.DoorsTree.Hall[HallFloor :: number]
|
||||
local ConfType = Type == DoorEnums.DoorLocation.Cab and self.DoorConfig.Cab or self.DoorConfig.Landing
|
||||
local DoorsType: {Instance?}? = Type == "Cab" and self.DoorsTree.Cab or self.DoorsTree.Hall[HallFloor :: number]
|
||||
local ConfType = Type == "Cab" and self.Config.Doors.Cab or self.Config.Doors.Landing
|
||||
|
||||
if ConfType.Type == DoorEnums.Door.SingleSpeed then
|
||||
if ConfType.Type == "SingleSpeed" then
|
||||
if DoorsType and DoorsType[1] then
|
||||
local P = (DoorsType[1] :: BasePart).Position
|
||||
local Direction = Opening and -ConfType.Goal or ConfType.Goal
|
||||
@@ -208,7 +206,7 @@ local function OpenVecTuple(self: ClassConstructor, Opening: boolean, Type: Door
|
||||
Direction
|
||||
})
|
||||
end
|
||||
elseif ConfType.Type == DoorEnums.Door.DoubleSpeed then
|
||||
elseif ConfType.Type == "DoubleSpeed" then
|
||||
if DoorsType and DoorsType[1] and DoorsType[2] then
|
||||
local P = (DoorsType[1] :: BasePart).Position
|
||||
local P2 = (DoorsType[2] :: BasePart).Position
|
||||
@@ -221,7 +219,7 @@ local function OpenVecTuple(self: ClassConstructor, Opening: boolean, Type: Door
|
||||
Direction/2
|
||||
})
|
||||
end
|
||||
elseif ConfType.Type == DoorEnums.Door.TripleSpeed then
|
||||
elseif ConfType.Type == "TripleSpeed" then
|
||||
--idk man
|
||||
if DoorsType and DoorsType[1] and DoorsType[2] and DoorsType[3] then
|
||||
local P = (DoorsType[1] :: BasePart).Position
|
||||
@@ -243,12 +241,12 @@ local function OpenVecTuple(self: ClassConstructor, Opening: boolean, Type: Door
|
||||
end
|
||||
|
||||
--this module is built off my insanity
|
||||
local function ToggleDoors(self: ClassConstructor, Type: DoorEnums.DoorLocationValues, Opening: boolean, Floor: number?): boolean
|
||||
local Config: ElevatorEnums.DoorsConfigProperties? = Type == DoorEnums.DoorLocation.Cab and self.DoorConfig.Cab or self.DoorConfig.Landing
|
||||
local function ToggleDoors(self: ClassConstructor, Type: ElevatorTypes.DoorLocations, Opening: boolean, Floor: number?): boolean
|
||||
local Config: ElevatorTypes.DoorsConfigProperties? = Type == "Cab" and self.Config.Doors.Cab or self.Config.Doors.Landing
|
||||
if Config then
|
||||
local P1, P2, P3, P4, P5, P6 = OpenVecTuple(self, Opening, Type, Floor)
|
||||
if P1 then
|
||||
if Type == DoorEnums.DoorLocation.Cab then
|
||||
if Type == "Cab" then
|
||||
local FinishedSignal = DoorAnimationRuntime(self, Config.Time, Type, function(self, AnimationTime)
|
||||
DoorAnimations.Cab[Config.Type](self, AnimationTime, P1, P2, P3, P4, P5, P6)
|
||||
end)
|
||||
@@ -256,7 +254,7 @@ local function ToggleDoors(self: ClassConstructor, Type: DoorEnums.DoorLocationV
|
||||
self.Attributes.Cab.Open.Value = Opening
|
||||
end)
|
||||
return true
|
||||
elseif Type == DoorEnums.DoorLocation.Landing then
|
||||
elseif Type == "Landing" then
|
||||
local FinishedSignal = DoorAnimationRuntime(self, Config.Time, Type, function(self, AnimationTime)
|
||||
DoorAnimations.Landing[Config.Type](self, Floor, AnimationTime, P1, P2, P3, P4, P5, P6)
|
||||
end)
|
||||
@@ -278,7 +276,7 @@ function Doors:OpenCabAsync()
|
||||
warn("Elevator doors already open")
|
||||
return false
|
||||
end
|
||||
return ToggleDoors(self, DoorEnums.DoorLocation.Cab, true)
|
||||
return ToggleDoors(self, "Cab", true)
|
||||
end
|
||||
|
||||
function Doors:CloseCabAsync()
|
||||
@@ -286,7 +284,7 @@ function Doors:CloseCabAsync()
|
||||
warn("Elevator doors already closed")
|
||||
return false
|
||||
end
|
||||
return ToggleDoors(self, DoorEnums.DoorLocation.Cab, false)
|
||||
return ToggleDoors(self, "Cab", false)
|
||||
end
|
||||
|
||||
function Doors:OpenAtFloor(Floor)
|
||||
@@ -294,7 +292,7 @@ function Doors:OpenAtFloor(Floor)
|
||||
warn(`Elevator doors at floor "{Floor}" already open`)
|
||||
return false
|
||||
end
|
||||
return ToggleDoors(self, DoorEnums.DoorLocation.Landing, true, Floor)
|
||||
return ToggleDoors(self, "Landing", true, Floor)
|
||||
end
|
||||
|
||||
function Doors:CloseAtFloor(Floor)
|
||||
@@ -302,7 +300,7 @@ function Doors:CloseAtFloor(Floor)
|
||||
warn(`Elevator doors at floor "{Floor}" already closed`)
|
||||
return false
|
||||
end
|
||||
return ToggleDoors(self, DoorEnums.DoorLocation.Landing, false, Floor)
|
||||
return ToggleDoors(self, "Landing", false, Floor)
|
||||
end
|
||||
|
||||
return Doors
|
||||
@@ -1,9 +1,10 @@
|
||||
--!optimize 2
|
||||
--!strict
|
||||
|
||||
local MainDir = script.Parent.Parent.Parent.Parent
|
||||
local TagsModule = require(MainDir:WaitForChild("Map"):WaitForChild("Load"):WaitForChild("Tags"))
|
||||
local ElevatorTypes = require(MainDir:WaitForChild("Types"):WaitForChild("Elevator"))
|
||||
local MainDir = script.Parent.Parent.Parent
|
||||
local MapDir = MainDir.Parent
|
||||
local TagsModule = require(MapDir:WaitForChild("Load"):WaitForChild("Tags"))
|
||||
local ElevatorTypes = require(MapDir:WaitForChild("Types"):WaitForChild("Elevator"))
|
||||
|
||||
local TS = game:GetService("TweenService")
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
--!strict
|
||||
|
||||
local Elevators = script.Parent
|
||||
local MainDir = Elevators.Parent
|
||||
local MapDir = MainDir:WaitForChild("Map")
|
||||
local MapDir = Elevators.Parent
|
||||
local LoadDir = MapDir:WaitForChild("Load")
|
||||
|
||||
local RunService = game:GetService("RunService")
|
||||
@@ -13,7 +12,7 @@ local TweenService = game:GetService("TweenService")
|
||||
local Enums = require(StorageService:WaitForChild("Enums"))
|
||||
local Out = require(StorageService:WaitForChild("Output"))
|
||||
local Algebra = require(StorageService:WaitForChild("Algebra"))
|
||||
local ElevatorTypes = require(MainDir:WaitForChild("Types"):WaitForChild("Elevator"))
|
||||
local ElevatorTypes = require(MapDir:WaitForChild("Types"):WaitForChild("Elevator"))
|
||||
local Tags = require(LoadDir:WaitForChild("Tags"))
|
||||
local RelayAlgorithm = require(script:WaitForChild("RelayAlgorithm"))
|
||||
|
||||
@@ -34,13 +33,11 @@ type Impl_Constructor = {
|
||||
type FloorLevelingPositions = {number}
|
||||
type Constructor_Fun = (
|
||||
ElevatorBoxModel: BasePart,
|
||||
ElevatorConfigurationTable: ElevatorTypes.ElevatorConfigurationTable,
|
||||
FloorLevelingPositions: FloorLevelingPositions
|
||||
ElevatorConfigurationTable: ElevatorTypes.ElevatorConfigurationTable
|
||||
) -> ClassConstructor
|
||||
|
||||
type Constructor_Return_Props = {
|
||||
RelayAlgorithm: RelayAlgorithm.RelayAlgorithmConstructor,
|
||||
FloorLevelingPositions: FloorLevelingPositions,
|
||||
eprint: <T...>(T...) -> (),
|
||||
ewarn: <T...>(T...) -> (),
|
||||
eprintStudio: <T...>(T...) -> (),
|
||||
@@ -100,8 +97,8 @@ local function ElevatorGoingUpDirection(CurrentFloor: number, RequestedFloor: nu
|
||||
return CurrentFloor<RequestedFloor
|
||||
end
|
||||
|
||||
function Elevator.constructor(ElevatorBoxModel, ElevatorConfigurationTable, FloorLevelingPositions)
|
||||
assert(#FloorLevelingPositions>1, `"{ElevatorConfigurationTable.Name}" requires more floors to operate. Floors={FloorLevelingPositions}, #Floors={#FloorLevelingPositions}.`)
|
||||
function Elevator.constructor(ElevatorBoxModel, ElevatorConfigurationTable)
|
||||
assert(#ElevatorConfigurationTable.Leveling>1, `"{ElevatorConfigurationTable.Name}" requires more floors to operate. Floors={ElevatorConfigurationTable.Leveling}, #Floors={#ElevatorConfigurationTable.Leveling}.`)
|
||||
|
||||
local function eprint<T...>(...: T...)
|
||||
print(`[{ElevatorConfigurationTable.Name}]:`, ...)
|
||||
@@ -163,7 +160,6 @@ function Elevator.constructor(ElevatorBoxModel, ElevatorConfigurationTable, Floo
|
||||
|
||||
local ElevatorClass = setmetatable({
|
||||
RelayAlgorithm = RelayAlgorithmConstructor,
|
||||
FloorLevelingPositions = FloorLevelingPositions,
|
||||
eprint = eprint,
|
||||
ewarn = ewarn,
|
||||
eprintStudio = eprintStudio,
|
||||
@@ -204,7 +200,7 @@ function Elevator.constructor(ElevatorBoxModel, ElevatorConfigurationTable, Floo
|
||||
if AddedFloorDirection == (ElevatorClass.Attributes.TravelingUpwards.Value and Enums.ElevatorCallDirection.Up or Enums.ElevatorCallDirection.Down) then
|
||||
local NextFloorAsTraveling = FloorDirectionQueue[1]
|
||||
if NextFloorAsTraveling then
|
||||
local Level = FloorLevelingPositions[NextFloorAsTraveling]
|
||||
local Level = ElevatorConfigurationTable.Leveling[NextFloorAsTraveling]
|
||||
ElevatorClass:__TravelToFloorAsync(Level, Vector3.new(0, Level, 0))
|
||||
end
|
||||
ElevatorClass.eprintStudio(`Floors sorted in proceeding direction. direction={AddedFloorDirection}, FloorDirectionQueue={FloorDirectionQueue}`)
|
||||
@@ -289,7 +285,7 @@ local function CheckFloorQueue(self: ClassConstructor)
|
||||
end
|
||||
|
||||
local function FloorsClamp(self: ClassConstructor, n: number): number
|
||||
return Algebra.minmax(1, n, #self.FloorLevelingPositions)
|
||||
return Algebra.minmax(1, n, #self.Elevator.Configuration.Leveling)
|
||||
end
|
||||
|
||||
local Debounce = {
|
||||
@@ -300,7 +296,7 @@ local Debounce = {
|
||||
@native
|
||||
local function CabTraveling(self: ClassConstructor, deltaTime: number, LEVEL_VEC3_Y_WRAP: Vector3)
|
||||
local ElevatorPosition = self.Elevator.BoxModel.Position
|
||||
local AtFloorY = self.FloorLevelingPositions[FloorsClamp(self, self.Attributes.TravelingUpwards.Value and self.Attributes.CurrentFloor.Value+1 or self.Attributes.CurrentFloor.Value-1)]
|
||||
local AtFloorY = self.Elevator.Configuration.Leveling[FloorsClamp(self, self.Attributes.TravelingUpwards.Value and self.Attributes.CurrentFloor.Value+1 or self.Attributes.CurrentFloor.Value-1)]
|
||||
|
||||
if self.Attributes.TravelingUpwards.Value then
|
||||
--Detecting between the floors
|
||||
@@ -373,7 +369,7 @@ local function CabTraveling(self: ClassConstructor, deltaTime: number, LEVEL_VEC
|
||||
end
|
||||
|
||||
function Elevator:GetLevel(Level_Int)
|
||||
local Level = self.FloorLevelingPositions[Level_Int]
|
||||
local Level = self.Elevator.Configuration.Leveling[Level_Int]
|
||||
if Level then
|
||||
--local VEC3_Y_WRAP_LOSSY = Vector3.yAxis*Level
|
||||
return Vector3.new(0, Level, 0)
|
||||
@@ -418,7 +414,7 @@ function Elevator:RequestLevelAsync(RequestedLevel, Direction)
|
||||
if (RequestedLevel == 1 and Direction == Enums.ElevatorCallDirection.Down) then
|
||||
self.ewarnStudio(`Impossible direction requested, Direction={Direction}, RequestedLevel={RequestedLevel}. correcting...`)
|
||||
Direction = Enums.ElevatorCallDirection.Up
|
||||
elseif (RequestedLevel == #self.FloorLevelingPositions and Direction == Enums.ElevatorCallDirection.Up) then
|
||||
elseif (RequestedLevel == #self.Elevator.Configuration.Leveling and Direction == Enums.ElevatorCallDirection.Up) then
|
||||
self.ewarnStudio(`Impossible direction requested, Direction={Direction}, RequestedLevel={RequestedLevel}. correcting...`)
|
||||
Direction = Enums.ElevatorCallDirection.Down
|
||||
end
|
||||
|
||||
@@ -9,7 +9,6 @@ local StorageService = game:GetService("ReplicatedStorage")
|
||||
local Types = MainDir:WaitForChild("Types")
|
||||
local Enums = require(StorageService:WaitForChild("Enums"))
|
||||
local ElevatorTypes = require(Types:WaitForChild("Elevator"))
|
||||
local DoorEnums = require(Types:WaitForChild("Enums"):WaitForChild("Doors"))
|
||||
--local SoundEnums = require(Types:WaitForChild("Enums"):WaitForChild("Sounds"))
|
||||
|
||||
local HaughtonConfig = {} :: ElevatorTypes.ElevatorConfigurationTable
|
||||
@@ -25,9 +24,11 @@ HaughtonConfig.ParkedSmoothingTime = 1
|
||||
HaughtonConfig.Responsiveness = 5
|
||||
HaughtonConfig.MaxVelocity = 7
|
||||
HaughtonConfig.MaxVelocitySmoothingTime = 5
|
||||
|
||||
HaughtonConfig.Functions = {
|
||||
ManualTravelStart = true
|
||||
}
|
||||
|
||||
HaughtonConfig.Colors = {
|
||||
ButtonActivated = {
|
||||
Color = Color3.fromRGB(162,106,76),
|
||||
@@ -38,6 +39,7 @@ HaughtonConfig.Colors = {
|
||||
Material = Enum.Material.SmoothPlastic
|
||||
}
|
||||
}
|
||||
|
||||
HaughtonConfig.Lanterns = {
|
||||
On = {
|
||||
Up = {
|
||||
@@ -64,55 +66,30 @@ HaughtonConfig.Lanterns = {
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
HaughtonConfig.Doors = {
|
||||
Cab = {
|
||||
Type = DoorEnums.Door.DoubleSpeed,
|
||||
Type = "DoubleSpeed",
|
||||
Time = 5,
|
||||
Goal = Vector3.new(4.027)
|
||||
},
|
||||
Landing = {
|
||||
Type = DoorEnums.Door.SingleSpeed,
|
||||
Type = "SingleSpeed",
|
||||
Time = 5,
|
||||
Goal = Vector3.new(4.221)
|
||||
}
|
||||
}
|
||||
|
||||
--config to JSON needs work
|
||||
--[[
|
||||
{
|
||||
"Doors": {
|
||||
"Landing": { "Type": "SingleSpeed", "Time": 5, "Goal": null },
|
||||
"Cab": { "Type": "DoubleSpeed", "Time": 5, "Goal": null }
|
||||
},
|
||||
"FloorLeveling3PhaseDistance": 1.5,
|
||||
"Lanterns": {
|
||||
"On": {
|
||||
"Down": { "Color": null, "Material": null, "Time": 1 },
|
||||
"Up": { "Color": null, "Material": null, "Time": 1 }
|
||||
},
|
||||
"Off": {
|
||||
"Down": { "Color": null, "Material": null, "Time": 1 },
|
||||
"Up": { "Color": null, "Material": null, "Time": 1 }
|
||||
}
|
||||
},
|
||||
"TravelType": "Traction",
|
||||
"Responsiveness": 5,
|
||||
"Phase3LevelingVelocity": 0.5,
|
||||
"ParkedSmoothingTime": 1,
|
||||
"Colors": {
|
||||
"ButtonDeactivated": { "Color": null, "Material": null },
|
||||
"ButtonActivated": { "Color": null, "Material": null }
|
||||
},
|
||||
"Functions": { "ManualTravelStart": true },
|
||||
"MaxVelocitySmoothingTime": 5,
|
||||
"Name": "Haughton",
|
||||
"MaxVelocity": 7,
|
||||
"LevelingVelocity": 0.5,
|
||||
"ParkedDistance": 0.2,
|
||||
"LevelingVelocitySmoothingTime": 1,
|
||||
"FloorLevelingDistance": 6
|
||||
HaughtonConfig.Leveling = {
|
||||
[1] = 1.163, --Basement
|
||||
[2] = 19.163,
|
||||
[3] = 36.053,
|
||||
[4] = 53.005,
|
||||
[5] = 69.977,
|
||||
[6] = 86.948,
|
||||
[7] = 103.913,
|
||||
[8] = 120.891,
|
||||
}
|
||||
]]
|
||||
|
||||
return {
|
||||
HaughtonConfig = HaughtonConfig
|
||||
|
||||
@@ -5,7 +5,7 @@ local ParentDir = script.Parent
|
||||
local ElevatorsDir = ParentDir.Parent.Parent
|
||||
local MainDir = ElevatorsDir.Parent
|
||||
|
||||
local ElevatorSystem = ElevatorsDir:WaitForChild("System")
|
||||
local ElevatorSystem = ElevatorsDir:WaitForChild("Elevator")
|
||||
|
||||
local InitElevator = require(ElevatorSystem)
|
||||
local ArrowLanterns = require(ElevatorSystem:WaitForChild("Lanterns"):WaitForChild("Arrows"))
|
||||
@@ -31,7 +31,6 @@ type Constructor_Fun = (
|
||||
ArrowLanternsConstructor: ArrowLanterns.constructor,
|
||||
ButtonsConstructor: Buttons.constructor,
|
||||
ElevatorBoxModel: BasePart,
|
||||
Leveling: {number},
|
||||
MovingObjectsConstructor: MovingObjects.constructor,
|
||||
TractionRopesConstructor: TractionRopes.constructor
|
||||
) -> ClassConstructor
|
||||
@@ -43,7 +42,6 @@ type Constructor_Return_Props = {
|
||||
ArrowLanternsConstructor: ArrowLanterns.constructor,
|
||||
ButtonsConstructor: Buttons.constructor,
|
||||
ElevatorBoxModel: BasePart,
|
||||
Leveling: {number},
|
||||
MovingObjectsConstructor: MovingObjects.constructor,
|
||||
TractionRopesConstructor: TractionRopes.constructor
|
||||
}
|
||||
@@ -58,7 +56,6 @@ function Events.constructor(
|
||||
ArrowLanternsConstructor,
|
||||
ButtonsConstructor,
|
||||
ElevatorBoxModel,
|
||||
Leveling,
|
||||
MovingObjectsConstructor,
|
||||
TractionRopesConstructor
|
||||
)
|
||||
@@ -69,7 +66,6 @@ function Events.constructor(
|
||||
ArrowLanternsConstructor = ArrowLanternsConstructor,
|
||||
ButtonsConstructor = ButtonsConstructor,
|
||||
ElevatorBoxModel = ElevatorBoxModel,
|
||||
Leveling = Leveling,
|
||||
MovingObjectsConstructor = MovingObjectsConstructor,
|
||||
TractionRopesConstructor = TractionRopesConstructor
|
||||
}, Events)
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
--!optimize 2
|
||||
--!strict
|
||||
|
||||
return {
|
||||
[1] = 1.163, --Basement
|
||||
[2] = 19.163,
|
||||
[3] = 36.053,
|
||||
[4] = 53.005,
|
||||
[5] = 69.977,
|
||||
[6] = 86.948,
|
||||
[7] = 103.913,
|
||||
[8] = 120.891,
|
||||
}
|
||||
@@ -5,7 +5,7 @@ local ParentDir = script.Parent
|
||||
local ElevatorsDir = ParentDir.Parent
|
||||
local MainDir = ElevatorsDir.Parent.Parent
|
||||
|
||||
local TagsModule = require(MainDir:WaitForChild("Map"):WaitForChild("Load"):WaitForChild("Tags"))
|
||||
local TagsModule = require(MainDir:WaitForChild("Load"):WaitForChild("Tags"))
|
||||
|
||||
type ClassConstructor = typeof(setmetatable({} :: Constructor_Return_Props, {} :: Impl_Constructor))
|
||||
type Impl_Constructor = {
|
||||
|
||||
@@ -7,7 +7,7 @@ local ParentDir = script.Parent
|
||||
local ElevatorsDir = ParentDir.Parent
|
||||
local MainDir = ElevatorsDir.Parent
|
||||
|
||||
local ElevatorSystem = ElevatorsDir:WaitForChild("System")
|
||||
local ElevatorSystem = ElevatorsDir:WaitForChild("Elevator")
|
||||
|
||||
local ElevatorTypes = require(MainDir:WaitForChild("Types"):WaitForChild("Elevator"))
|
||||
local InitElevator = require(ElevatorSystem)
|
||||
@@ -16,9 +16,8 @@ local Buttons = require(ElevatorSystem:WaitForChild("Buttons"))
|
||||
local TractionRopes = require(ElevatorSystem:WaitForChild("TractionRopes"))
|
||||
local Doors = require(ElevatorSystem:WaitForChild("Doors"))
|
||||
local Events = require(script:WaitForChild("Events"))
|
||||
local Leveling = require(script:WaitForChild("Leveling"))
|
||||
local MovingObjects = require(script:WaitForChild("MovingObjects"))
|
||||
local TagsModule = require(MainDir:WaitForChild("Map"):WaitForChild("Load"):WaitForChild("Tags"))
|
||||
local TagsModule = require(MainDir:WaitForChild("Load"):WaitForChild("Tags"))
|
||||
|
||||
return function(
|
||||
Config: ElevatorTypes.ElevatorConfigurationTable,
|
||||
@@ -31,24 +30,19 @@ return function(
|
||||
local CabRopesObject = TagsConstructor:Request(`{Config.Name}_Rope_Cab`) :: BasePart
|
||||
local ElevatorBoxModel = ElevatorModel:WaitForChild("Mover") :: BasePart
|
||||
|
||||
local Elevator = InitElevator.constructor(ElevatorBoxModel, Config, Leveling)
|
||||
local Elevator = InitElevator.constructor(ElevatorBoxModel, Config)
|
||||
local MovingObjectsConstructor = MovingObjects.constructor(TagsConstructor)
|
||||
local ButtonsConstructor = Buttons.constructor(Config.Name, ButtonTags, Elevator.Attributes.CurrentFloor)
|
||||
ButtonsConstructor:InitForElevator(2, ButtonPromptsDistance)
|
||||
|
||||
local ArrowLanternConstructor = ArrowLantern.constructor(LanternTags, Config)
|
||||
local DoorsConstructor = Doors.constructor(Leveling, ElevatorBoxModel, Config.Doors, DoorTags)
|
||||
local DoorsConstructor = Doors.constructor(Config, ElevatorBoxModel, DoorTags)
|
||||
|
||||
if Config.TravelType == "Traction" then
|
||||
local PulleyRopesObject = TagsConstructor:Request(`{Config.Name}_Rope_Pulley`) :: BasePart
|
||||
local TractionRopesConstructor = TractionRopes.constructor(CabRopesObject, PulleyRopesObject)
|
||||
|
||||
TractionRopesConstructor:Update()
|
||||
elseif Config.TravelType == "Hydraulic" then
|
||||
|
||||
|
||||
end
|
||||
|
||||
local EventsConstructor = Events.constructor(
|
||||
Elevator,
|
||||
Config,
|
||||
@@ -56,11 +50,15 @@ return function(
|
||||
ArrowLanternConstructor,
|
||||
ButtonsConstructor,
|
||||
ElevatorBoxModel,
|
||||
Leveling,
|
||||
MovingObjectsConstructor,
|
||||
TractionRopesConstructor
|
||||
)
|
||||
EventsConstructor:Init()
|
||||
elseif Config.TravelType == "Hydraulic" then
|
||||
|
||||
|
||||
end
|
||||
|
||||
ArrowLanternConstructor:Toggle(true, true)
|
||||
|
||||
if DoorsConstructor:OpenAtFloor(Elevator.Attributes.CurrentFloor.Value) then
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
--!optimize 2
|
||||
--!strict
|
||||
|
||||
return {
|
||||
[1] = 13.041,
|
||||
[2] = 37.973,
|
||||
[3] = 62.978,
|
||||
[4] = 87.968,
|
||||
[5] = 112.952,
|
||||
[6] = 137.988,
|
||||
[7] = 163.009,
|
||||
[8] = 188.007,
|
||||
[9] = 213.058,
|
||||
[10] = 239.245,
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
--!optimize 2
|
||||
--!strict
|
||||
|
||||
-- self.ElevatorBox_1960 = TagsConstructor:Request("ElevatorMover_1960") :: UnionOperation
|
||||
-- self.ElevatorDoor1 = TagsConstructor:Request("ElevatorDoor_1960_1") :: BasePart
|
||||
-- self.ElevatorDoor2 = TagsConstructor:Request("ElevatorDoor_1960_2") :: BasePart
|
||||
-- self.ElevatorDoorSensor = TagsConstructor:Request("ElevatorDoor_Sensor_1960") :: Folder
|
||||
-- self.Ropes = TagsConstructor:Request("1960_ElevatorPulleyRope") :: {Instance}
|
||||
-- self.HallDisplays = TagsConstructor:Request("Otis1960_LandingFloorDisplay") :: {Instance}
|
||||
|
||||
-- self.MachineRoom.Pulley = TagsConstructor:Request("Otis1960_Pulley") :: UnionOperation
|
||||
-- self.MachineRoom.Pulley2 = TagsConstructor:Request("Otis1960_Pulley2") :: UnionOperation
|
||||
-- self.MachineRoom.Governor = TagsConstructor:Request("Otis1960_Governor") :: UnionOperation
|
||||
-- self.MachineRoom.GovernorFlyballs = TagsConstructor:Request("Otis1960_GovernorFlyballs") :: Part
|
||||
-- self.MachineRoom.PiePlatePulley = TagsConstructor:Request("Otis1960_PieplatePulley") :: UnionOperation
|
||||
-- self.MachineRoom.PiePlatePlates = TagsConstructor:Request("Otis1960_PiePlatePlates") :: UnionOperation
|
||||
-- self.MachineRoom.PiePlateSelector = TagsConstructor:Request("Otis1960_PiePlateSelector") :: 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)
|
||||
|
||||
end
|
||||
@@ -13,6 +13,9 @@ local SoundEnums = require(EnumsDir:WaitForChild("Sounds"))
|
||||
export type TravelTypes = "Traction" | "Hydraulic"
|
||||
export type DoorSpeeds = "SingleSpeed" | "DoubleSpeed" | "TripleSpeed"
|
||||
export type DoorLocations = "Cab" | "Landing"
|
||||
export type Leveling = {
|
||||
[number]: number
|
||||
}
|
||||
|
||||
export type ElevatorConfigurationTable = {
|
||||
Name: Enums.ElevatorValues,
|
||||
@@ -36,7 +39,8 @@ export type ElevatorConfigurationTable = {
|
||||
},
|
||||
Colors: ButtonColors,
|
||||
Lanterns: Lanterns,
|
||||
Doors: DoorsConfig
|
||||
Doors: DoorsConfig,
|
||||
Leveling: Leveling
|
||||
}
|
||||
export type LanternProperties = ButtonProperties & {Time: number}
|
||||
export type ButtonProperties = {
|
||||
|
||||
Reference in New Issue
Block a user