···9595| ElevatorData.longitudinalSpeed | number | the absolute Longitudinal speed of the elevator in m/s. |
9696| ElevatorData.coreAltitude | number | the altitude from sea level returned by the core in meters. (warning: this altitude in space when far from planets is 0) |
9797| ElevatorData.altitude | number | computed altitude from the distance between the construct and the sea level of the closest planet. (not 0 when in space) |
9898+| ElevatorData.atmosphereDistance | number | computed distance from the construct to the atmosphere of the closest planet |
9999+| ElevatorData.atmosphereAltitude | number | computed altitude of the atmosphere of the closest planet |
100100+| ElevatorData.atmoMaxSpeed | number | the maximum speed of the elevator in m/s when in atmosphere. (anti burn security) |
101101+| ElevatorData.currentMaxSpeed | number | the maximum speed of the elevator in m/s. (50km/h in space) |
98102| ElevatorData.planetData | table | Atlas Data of the closest planet. See atlas in game file for the structure (Game Directory\data\lua\atlas.lua) |
99103100104# Coming Soon
+15-6
Source/Unit/OnStart.lua
···4444 ElevatorData.longitudinalSpeed - number - the absolute Longitudinal speed of the elevator in m/s.
4545 ElevatorData.coreAltitude - number - the altitude from sea level returned by the core in meters. (warning: this altitude in space when far from planets is 0)
4646 ElevatorData.altitude - number - computed altitude from the distance between the construct and the sea level of the closest planet. (not 0 when in space)
4747+ ElevatorData.atmosphereDistance - number - computed distance from the construct to the atmosphere of the closest planet
4848+ ElevatorData.atmosphereAltitude - number - computed altitude of the atmosphere of the closest planet.
4949+ ElevatorData.atmoMaxSpeed - number - the maximum speed of the elevator in m/s when in atmosphere. (anti burn security)
5050+ ElevatorData.currentMaxSpeed - number - the maximum speed of the elevator in m/s. (50km/h in space)
4751 ElevatorData.planetData - table - Atlas Data of the closest planet. See atlas in game file for the structure (Game Directory\data\lua\atlas.lua)
4852 ]]
4953 --locale for Translation
···230234--[[
231235 Version Management
232236]]
233233-local version = "V 1.3.2"
237237+local version = "V 1.3.3"
234238local log_split = "================================================="
235239--printing version in lua chat
236240system.print(log_split)local a=""local b=math.ceil((50-#version-2)/2)for c=1,b,1 do a=a..'='end;a=a.." "..version.." "for c=1,b,1 do a=a..'='end;system.print(a)system.print(log_split)
···276280if core == nil then
277281 system.print('Core unit is not linked, exiting the script')
278282 unit.exit()
283283+end
284284+if databank == nil then
285285+ system.print('Databank is not linked')
279286end
280287281288--[[
···329336 if __DEBUG then system.print('BaseForward: ' .. json.encode(BaseForward)) end
330337 if databank ~= nil then
331338 if databank.hasKey('ConstructInitPos') and not force then
332332- BaseForward = Serializer:parse(databank.getStringValue('ConstructInitPos'))
339339+ ConstructInitPos = Serializer:parse(databank.getStringValue('ConstructInitPos'))
340340+ system.print("ConstructInitPos loaded from databank")
333341 else
334342 local toStore = Serializer:stringify(ConstructInitPos)
335343 databank.setStringValue('ConstructInitPos', toStore)
···338346 end
339347 if databank.hasKey('BaseForward') and not force then
340348 BaseForward = Serializer:parse(databank.getStringValue('BaseForward'))
349349+ system.print("BaseForward loaded from databank")
341350 else
342351 local toStore = Serializer:stringify(BaseForward)
343352 databank.setStringValue('BaseForward', toStore)
···628637 ElevatorData.altitude = computePlanetSeaDistance(ElevatorData.planetData, constructWorldPosition)
629638 ElevatorData.atmosphereDistance = ElevatorData.altitude - ElevatorData.atmosphereAltitude
630639 local isInAtmosphere = ElevatorData.atmosphereDistance <= 0
631631- local targetIsInAtmosphere = TargetAltitude <= ElevatorData.atmosphereDistance
640640+ local targetIsInAtmosphere = TargetAltitude <= ElevatorData.atmosphereAltitude
632641 if maxBrake ~= nil then
633642 local g = core.getGravityIntensity()
634643 if ElevatorData.verticalSpeedSigned < 0 then
···647656 local distance = TargetAltitude - ElevatorData.altitude
648657 local targetDistance = utils.sign(distance) * (math.abs(distance)-brakeDistance)
649658 distancePID:inject(targetDistance)
650650- if distancePID:get() > 0.25 or ElevatorData.verticalSpeedSigned < -MaxSpeed then --using a 0.25 meter deadband for stabilizing
659659+ if distancePID:get() > 0.25 or ElevatorData.verticalSpeedSigned < -ElevatorData.currentMaxSpeed then --using a 0.25 meter deadband for stabilizing
651660 Nav.axisCommandManager:setThrottleCommand(axisCommandId.vertical, 1)
652661 ElevatorData.direction = 'up'
653662 if ElevatorData.verticalSpeedSigned < 0 then
654663 finalBrakeInput = 1
655664 end
656656- elseif distancePID:get() < -0.25 or ElevatorData.verticalSpeedSigned > MaxSpeed then
665665+ elseif distancePID:get() < -0.25 or ElevatorData.verticalSpeedSigned > ElevatorData.currentMaxSpeed then
657666 Nav.axisCommandManager:setThrottleCommand(axisCommandId.vertical, -1)
658667 ElevatorData.direction = 'down'
659668 if ElevatorData.verticalSpeedSigned > 0 then
···666675667676 --Brakes
668677 if (math.abs(distance) < (ElevatorData.verticalSpeed*3.6) and canBrake) --speed control
669669- or (ElevatorData.verticalSpeed >= MaxSpeed) --anti burn speed
678678+ or (ElevatorData.verticalSpeed >= ElevatorData.currentMaxSpeed) --anti burn speed
670679 or ((math.abs(distancePID:get()) < .25) and canBrake) --altitude reached with 0.25m deadband
671680 or ((brakeDistance > math.abs(distance)) and canBrake) --braking distance
672681 or (finalBrakeInput == 0 and autoBrakeSpeed > 0 and Nav.axisCommandManager.throttle == 0 and constructVelocity:len() < autoBrakeSpeed)