Skip to content

Global Tables & Enums ​

ScriptedScreens exposes several constant tables on the ss object that you can use instead of hardcoding strings. Using these constants gives you autocomplete-friendly names and protects against typos.

ss.direction ​

Fill/slide direction constants used by progress and slider elements.

ConstantValueDescription
ss.direction.LeftToRight"ltr"Left to right (default)
ss.direction.RightToLeft"rtl"Right to left
ss.direction.TopToBottom"ttb"Top to bottom
ss.direction.BottomToTop"btt"Bottom to top
lua
-- Vertical progress bar filling upward
ui:element({
    id = "fuel", type = "progress",
    rect = { unit = "px", x = 10, y = 10, w = 30, h = 120 },
    props = { value = 60, max = 100, direction = ss.direction.BottomToTop },
    style = { bg = "#1E293B", fill = "#38BDF8" },
})

-- Vertical slider
ui:element({
    id = "throttle", type = "slider",
    rect = { unit = "px", x = 50, y = 10, w = 24, h = 120 },
    props = { value = "75", min = "0", max = "100", direction = ss.direction.BottomToTop },
    style = { bg = "#1E293B", fill = "#22C55E", handle = "#FFFFFF" },
    on_change = function(v) end,
})

Raw strings still work

You can always pass the short string directly ("ltr", "rtl", "ttb", "btt") if you prefer. The enum is purely for readability.

ss.sounds ​

Built-in game sound names for use with ss.play_sound(). Organized into categories.

UI Feedback ​

ConstantSound
ss.sounds.ActivateButtonButton activation click
ss.sounds.SwitchOn / SwitchOffSwitch toggle
ss.sounds.DialTurnDial rotation
ss.sounds.CompletedChimeCompletion chime
ss.sounds.DirectionNextButton / DirectionPreviousButtonDirection buttons
ss.sounds.Label / LabelConfirm / LabelCancelLabeller sounds

Logic / IC ​

ConstantSound
ss.sounds.LogicOnBeep / LogicOffBeepLogic beeps
ss.sounds.LogicErrorLogic error
ss.sounds.LogicOn / LogicOffLogic state changes
ss.sounds.LogicRead / LogicWriteLogic I/O
ss.sounds.LogicMathLogic math operation
ss.sounds.ErrorGeneric error

Mechanical / Devices ​

ConstantSound
ss.sounds.LeverDown / LeverUpLever toggle
ss.sounds.ThrottleLeverDown / ThrottleLeverUpThrottle lever
ss.sounds.PipeDeviceOn / PipeDeviceOffPipe device toggle
ss.sounds.PipeValveOn / PipeValveOffPipe valve toggle
ss.sounds.ShutterOpen / ShutterCloseShutter open/close
ss.sounds.VentInwards / VentOutwardsVent direction
ss.sounds.DeviceExport / DeviceImportDevice I/O
ss.sounds.WrenchOneShot / ScrewDriverOneShotTool sounds

APC / Power ​

ConstantSound
ss.sounds.ApcOpen / ApcCloseAPC door
ss.sounds.ApcOn / ApcOffAPC power
ss.sounds.ApcCharged / ApcDischargedAPC charge state
ss.sounds.ElectricalFailureElectrical failure

Alerts (ss.sounds.alerts) ​

Announcement sounds played through the game's SoundAlert system.

ConstantSound
ss.sounds.alerts.WarningWarning
ss.sounds.alerts.DangerDanger
ss.sounds.alerts.AlertAlert
ss.sounds.alerts.IntruderAlertIntruder alert
ss.sounds.alerts.StormIncomingStorm incoming
ss.sounds.alerts.Depressurising / PressurisingPressure change
ss.sounds.alerts.AirlockCyclingAirlock cycling
ss.sounds.alerts.PowerLowLow power
ss.sounds.alerts.SystemFailureSystem failure
ss.sounds.alerts.FireFireFireFire alert
ss.sounds.alerts.RocketLaunching / LiftOffRocket launch
ss.sounds.alerts.TraderIncoming / TraderLandedTrader events
ss.sounds.alerts.PressureHigh / PressureLowPressure alerts
ss.sounds.alerts.TemperatureHigh / TemperatureLowTemperature alerts
ss.sounds.alerts.PollutantsDetected / HighCarbonDioxideAtmosphere alerts
ss.sounds.alerts.Alarm1 through Alarm12Generic alarms
ss.sounds.alerts.Music1 / Music2 / Music3Music tracks
ss.sounds.alerts.One through FiveNumber announcements
ss.sounds.alerts.FloorFloor announcement
lua
-- Play a warning alert
ss.play_sound(ss.sounds.alerts.Warning)

-- Play a UI click
ss.play_sound(ss.sounds.ActivateButton)

-- Looping alarm
ss.play_sound(ss.sounds.alerts.Alarm1, { loop = true, id = "siren" })
ss.stop_sound("siren")

ss.ui.icons ​

Icon constants for the icon element type. Organized into sub-tables.

TableUsageExample
ss.ui.icons.gasGas type iconsss.ui.icons.gas.Oxygen
ss.ui.icons.slotItem slot type iconsss.ui.icons.slot.Helmet
ss.ui.icons.prefabIn-game item/structure iconsss.ui.icons.prefab.ItemKitComputer

See the Icons & Prefab Icons page for full listings and usage examples.

⚠️ This documentation was AI-generated and may contain inaccuracies. Please submit pull requests with corrections as needed.