Modding
Discord Wishlist on Steam

Graphs

Maps (keys to values)

A map holds values under keys: a tally of kills under each player, a price under each item's name, a thing under a word. It is a kind like any other, with a key kind and a value kind: player to whole number, text to thing.

Making one

Add a variable, pick Map as its kind, then its Keys and Values kinds. Its starting pairs are rows of key → value, with + Row and a × each.

A map variable: text keys to whole numbers, starting with two pairs.
A map variable: text keys to whole numbers, starting with two pairs.

In a file, a map variable names its key kind as key and its value kind as type, and its value is a list of pairs:

json
{ "name": "debts", "kind": "Map", "key": "Text", "type": "Int", "value": [ ["Jakub", 12], ["Ondrej", 5] ] }

A key or value that is a thing of the game's names its type: "key": "Player.Character" is a player.

Its nodes

They are under Lists › Maps in the node list. Their pins take the kinds of the map wired in.

For each in map (under Flow › Loops) runs once for each pair, over the keys as they were when it started. A map variable's set node also has put and remove as operators (Variables and scopes).

Keys and saving

  • Pairs keep the order they were put in.
  • Keys are compared as numbers, as text, or as the same thing.
  • A map can be saved as lists are: numbers, text, positions, colours, things and items by address. People have no lasting identity and are kept as nothing.

The Bounty on bandits template tallies each player's kills in a map, and its note tells the player their count.