Move Elevators into Map directory

This commit is contained in:
2024-09-14 19:14:40 -04:00
parent 4d9e6b05d9
commit de2655541e
20 changed files with 65 additions and 13 deletions

File diff suppressed because one or more lines are too long

View File

@@ -14,6 +14,7 @@ local DoorEnums = require(Types:WaitForChild("Enums"):WaitForChild("Doors"))
local HaughtonConfig = {} :: ElevatorTypes.ElevatorConfigurationTable
HaughtonConfig.Name = Enums.Elevator.Haughton
HaughtonConfig.TravelType = "Traction"
HaughtonConfig.FloorLevelingDistance = 6
HaughtonConfig.FloorLeveling3PhaseDistance = 1.5
HaughtonConfig.LevelingVelocity = .5
@@ -76,6 +77,43 @@ HaughtonConfig.Doors = {
}
}
--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
}
]]
return {
HaughtonConfig = HaughtonConfig
}

View File

@@ -9,7 +9,7 @@ local MainDir = ElevatorsDir.Parent
local ElevatorSystem = ElevatorsDir:WaitForChild("System")
local Config = require(ParentDir:WaitForChild("Configs"))
local ElevatorTypes = require(MainDir:WaitForChild("Types"):WaitForChild("Elevator"))
local InitElevator = require(ElevatorSystem)
local ArrowLantern = require(ElevatorSystem:WaitForChild("Lanterns"):WaitForChild("Arrows"))
local Buttons = require(ElevatorSystem:WaitForChild("Buttons"))
@@ -20,23 +20,38 @@ local Leveling = require(script:WaitForChild("Leveling"))
local MovingObjects = require(script:WaitForChild("MovingObjects"))
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 ElevatorModel = TagsConstructor:Request("Elevator_Haughton") :: Model
local CabRopesObject = TagsConstructor:Request("Haughton_Rope_Cab") :: BasePart
local PulleyRopesObject = TagsConstructor:Request("Haughton_Rope_Pulley") :: BasePart
return function(
Config: ElevatorTypes.ElevatorConfigurationTable,
TagsConstructor: TagsModule.TagsConstructor,
ButtonTags: TagsModule.ElevatorButtons,
LanternTags: TagsModule.Lanterns,
DoorTags: TagsModule.LandingTags
)
local ElevatorModel = TagsConstructor:Request(`Elevator_{Config.Name}`) :: Model
local CabRopesObject = TagsConstructor:Request(`{Config.Name}_Rope_Cab`) :: BasePart
local ElevatorBoxModel = ElevatorModel:WaitForChild("Mover") :: BasePart
local Elevator = InitElevator.constructor(ElevatorBoxModel, Config.Elevator, Leveling)
local Elevator = InitElevator.constructor(ElevatorBoxModel, Config, Leveling)
local MovingObjectsConstructor = MovingObjects.constructor(TagsConstructor)
local ButtonsConstructor = Buttons.constructor(Config.Elevator.Name, ButtonTags, Elevator.Attributes.CurrentFloor)
local ButtonsConstructor = Buttons.constructor(Config.Name, ButtonTags, Elevator.Attributes.CurrentFloor)
ButtonsConstructor:InitForElevator(2, ButtonPromptsDistance)
local ArrowLanternConstructor = ArrowLantern.constructor(LanternTags, Config.Elevator)
local TractionRopesConstructor = TractionRopes.constructor(CabRopesObject, PulleyRopesObject)
local DoorsConstructor = Doors.constructor(Leveling, ElevatorBoxModel, Config.Doors, LandingDoorTags)
local ArrowLanternConstructor = ArrowLantern.constructor(LanternTags, Config)
local DoorsConstructor = Doors.constructor(Leveling, ElevatorBoxModel, Config.Doors, 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.Elevator,
Config,
DoorsConstructor,
ArrowLanternConstructor,
ButtonsConstructor,
@@ -45,7 +60,6 @@ return function(TagsConstructor: TagsModule.TagsConstructor, ButtonTags: TagsMod
MovingObjectsConstructor,
TractionRopesConstructor
)
TractionRopesConstructor:Update()
EventsConstructor:Init()
ArrowLanternConstructor:Toggle(true, true)