diff options
Diffstat (limited to 'docs/map_format.md')
| -rw-r--r-- | docs/map_format.md | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/docs/map_format.md b/docs/map_format.md index 57d46eb..aa44276 100644 --- a/docs/map_format.md +++ b/docs/map_format.md @@ -11,17 +11,12 @@ This object has several properties: - field (list of strings): Indicates what kind of tile each location should have. The kind of tile is denoted with a single character (can be any unicode character) that can be looked up in the mapping. The list should be as long as the height, and each string should be as long as the width (though it will be cut off or filled in with empty tiles if it is too long or short). - mapping (json dict): A dictionary that denotes what each character in the field corresponds to. The key is a single character. The value is either a template or a list of templates. -A template is either a string, or a json object with at least the property "type" (a string) and possibly the properties "args" (a list of parameters) and "kwargs" (a json dict of parameters). The usage of "args" is discouraged. +A template is either a string, or a json object with at least the property ":template" (a string, referring to the entity type). +The other properties are parameters belonging to that template -The following templates are equivalent: `"grass"`, `{"type": "grass"}`, `{"type": "grass", "args": [], "kwargs": {}}` +The following templates are equivalent: `"grass"`, `{":template": "grass"}` -A parameter can be a string, an integer, a float, a boolean, a list (not the same as a json list) or a template. -The specific type can be given explicitly by giving a list of 2 elements: the first is the type (as string), the second the actual value. -For example: `["int", 3]`. -For integers, floats and booleans the type can be derived from the json value. -Templates need to be in the object form or with explicit type annotation because they would otherwise be seen as strings. -Lists always need the type annotation. -For example a list of pairs of a template and a float would look like this: `["list", [["list", [{"type": "carrotseed"}, 1.0]],["list", [{"type": "carrot"}, 1.0]]]]` +A parameter can be a string, an integer, a float, a boolean, a list or a template. The type of a template refers to an assemblage in the encyclopedia. The args and kwargs of the template are arguments to that assemblage. @@ -71,13 +66,13 @@ The encyclopedia has to be checked to see what arguments an assemblage uses and "T": ["grass", "tree"], "f": ["grass", "fence"], "X": "rock", - "*": ["grass", {"type": "spawner", "kwargs": {"template": {"type": "pebble"}, "delay": 1200, "initial_spawn": false}}], - "o": ["grass", {"type": "spawner", "kwargs": {"template": {"type": "stone"}, "delay": 1200, "initial_spawn": false}}], - "%": {"type": "portal", "kwargs": {"destination": "broom", "destpos": "northentry"}}, - "1": {"type": "portal", "kwargs": {"destination": "smallview"}}, + "*": ["grass", {":template": "spawner", "template": {":template": "pebble"}, "delay": 1200, "initial_spawn": false}], + "o": ["grass", {":template": "spawner", "template": {":template": "stone"}, "delay": 1200, "initial_spawn": false}], + "%": {":template": "portal", "destination": "broom", "destpos": "northentry"}, + "1": {":template": "portal", "destination": "smallview"}, "^": ["grass", "spiketrap"], - "d": ["grass", {"type": "spawner", "kwargs": {"template": {"type": "dummy"}, "delay": 100, "initial_spawn": true}}], - "r": ["grass", {"type": "spawner", "kwargs": {"template": {"type": "rat"}, "amount": 3, "clan": "rats", "delay": 200, "initial_spawn": true}}], + "d": ["grass", {":template": "spawner", "template": {":template": "dummy"}, "delay": 100, "initial_spawn": true}], + "r": ["grass", {":template": "spawner", "template": {":template": "rat"}, "amount": 3, "clan": "rats", "delay": 200, "initial_spawn": true}], "V": ["grass", "radishplant"], "/": ["grass", "sword"], "D": ["ground", "closeddoor"], |
