Frostdev

KilnAPI reference Guide

The mapMarkerLooks registry

How the map treats each kind of map marker on this player's game: whether it offers the fast-travel action on it and draws it as a fast-travel point. One entry per kind of marker, named by the marker's own id, never its place in the game's list. Presentation only: the server decides where a player may travel, and the server has no marker settings. Client-authored: each player's own game applies it after a restart; it is never sent to a server or compared when a player joins. Not checked in a real game yet. Since 0.2.0-dev.32.2.

Schema version 0.1.0, experimental (KILNX031: may change in any release until it is marked stable). C# entry type Kiln.Registry.MapMarkerLookEntry. What registries are, the stages, the conflict rules and how ids are made: README.

Edits per call: 4,096. One OnRegistry callback (one phase of one entry point) or one Registries.Change takes at most this many edits of this registry; a call with more is refused whole, with the reason in kiln.log and registry.json, and nothing of it applies (the other calls do). The default for a registry whose schema declares none (4,096).

Ids

  • Game entries: game:marker_<the marker kind's 32-bit id, 8 hex digits>. Mod entries: (none: the kinds of map markers are the game's). All ids are lower case. The mod ids game and kiln are reserved: no mod's entries use them.
  • An entry has its marker kind's own 32-bit id as eight lower-case hex digits: game:marker_1095684e. The game's list order is never part of the id, so a game update that reorders the list moves no edit.
  • Names: DisplayName (never empty; display names) is the marker kind's name in the game's text where it has one, else a name made from its icon's name in the game's data, else one made from the id (Marker 1095684e).

Fields

Applies: now = takes effect at the next use; worldLoad = takes effect when a world loads; restart = takes effect after a game restart. Ops: number = a value or the relative operations (mul, add, min, max, raiseOnly, lowerOnly); set = a value; list = clear, append, remove, replace; indexed = a list of fixed length, edited one element at a time (xpPerLevel[2]) with a value or a number operation. A field of a list's elements is named with [] in this table and with the element's index in an edit (entries[3].chance, or [*] for every element). Mapping: whether this Kiln maps the field onto the game; an unproven or unmapped field is refused per entry, with the reason, until a Kiln update maps it. Joined client: when a joined Kiln client consumes a server edit; see README.

Field Type Applies Ops Since Mapping Joined client About
fastTravelAction bool restart set 0.1.0 mapped localOnly Whether the map offers its fast-travel action and draws the marker as a fast-travel point on this player's game (true for six markers on this build). Presentation, not permission: it does not make a place a destination the server accepts. Since 0.2.0-dev.32.2. Read by game clients only.

Entries

  • Add (stage add, id <your mod id>:<name>): no. The kinds of map markers are the game's: a mod changes how the map treats one, it cannot add a kind here.
  • Remove: no. Every kind of marker stays the game's: one cannot be removed.
  • Raw game paths in edits (the Advanced tier): allowed.

Edit it from a data pack

This registry has one entry per kind of map marker (49 on this build: altars, spires, dungeons, custom pins, ...), named by the kind's own 32-bit id: game:marker_1095684e. The id never depends on where the kind sits in the game's list, so a game update that reorders the list moves no edit; a kind the game drops refuses the edits naming it. Each entry's display name is the kind's name in the game's text where it has one (few kinds have one), else a name made from its icon's name in the game's data (the icon catalog's well_plant gives "Well Plant"), else one made from the id ("Marker 1095684e").

fastTravelAction says whether the map offers its fast-travel action on markers of that kind and draws them as fast-travel points, on the player's own game (true for six kinds on this build). It is presentation, not permission:

  • "select": "game:marker_6a56c5b3", "field": "fastTravelAction", "op": false stops the map offering fast travel on that kind.
  • Setting it true on another kind lets the map's own code treat that kind as a fast-travel point (what the map then shows is not checked in a real game); whether a player may travel there stays the game's and the server's rule, which check the destination separately. A kind made a "fast-travel point" here is not a destination the server accepts.

Every field applies after a restart of the player's game, and only from GameStart.

Edit it from C#

[RegistryEntryPoints(RegistryEntryPoint.GameStart)]
public sealed class QuietMap : Mod
{
    public override void OnRegistry(RegistryContext context)
    {
        if (!Kiln.Registry.Registries.Available) return;
        Kiln.Registry.Registries.For(context).Alter(stage =>
        {
            var spire = stage.MapMarkerLooks["game:marker_a17072be"];
            spire.FastTravelAction = false;
        });
    }
}

RegistryStage.MapMarkerLooks holds MapMarkerLookEntry values by Kiln id; DisplayName names the kind as the paragraph above says. On a dedicated server the stage skips these edits with an informational line (client-only field: it applies on each player's own game): the server has no marker settings.

Views

RegistryViews.Find("mapMarkerLooks") is the stable view of the kinds and their flags as the stage composed them on this player's game.

Worked example

No fast-travel action on one kind of marker:

{
  "format": 1,
  "registry": {
    "alter": [
      { "registry": "mapMarkerLooks", "select": "game:marker_a17072be", "field": "fastTravelAction", "op": false }
    ]
  }
}

A pack of these edits alone is a look each player chooses for their own game: give it "side": "client". The server needs nothing.

In multiplayer

The values are client-authored: each player's game composes its own from the mods it has, at its own start. They are never sent to a server, never received from one and never compared when a player joins (joinedClient: localOnly; they are not part of the join's registry values). The server decides where a player may travel whatever a player's map offers. In a mod that runs on both sides ("side": "both"), the dedicated server skips these edits (an informational line in kiln.log and registry.json skipped, never a refusal) and applies its shared ones.

Known limits

  • Not checked in a real game yet: the native tests write the flag of one kind into a copy of the marker data with Kiln's real boot writer (only that kind's byte changes, wherever the list puts it), and Kiln's offline client proof, run with the release, reads, writes and reverts it on a copy of the client's own data; a map offering or hiding the action has not been seen.
  • fastTravelAction is presentation only: it grants no fast-travel destination.
  • A name made from an icon's name is the game's data's, not a text the game shows; most kinds have no text of their own.
  • The kinds' other settings (icon, label, colours, zoom steps) are not in this registry.

Enshrouded is a trademark of Keen Games GmbH. Kiln is unofficial.