Photon Documentation Repository

Entity

Entity accessors generated by SimpleNet.

Photon.SNet:Map hangs a Set/Get pair off the Entity metatable for every variable it registers, at load time. Nothing declares them in source, so neither the editor nor the docs site can see them — this file declares them instead, mirroring what sh_simplenet.lua registers at the bottom.

Definitions only: --- @meta marks the whole file as declarations rather than executable code, and nothing includes it — lua/autorun/photon/meta/ is not on any load path, and its .glualint.json turns off the unused-variable warning every empty declaration in here would otherwise raise. Keep it in step with the Photon.SNet:Map calls in sh_simplenet.lua — a name that is registered but not declared here still works at runtime, it is only invisible to tooling.

Every getter takes the value to fall back on when the client has not been told the real one yet, and every setter is serverside: a client that writes one changes only its own copy, until the next broadcast overwrites it.

Functions

Emergency Lighting

SharedEntity:GetPhotonNet_Blackout(default) → booleanSource ☍

Whether the vehicle is blacked out, suppressing its running lights.

Parameters

  • defaultboolean?Value to return if none has been networked yet.

Returns

  1. booleanWhether the vehicle is blacked out.
SharedEntity:GetPhotonNet_Enabled(default) → booleanSource ☍

Whether emergency lighting is enabled on the vehicle.

Parameters

  • defaultboolean?Value to return if none has been networked yet.

Returns

  1. booleanWhether emergency lighting is enabled.
SharedEntity:GetPhotonNet_LEStayOn(default) → booleanSource ☍

Whether the vehicle's emergency lighting stays on with the engine off.

Parameters

  • defaultboolean?Value to return if none has been networked yet.

Returns

  1. booleanWhether lighting stays on.
SharedEntity:GetPhotonNet_LightOn(default) → booleanSource ☍

Whether the vehicle's emergency lights are on.

Parameters

  • defaultboolean?Value to return if none has been networked yet.

Returns

  1. booleanWhether the lights are on.
SharedEntity:GetPhotonNet_LightOption(default) → integerSource ☍

The vehicle's active lighting stage.

Parameters

  • defaultinteger?Value to return if none has been networked yet.

Returns

  1. integerLighting option index.
SharedEntity:GetPhotonNet_Preset(default) → integerSource ☍

The vehicle's active lighting preset.

Parameters

  • defaultinteger?Value to return if none has been networked yet.

Returns

  1. integerPreset index; 0 for none.
ServerEntity:SetPhotonNet_Blackout(value)Source ☍

Set whether the vehicle is blacked out.

Parameters

  • valuebooleanWhether the vehicle is blacked out.
ServerEntity:SetPhotonNet_Enabled(value)Source ☍

Set whether emergency lighting is enabled on the vehicle. Read through Entity:ELS_Enabled; whether the vehicle has Photon at all is HasPhoton.

Parameters

  • valuebooleanWhether emergency lighting is enabled.
ServerEntity:SetPhotonNet_LEStayOn(value)Source ☍

Set whether the vehicle's emergency lighting stays on with the engine off.

Parameters

  • valuebooleanWhether lighting stays on.
ServerEntity:SetPhotonNet_LightOn(value)Source ☍

Set whether the vehicle's emergency lights are on.

Parameters

  • valuebooleanWhether the lights are on.
ServerEntity:SetPhotonNet_LightOption(value)Source ☍

Set the vehicle's active lighting stage.

Parameters

  • valueintegerLighting option index, 1-16.
ServerEntity:SetPhotonNet_Preset(value)Source ☍

Set the vehicle's active lighting preset.

Parameters

  • valueintegerPreset index; 0 for none.

Identity

SharedEntity:GetPhotonNet_LiveryID(default) → stringSource ☍

The vehicle's selected livery.

Parameters

  • defaultstring?Value to return if none has been networked yet.

Returns

  1. stringLivery ID.
SharedEntity:GetPhotonNet_SelectionString(default) → stringSource ☍

The vehicle's auto-livery selection, as a .-joined path of indices.

Parameters

  • defaultstring?Value to return if none has been networked yet.

Returns

  1. stringSelection string.
SharedEntity:GetPhotonNet_UnitNumber(default) → stringSource ☍

