Working car button system, need to figure out some phantom data on the relay algorithm events for hall station buttons to recognize and pick up the heading direction

This commit is contained in:
2024-08-25 02:33:36 -04:00
parent 7a2169ea4a
commit f32cb30df8
20 changed files with 479 additions and 265 deletions

View File

@@ -252,7 +252,7 @@ local function GoingUpDirectionToDirectionEnum(CurrentFloor: number, RequestedFl
end
local function CheckFloorQueue(self: ClassConstructor)
self.Elevator.AlignPosition.MaxVelocity = 0
SmoothVelocity(self, 0, 1)
local DirectionToDirectionQueue = self.Attributes.TravelingUpwards.Value and self.RelayAlgorithm.FloorQueue.Up or self.RelayAlgorithm.FloorQueue.Down
local DirectionToOppositeDirectionQueue = self.Attributes.TravelingUpwards.Value and self.RelayAlgorithm.FloorQueue.Down or self.RelayAlgorithm.FloorQueue.Up
@@ -413,13 +413,14 @@ function Elevator:__TravelToFloorAsync(Level_Int, LEVEL_VEC3_Y_WRAP)
--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 velocity
SmoothVelocity(self, self.Elevator.Configuration.MaxVelocity, 3)
SmoothVelocity(self, self.Elevator.Configuration.MaxVelocity, 5)
end
function Elevator:RequestLevelAsync(RequestedLevel, Direction)
local Level = self:GetLevel(RequestedLevel)
if Level then
--Some patch solution for cab calls
if (RequestedLevel == 1 and Direction == Enums.ElevatorCallDirection.Down) then
self.ewarnStudio(`Impossible direction requested, Direction={Direction}, RequestedLevel={RequestedLevel}. correcting...`)
Direction = Enums.ElevatorCallDirection.Up