Skip to content

Labels ​

Every tent with a shape has a sign above its door. The model carries a baked "FIELD HOSPITAL" sign; near the tent, the client draws the tent's own label over it. There is no model per label.

Concept: labelled open tents

Concept: labelled door tents

The two images are concept renders, not in-game screenshots.

What a label is ​

lua
label = { title = "OP", subtitle = "CHIRURGIE · ZUTRITT NUR PERSONAL", accent = "teal", icon = "lungs" } -- icon may be nil
ref   = "b:<builtin key>"        -- a built-in label, e.g. "b:op"
      | "f:<faction>:<n>"        -- a faction's own label

A label is a title, a subtitle, a colour band (accent) and an optional icon, chosen from the lists in Config.Labels (Configuration). Players never upload images.

  • Built-in labels (Config.Labels.builtin) are available to every faction.
  • A faction's own labels are available only to that faction. At most maxPerFaction (24) per faction.
  • A new tent gets Config.Labels.default (sanitaet).

Who can do what ​

Action Needs
Create, edit, delete the faction's labels (tablet: label designer, /feld schild) medic.fieldplan and a faction
Change the label of a tent (tent interaction "Schild wechseln", within 10 m) medic.deploy

Editing a label updates every tent that uses it at once. Deleting a label sets its tents back to the default label.

Validation ​

The server checks every label (shared/labels.lua):

  • the text is uppercased; at most maxTitle (18) and maxSubtitle (44) UTF-8 characters;
  • allowed characters: A–Z, 0–9, ÄÖÜ, space and . , - / · & + ( ) # : ';
  • the accent and the icon must come from the config lists;
  • words in Config.Labels.blocked are matched with spaces, dots and umlauts removed.

A refused label answers with a reason code (bad_label, blocked, limit_labels, no_plan, no_faction) and a German message to the player.

Drawing ​

  • One DUI page (web/dui.html, 2048 × 2048) paints up to 16 different labels into a 2 × 8 atlas of 1024 × 256 slots. Equal labels share a slot. The tablet's designer uses the same renderer (web/label.js).
  • Each frame, every tent within drawDistance (60 m) is drawn as two DrawSpritePoly triangles, 6 mm in front of the baked sign. The corners come from the tent entity (GetOffsetFromEntityInWorldCoords).
  • The DUI is created when the first tent comes into range and destroyed 30 s after the last one leaves.
  • Beyond drawDistance, or when the DUI or a slot is not available, the baked "FIELD HOSPITAL" sign stays.

Not verified in game

Whether the drawn label sits exactly on the sign, is readable from 5 to 60 m, does not z-fight and is bright enough at night (sprites are unlit) is still to be checked on a live server.