The vehicle's displayed unit number.

Parameters

  • defaultstring?Value to return if none has been networked yet.

Returns

  1. stringUnit number.
SharedEntity:GetPhotonNet_VehicleIndex(default) → stringSource ☍

The registered name of the Photon vehicle this entity is running. Everything else about the vehicle is looked up from this, so a client that has not received it yet cannot render the vehicle at all.

Parameters

  • defaultstring?Value to return if none has been networked yet.

Returns

  1. stringVehicle index.
ServerEntity:SetPhotonNet_LiveryID(value)Source ☍

Set the vehicle's selected livery.

Parameters

  • valuestringLivery ID.
ServerEntity:SetPhotonNet_SelectionString(value)Source ☍

Set the vehicle's auto-livery selection, as a .-joined path of indices.

Parameters

  • valuestringSelection string.
ServerEntity:SetPhotonNet_UnitNumber(value)Source ☍

Set the vehicle's displayed unit number.

Parameters

  • valuestringUnit number.
ServerEntity:SetPhotonNet_VehicleIndex(value)Source ☍

Set the registered name of the Photon vehicle this entity is running.

Parameters

Illumination

SharedEntity:GetPhotonNet_IlluminationOn(default) → booleanSource ☍

Whether the vehicle's scene illumination is on.

Parameters

  • defaultboolean?Value to return if none has been networked yet.

Returns

  1. booleanWhether illumination is on.
SharedEntity:GetPhotonNet_IlluminationOption(default) → integerSource ☍

The vehicle's active illumination stage.

Parameters

  • defaultinteger?Value to return if none has been networked yet.

Returns

  1. integerIllumination option index.
ServerEntity:SetPhotonNet_IlluminationOn(value)Source ☍

Set whether the vehicle's scene illumination is on.

Parameters

  • valuebooleanWhether illumination is on.
ServerEntity:SetPhotonNet_IlluminationOption(value)Source ☍

Set the vehicle's active illumination stage.

Parameters

  • valueintegerIllumination option index, 1-16.

Siren

SharedEntity:GetPhotonNet_AuxSirenSet(default) → integerSource ☍

The vehicle's auxiliary siren set.

Parameters

  • defaultinteger?Value to return if none has been networked yet.

Returns

  1. integerSiren set index.
SharedEntity:GetPhotonNet_HornSound(default) → stringSource ☍

The sound playing on the vehicle's horn channel.

Parameters

  • defaultstring?Value to return if none has been networked yet.

Returns

  1. stringSound file or script, or "" when the channel is silent.
SharedEntity:GetPhotonNet_HornVolume(default) → numberSource ☍

The sound level of the vehicle's horn.

Parameters

  • defaultnumber?Value to return if none has been networked yet.

Returns

  1. numberSource sound level (SNDLVL), not a 0-1 scale.
SharedEntity:GetPhotonNet_ManualSound(default) → stringSource ☍

The sound playing on the vehicle's manual siren channel.

Parameters

  • defaultstring?Value to return if none has been networked yet.

Returns

  1. stringSound file or script, or "" when the channel is silent.
SharedEntity:GetPhotonNet_ManualVolume(default) → numberSource ☍

The sound level of the vehicle's manual siren.

Parameters

  • defaultnumber?Value to return if none has been networked yet.

Returns

  1. numberSource sound level (SNDLVL), not a 0-1 scale.
SharedEntity:GetPhotonNet_Siren2Sound(default) → stringSource ☍

The sound playing on the vehicle's secondary siren channel.

Parameters

  • defaultstring?Value to return if none has been networked yet.

Returns

  1. stringSound file or script, or "" when the channel is silent.
SharedEntity:GetPhotonNet_Siren2Volume(default) → numberSource ☍

The sound level of the vehicle's secondary siren.

Parameters

  • defaultnumber?Value to return if none has been networked yet.

Returns

  1. numberSource sound level (SNDLVL), not a 0-1 scale.
SharedEntity:GetPhotonNet_SirenOn(default) → booleanSource ☍

Whether the vehicle's siren is on.

Parameters

  • defaultboolean?Value to return if none has been networked yet.

Returns

  1. booleanWhether the siren is on.
SharedEntity:GetPhotonNet_SirenOption(default) → integerSource ☍

