Skip to content

Game.Tools.ErrorType

Assembly: Assembly-CSharp (game runtime assembly)
Namespace: Game.Tools

Type: public enum ErrorType

Base: System.Enum

Summary:
Represents a set of placement/build/tool error codes used by the game's tools and building placement logic. Each value indicates a specific reason why an action (for example placing or upgrading a building/road) failed or is invalid. Modders can use these values to handle UI messages, validate placement rules, or implement custom tool behaviours.


Fields

  • None
    No error — placement or action is valid.

  • OverlapExisting
    Placement would overlap an existing object (building, prop, or network).

  • InvalidShape
    The shape or footprint of the item is invalid for the chosen location.

  • NotEnoughMoney
    The player does not have sufficient funds to complete the action.

  • PathfindFailed
    Pathfinding failed (vehicles/pedestrians cannot find a route).

  • NoRoadAccess
    There is no road access to the placement location.

  • NoCarAccess
    Cars cannot reach the location (vehicle access missing).

  • NoPedestrianAccess
    Pedestrians cannot reach the location (walkability missing).

  • LongDistance
    The item is too far from required connection or service (exceeds maximum allowed distance).

  • TightCurve
    A curve or turn is too tight for the connection/vehicle.

  • NoTrainAccess
    Trains cannot access the location.

  • NoTrackAccess
    No track connection exists for the rail-related placement.

  • AlreadyUpgraded
    The target is already upgraded and cannot be upgraded further.

  • InWater
    The placement location is in water where the item cannot be placed.

  • NoCargoAccess
    No cargo access (logistics/transport access) for the placed object.

  • NoWater
    No water service or water supply where required.

  • ExceedsCityLimits
    Placement is outside the city's limits.

  • NotOnShoreline
    Item requires shoreline placement but the location is not on the shoreline.

  • AlreadyExists
    An identical object already exists at the location.

  • ShortDistance
    The placement is too close to another object or violates minimum distance rules.

  • LowElevation
    The elevation at the location is too low for this item.

  • SmallArea
    The available area is too small to place the object.

  • SteepSlope
    The terrain slope is too steep for placement.

  • ExceedsLotLimits
    Placement would exceed lot-size or zoning limits.

  • NotOnBorder
    Placement must be on a border (e.g., between tiles) but is not.

  • NoGroundWater
    Insufficient groundwater or required underground water source is missing.

  • OnFire
    The location is on fire and cannot accept placement or upgrade.

  • NoPortAccess
    No port or water access where required.

  • Count
    Count value representing the number of enum entries (useful for iteration/validation).

Properties

  • This enum has no properties. It is a simple value type used for classification of errors.

Constructors

  • Enums do not expose constructors in C#. The underlying integer values are assigned automatically starting at 0 (None = 0, OverlapExisting = 1, etc.) unless explicitly set.

Methods

  • The enum itself does not declare methods. Standard System.Enum methods are available (ToString, GetValues, GetName, etc.). Typical usage involves comparisons, switches, or mapping to user-facing messages.

Usage Example

// Example: validating placement result and showing a message
public void HandlePlacement(ErrorType error)
{
    switch (error)
    {
        case ErrorType.None:
            // proceed with placement
            break;
        case ErrorType.NotEnoughMoney:
            ShowError("You do not have enough money to build this.");
            break;
        case ErrorType.OverlapExisting:
            ShowError("This placement overlaps an existing object.");
            break;
        case ErrorType.ExceedsCityLimits:
            ShowError("You cannot build outside city limits.");
            break;
        default:
            ShowError($"Placement failed: {error}");
            break;
    }
}

// Example: check directly
if (currentError == ErrorType.NoRoadAccess)
{
    // prevent placement or offer to build a road
}