Action0/Badges: Difference between revisions

From GRFSpecs
Jump to navigation Jump to search
Content deleted Content added
Peter1138 (talk | contribs)
Created page with '''''''Action 0 properties for badges'''''' = Action 0 - Properties for badges = Defining properties of badges. == Properties == {| class="wikitable" |- !'''Number''' !'''V...'
 
Rito12 (talk | contribs)
Badge label (08): Use <code>
 
(7 intermediate revisions by 3 users not shown)
Line 10: Line 10:
|-
|-
!'''Number'''
!'''Number'''
!'''[[GRFActionsDetailed|Size]]'''
!'''Version'''
!'''Version'''
!'''Size'''
!'''Description'''
!'''Description'''
|-
|-
|08
|08
|{{ottdp|1.15}}
|S
|S
|{{ottdp|15}}
|Badge label. A zero-terminated string.
|Badge label. A zero-terminated string.
|-
|-
|09
|09
|{{ottdp|1.15}}
|D
|D
|{{ottdp|15}}
|Flags.
|Flags.
|}
|}
Line 31: Line 31:
These are globally unique strings.
These are globally unique strings.


Badge labels comprise a badge class, for grouping similar badges, and badge name, separated by a '/'.
Badge labels comprise a badge class, for grouping similar badges, and badge name, separated by a <code>/</code>.


Classes and names are arbitrary, but to be useful must follow a standard scheme. For instance, the badge label power/steam will define a badge for steam powered vehicles within the power class.
Classes and names are arbitrary, but to be useful must follow a standard scheme. For instance, the badge label power/steam will define a badge for steam powered vehicles within the power class.

Proposed initial classes are:

* flag
* role
* manufacturer
* operator
* power
* livery

It is also possible to assign a badge to everything within a NewGRF by defining the badge label <code>newgrf/<GRFID></code>, with the GRFID in full hexadecimal form. This will work even if the badge is defined outside of the NewGRF it is for.

=== Naming Proposal ===

To work consistently, a naming standard needs to be agreed on, e.g.:

/role/passenger
/role/freight

/livery/<country>/<operator>/<name>
/livery/uk/british_rail/blue
/livery/uk/british_rail/swallow
/livery/fr/sncf/tgv

The game could then present these as a filterable list, e.g.:

Role
Passenger
Freight

Livery
UK
British Rail - Blue
British Rail - Swallow
France
SNCF - TGV


== Flags (09) ==
== Flags (09) ==
Line 58: Line 94:
|8
|8
|UseCompanyColour. Apply appropriate company colour palette to the icon. If the icon is applied to a vehicle with 2CC support, then the 2CC palette will be used.
|UseCompanyColour. Apply appropriate company colour palette to the icon. If the icon is applied to a vehicle with 2CC support, then the 2CC palette will be used.
|-
|4
|16
|NameListSkip. Allow the badge to be excluded from the badge name list.
|}
|}

Latest revision as of 13:37, 12 February 2026

'Action 0 properties for badges'

Action 0 - Properties for badges

Defining properties of badges.

Properties

Number Size Version Description
08 S Supported by OpenTTD 1515 Not supported by TTDPatch Badge label. A zero-terminated string.
09 D Supported by OpenTTD 1515 Not supported by TTDPatch Flags.


Badge label (08)

These are globally unique strings.

Badge labels comprise a badge class, for grouping similar badges, and badge name, separated by a /.

Classes and names are arbitrary, but to be useful must follow a standard scheme. For instance, the badge label power/steam will define a badge for steam powered vehicles within the power class.

Proposed initial classes are:

  • flag
  • role
  • manufacturer
  • operator
  • power
  • livery

It is also possible to assign a badge to everything within a NewGRF by defining the badge label newgrf/<GRFID>, with the GRFID in full hexadecimal form. This will work even if the badge is defined outside of the NewGRF it is for.

Naming Proposal

To work consistently, a naming standard needs to be agreed on, e.g.:

/role/passenger
/role/freight
/livery/<country>/<operator>/<name>
/livery/uk/british_rail/blue
/livery/uk/british_rail/swallow
/livery/fr/sncf/tgv

The game could then present these as a filterable list, e.g.:

Role
  Passenger
  Freight
Livery
  UK
    British Rail - Blue
    British Rail - Swallow
  France
    SNCF - TGV

Flags (09)

Bit Value Meaning
0 1 Copy. Badge can be copied to related entity (e.g. badge on a railtype can be copied to rail vehicles of that railtype.)
1 2 NameListStop. Stops adding more names to the visible name list.
2 4 NameListFirstOnly. Add this name to the visible name list only if this is the first name.
3 8 UseCompanyColour. Apply appropriate company colour palette to the icon. If the icon is applied to a vehicle with 2CC support, then the 2CC palette will be used.
4 16 NameListSkip. Allow the badge to be excluded from the badge name list.