The vehicle's active siren tone.

Parameters

  • defaultinteger?Value to return if none has been networked yet.

Returns

  1. integerSiren option index.
SharedEntity:GetPhotonNet_SirenSet(default) → integerSource ☍

The vehicle's primary siren set.

Parameters

  • defaultinteger?Value to return if none has been networked yet.

Returns

  1. integerSiren set index.
SharedEntity:GetPhotonNet_SirenSound(default) → stringSource ☍

The sound playing on the vehicle's primary siren channel.

Parameters

  • defaultstring?Value to return if none has been networked yet.

Returns

  1. stringSound file or script, or "" when the channel is silent.
SharedEntity:GetPhotonNet_SirenVolume(default) → numberSource ☍

The sound level of the vehicle's primary siren.

Parameters

  • defaultnumber?Value to return if none has been networked yet.

Returns

  1. numberSource sound level (SNDLVL), not a 0-1 scale.
ServerEntity:SetPhotonNet_AuxSirenSet(value)Source ☍

Set the vehicle's auxiliary siren set.

Parameters

  • valueintegerSiren set index, 1-1024.
ServerEntity:SetPhotonNet_HornSound(value)Source ☍

Set the sound playing on the vehicle's horn channel. Setting it starts playback; clearing it to an empty string stops the channel.

Parameters

  • valuestringSound file or script to play, or "" to stop.
ServerEntity:SetPhotonNet_HornVolume(value)Source ☍

Set the sound level of the vehicle's horn, taken from the siren set's Volume field.

Parameters

  • valuenumberSource sound level (SNDLVL), not a 0-1 scale.
ServerEntity:SetPhotonNet_ManualSound(value)Source ☍

Set the sound playing on the vehicle's manual siren channel. Starting one ducks the primary siren rather than stopping it, so clearing this resumes the primary siren instead of replaying it from the start.

Parameters

  • valuestringSound file or script to play, or "" to stop.
ServerEntity:SetPhotonNet_ManualVolume(value)Source ☍

Set the sound level of the vehicle's manual siren, taken from the siren set's Volume field.

Parameters

  • valuenumberSource sound level (SNDLVL), not a 0-1 scale.
ServerEntity:SetPhotonNet_Siren2Sound(value)Source ☍

Set the sound playing on the vehicle's secondary siren channel, layered over the primary siren when the vehicle has an auxiliary siren set.

Parameters

  • valuestringSound file or script to play, or "" to stop.
ServerEntity:SetPhotonNet_Siren2Volume(value)Source ☍

Set the sound level of the vehicle's secondary siren. Taken from the primary siren set's Volume field, even though the tone itself comes from the auxiliary set.

Parameters

  • valuenumberSource sound level (SNDLVL), not a 0-1 scale.
ServerEntity:SetPhotonNet_SirenOn(value)Source ☍

Set whether the vehicle's siren is on.

Parameters

  • valuebooleanWhether the siren is on.
ServerEntity:SetPhotonNet_SirenOption(value)Source ☍

Set the vehicle's active siren tone.

Parameters

  • valueintegerSiren option index, 1-16.
ServerEntity:SetPhotonNet_SirenSet(value)Source ☍

Set the vehicle's primary siren set.

Parameters

  • valueintegerSiren set index, 1-1024.
ServerEntity:SetPhotonNet_SirenSound(value)Source ☍

Set the sound playing on the vehicle's primary siren channel. Setting it starts playback; clearing it to an empty string stops the channel.

Parameters

  • valuestringSound file or script to play, or "" to stop.
ServerEntity:SetPhotonNet_SirenVolume(value)Source ☍

Set the sound level of the vehicle's primary siren, taken from the siren set's Volume field.

Parameters

  • valuenumberSource sound level (SNDLVL), not a 0-1 scale.

Traffic Advisor

SharedEntity:GetPhotonNet_TrafficOn(default) → booleanSource ☍

Whether the vehicle's traffic advisor is on.

Parameters

  • defaultboolean?Value to return if none has been networked yet.

Returns

  1. booleanWhether the traffic advisor is on.
SharedEntity:GetPhotonNet_TrafficOption(default) → integerSource ☍

The vehicle's traffic advisor pattern.

