mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-15 22:21:55 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user