NML:Badges

From GRFSpecs
Revision as of 11:23, 4 January 2026 by Rito12 (talk | contribs) (Add missing parts.)
Jump to navigationJump to search
Props, Vars and CBs

Since Supported by OpenTTD 15.015.0

 item (FEAT_BADGES, item_name) { ... }

Badge properties

property value range comment
label string with / as delimiter Badges with label without / are considered to be classes.

Labels for other badges should match following syntax: "label_of_class_they_belong_to/label_for_the_badge"

name string Name of this badge or badge class.
flags bitmask(BADGE_FLAG_XXX, ...);
COPY_TO_RELATED_ENTITY
NAME_LIST_STOP
NAME_LIST_FIRST_ONLY
USE_COMPANY_COLOUR
Recolour badge depending on company that player currently controls.
NAME_SKIP

Badge variables

name value range comment
intro_date IDK

Badge callbacks

callback return value comment
default spriteset Graphics for the badge or badge class.

aircraft
airports
airporttiles
houses
industries
industrytiles
objects
railtypes
roadstops
roadtypes
roadvehs
ships
stations
trains
tramtypes

spriteset Override default graphics when used by other specific feature.

Example code

item (FEAT_BADGES, power) {
    property {
        label: "power";
        name: string(STR_POWER);
    }
}

item (FEAT_BADGES, diesel) {
    property {
        label: "power/diesel";
        name: string(STR_POWER_DIESEL);
    }
}

item (FEAT_BADGES, steam) {
    property {
        label: "power/steam";
        name: string(STR_POWER_STEAM);
    }
    graphics {
        default: sprite_steam;
    }
}