Skip to content

Game.Vehicles.CarFlags

Assembly:
Assembly-CSharp

Namespace: Game.Vehicles

Type:
public enum CarFlags : uint (with [Flags] attribute)

Base:
System.Enum (underlying type: System.UInt32)

Summary:
Bitwise flags describing state and behavior modifiers for car/vehicle instances in the game. The enum is marked with [Flags], so values are intended to be combined using bitwise operations to represent multiple simultaneous states (e.g., Emergency | Warning). These flags are typically used by vehicle AI and traffic logic to change routing, lane usage, animation, and other behavior.


Fields

  • Emergency = 1u
    Indicates an emergency vehicle state (ambulance, fire truck, police). Typically affects priority, lane usage, and traffic rules.

  • StayOnRoad = 2u
    Marks the vehicle to remain on the road (avoid leaving onto sidewalks/grass). Used to restrict off-road movement.

  • AnyLaneTarget = 4u
    Allows the vehicle to target any lane of a segment for its destination instead of a specific lane. Useful for flexible routing/parking behavior.

  • Warning = 8u
    Signals a warning state (e.g., hazard lights). Often used for visual/animation effects and to influence other vehicles' reactions.

  • Queueing = 0x10u
    Indicates the vehicle is currently queued (e.g., waiting in traffic or at a junction). Can affect movement logic and animation.

  • UsePublicTransportLanes = 0x20u
    Allows the vehicle to use lanes designated for public transport (bus/tram lanes) when appropriate.

  • PreferPublicTransportLanes = 0x40u
    Makes the vehicle prefer public transport lanes over other lanes when multiple options exist.

  • Sign = 0x80u
    Used to mark vehicles as a "sign" or marker vehicle. Typically for special-purpose vehicles or visual markers in the simulation.

  • Interior = 0x100u
    Indicates an interior/hidden vehicle (often used for rendering or internal logic where the vehicle is not visible as a normal instance).

  • Working = 0x200u
    Marks the vehicle as performing work (service vehicles performing tasks). May change behavior such as where it parks or how it maneuvers.

  • SignalAnimation1 = 0x400u
    Flag likely used to trigger a specific signal/animation state (animation variant 1).

  • SignalAnimation2 = 0x800u
    Flag likely used to trigger an alternate signal/animation state (animation variant 2).

  • CannotReverse = 0x1000u
    Indicates the vehicle cannot reverse (disables reversing maneuvers). Used to restrict movement in AI decisions.

Properties

  • None.
    This enum provides constant flag values and does not expose properties.

Constructors

  • None.
    Enums are value types and do not have explicit constructors in typical usage.

Methods

  • None.
    This enum defines flag values only; no methods are declared here.

Usage Example

// Combine flags
CarFlags flags = CarFlags.Emergency | CarFlags.UsePublicTransportLanes | CarFlags.Warning;

// Test for a flag
bool isEmergency = (flags & CarFlags.Emergency) != 0;

// Add a flag
flags |= CarFlags.CannotReverse;

// Remove a flag
flags &= ~CarFlags.Warning;

// Example check affecting logic
if ((flags & CarFlags.UsePublicTransportLanes) != 0) {
    // allow use of bus/tram lanes for routing
}

{{ Additional notes: These flags are intended for internal vehicle/traffic systems — changing them can alter routing, lane choice, animations and interactions with other vehicles. When creating or modifying mods, ensure combined flag values are set and cleared atomically if accessed from multiple threads. }}