Parameters

  • defaultinteger?Value to return if none has been networked yet.

Returns

  1. integerTraffic option index.
ServerEntity:SetPhotonNet_TrafficOn(value)Source ☍

Set whether the vehicle's traffic advisor is on.

Parameters

  • valuebooleanWhether the traffic advisor is on.
ServerEntity:SetPhotonNet_TrafficOption(value)Source ☍

Set the vehicle's traffic advisor pattern.

Parameters

  • valueintegerTraffic option index, 1-16.

Vehicle State

SharedEntity:GetPhotonNet_Blinker(default) → integerSource ☍

The vehicle's blinker state.

Ambiguous

This entry is unclear or incomplete.

Registered, but nothing in the engine reads or writes it — the live signal state is CurrentSignal.

Parameters

  • defaultinteger?Value to return if none has been networked yet.

Returns

  1. integerCurrent blinker value.
SharedEntity:GetPhotonNet_Braking(default) → booleanSource ☍

Whether the vehicle is braking.

Parameters

  • defaultboolean?Value to return if none has been networked yet.

Returns

  1. booleanWhether the vehicle is braking.
SharedEntity:GetPhotonNet_CurrentSignal(default) → integerSource ☍

The vehicle's turn-signal state, as one of the CAR_BLINKER_* constants.

Parameters

  • defaultinteger?Value to return if none has been networked yet.

Returns

  1. integerCurrent signal value.
SharedEntity:GetPhotonNet_HasPhoton(default) → booleanSource ☍

Whether the vehicle is a Photon vehicle. Prefer Entity:Photon, which is the supported way to ask and also covers the non-vehicle case.

Parameters

  • defaultboolean?Value to return if none has been networked yet.

Returns

  1. booleanWhether the vehicle has Photon.
SharedEntity:GetPhotonNet_Headlights(default) → booleanSource ☍

Whether the vehicle's headlights are on.

Ambiguous

This entry is unclear or incomplete.

Registered, but nothing in the engine reads or writes it.

Parameters

  • defaultboolean?Value to return if none has been networked yet.

Returns

  1. booleanWhether the headlights are on.
SharedEntity:GetPhotonNet_Reversing(default) → booleanSource ☍

Whether the vehicle is reversing.

Parameters

  • defaultboolean?Value to return if none has been networked yet.

Returns

  1. booleanWhether the vehicle is reversing.
SharedEntity:GetPhotonNet_Running(default) → booleanSource ☍

Whether the vehicle's engine is running.

Parameters

  • defaultboolean?Value to return if none has been networked yet.

Returns

  1. booleanWhether the engine is running.
ServerEntity:SetPhotonNet_Blinker(value)Source ☍

Set the vehicle's blinker state.

Ambiguous

This entry is unclear or incomplete.

Registered, but nothing in the engine reads or writes it — the live signal state is CurrentSignal.

Parameters

  • valueintegerNew blinker value.
ServerEntity:SetPhotonNet_Braking(value)Source ☍

Set whether the vehicle is braking.

Parameters

  • valuebooleanWhether the vehicle is braking.
ServerEntity:SetPhotonNet_CurrentSignal(value)Source ☍

Set the vehicle's turn-signal state, as one of the CAR_BLINKER_* constants.

Parameters

  • valueintegerNew signal value.
ServerEntity:SetPhotonNet_HasPhoton(value)Source ☍

Set whether the vehicle is a Photon vehicle, i.e. whether Photon:SetupCar has run on it. Set once during setup and never cleared.

Parameters

  • valuebooleanWhether the vehicle has Photon.
ServerEntity:SetPhotonNet_Headlights(value)Source ☍

Set whether the vehicle's headlights are on.

Ambiguous

This entry is unclear or incomplete.

Registered, but nothing in the engine reads or writes it.

Parameters

  • valuebooleanWhether the headlights are on.
ServerEntity:SetPhotonNet_Reversing(value)Source ☍

Set whether the vehicle is reversing.

Parameters

  • valuebooleanWhether the vehicle is reversing.
ServerEntity:SetPhotonNet_Running(value)Source ☍

Set whether the vehicle's engine is running.

Parameters

  • valuebooleanWhether the engine is running.

Classes

SharedEntitySource ☍