mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 14:51:55 +00:00
Move Elevators into Map directory
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -14,6 +14,7 @@ local DoorEnums = require(Types:WaitForChild("Enums"):WaitForChild("Doors"))
|
|||||||
|
|
||||||
local HaughtonConfig = {} :: ElevatorTypes.ElevatorConfigurationTable
|
local HaughtonConfig = {} :: ElevatorTypes.ElevatorConfigurationTable
|
||||||
HaughtonConfig.Name = Enums.Elevator.Haughton
|
HaughtonConfig.Name = Enums.Elevator.Haughton
|
||||||
|
HaughtonConfig.TravelType = "Traction"
|
||||||
HaughtonConfig.FloorLevelingDistance = 6
|
HaughtonConfig.FloorLevelingDistance = 6
|
||||||
HaughtonConfig.FloorLeveling3PhaseDistance = 1.5
|
HaughtonConfig.FloorLeveling3PhaseDistance = 1.5
|
||||||
HaughtonConfig.LevelingVelocity = .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 {
|
return {
|
||||||
HaughtonConfig = HaughtonConfig
|
HaughtonConfig = HaughtonConfig
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,7 @@ local MainDir = ElevatorsDir.Parent
|
|||||||
|
|
||||||
local ElevatorSystem = ElevatorsDir:WaitForChild("System")
|
local ElevatorSystem = ElevatorsDir:WaitForChild("System")
|
||||||
|
|
||||||
local Config = require(ParentDir:WaitForChild("Configs"))
|
local ElevatorTypes = require(MainDir:WaitForChild("Types"):WaitForChild("Elevator"))
|
||||||
local InitElevator = require(ElevatorSystem)
|
local InitElevator = require(ElevatorSystem)
|
||||||
local ArrowLantern = require(ElevatorSystem:WaitForChild("Lanterns"):WaitForChild("Arrows"))
|
local ArrowLantern = require(ElevatorSystem:WaitForChild("Lanterns"):WaitForChild("Arrows"))
|
||||||
local Buttons = require(ElevatorSystem:WaitForChild("Buttons"))
|
local Buttons = require(ElevatorSystem:WaitForChild("Buttons"))
|
||||||
@@ -20,23 +20,38 @@ local Leveling = require(script:WaitForChild("Leveling"))
|
|||||||
local MovingObjects = require(script:WaitForChild("MovingObjects"))
|
local MovingObjects = require(script:WaitForChild("MovingObjects"))
|
||||||
local TagsModule = require(MainDir:WaitForChild("Map"):WaitForChild("Load"):WaitForChild("Tags"))
|
local TagsModule = require(MainDir:WaitForChild("Map"):WaitForChild("Load"):WaitForChild("Tags"))
|
||||||
|
|
||||||
return function(TagsConstructor: TagsModule.TagsConstructor, ButtonTags: TagsModule.ElevatorButtons, LanternTags: TagsModule.Lanterns, LandingDoorTags: TagsModule.LandingTags)
|
return function(
|
||||||
local ElevatorModel = TagsConstructor:Request("Elevator_Haughton") :: Model
|
Config: ElevatorTypes.ElevatorConfigurationTable,
|
||||||
local CabRopesObject = TagsConstructor:Request("Haughton_Rope_Cab") :: BasePart
|
TagsConstructor: TagsModule.TagsConstructor,
|
||||||
local PulleyRopesObject = TagsConstructor:Request("Haughton_Rope_Pulley") :: BasePart
|
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 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 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)
|
ButtonsConstructor:InitForElevator(2, ButtonPromptsDistance)
|
||||||
|
|
||||||
local ArrowLanternConstructor = ArrowLantern.constructor(LanternTags, Config.Elevator)
|
local ArrowLanternConstructor = ArrowLantern.constructor(LanternTags, Config)
|
||||||
local TractionRopesConstructor = TractionRopes.constructor(CabRopesObject, PulleyRopesObject)
|
local DoorsConstructor = Doors.constructor(Leveling, ElevatorBoxModel, Config.Doors, DoorTags)
|
||||||
local DoorsConstructor = Doors.constructor(Leveling, ElevatorBoxModel, Config.Doors, LandingDoorTags)
|
|
||||||
|
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(
|
local EventsConstructor = Events.constructor(
|
||||||
Elevator,
|
Elevator,
|
||||||
Config.Elevator,
|
Config,
|
||||||
DoorsConstructor,
|
DoorsConstructor,
|
||||||
ArrowLanternConstructor,
|
ArrowLanternConstructor,
|
||||||
ButtonsConstructor,
|
ButtonsConstructor,
|
||||||
@@ -45,7 +60,6 @@ return function(TagsConstructor: TagsModule.TagsConstructor, ButtonTags: TagsMod
|
|||||||
MovingObjectsConstructor,
|
MovingObjectsConstructor,
|
||||||
TractionRopesConstructor
|
TractionRopesConstructor
|
||||||
)
|
)
|
||||||
TractionRopesConstructor:Update()
|
|
||||||
EventsConstructor:Init()
|
EventsConstructor:Init()
|
||||||
ArrowLanternConstructor:Toggle(true, true)
|
ArrowLanternConstructor:Toggle(true, true)
|
||||||
|
|
||||||
Reference in New Issue
Block a user