Map props
A mod can add props: things a map stands on its ground that belong to nobody, beside the game's power pylons, water towers, palms, tents, hangars, bunkers and the sunken freighter. While the mod is on, its props are in the map editor's Props palette after the game's, and a map dresses its ground with them the same way.
A prop is part of the map, not the match. Every tile of its footprint is an obstacle: units path round it and nothing is built on it. No gun ever picks one. Only force fire and splash take its hit points off, and it comes down as a ruin over a scar; a prop that lies on the water (water) goes under instead and leaves a slick. A props-only mod can supply "defs": [].
Maps that stand them
Enabling a mod changes no map. A map names its props by kind, "decor": [{ "kind": "my-mod-haystack", "x": 12, "y": 30 }], which the editor writes for you. A map with a mod's prop reads only where that mod is on, as a map standing the mod's units does, and a save or a replay played on it asks for the mod. The map registry takes the game's props only, since its maps are played by people without any mod: ship a map that uses your props under maps in your own mod.json.
Drawings
A prop draws with the sheet d.<id> in sprites, and its variants with d.<id>2, d.<id>3 and on up to its variants. Each item wears one, picked by its tile, so a row of haystacks is not one haystack stamped out. Every d. sheet must draw one of the mod's props.
Draw a prop as you would a building: one image, never rotated, with a slight top-down southern tilt. The footprint is the bottom fw×32 by fh×32 pixels of the frame, and anything above it stands over the ground behind; width, height and anchor are sized from the footprint automatically. A prop keeps its own colours, so leave teams off. A strip of frames plays at fps, for sails that turn or a flag that flies. A tall thing on a trunk or legs whose art has no ground of its own can ask for a contact shadow. A drawing no sheet gives is painted in code as a crate on the footprint in the prop's color, so a mod can be tried before its art is done.
Reference
A prop (decor[])
| field | type | required | default | meaning |
|---|---|---|---|---|
| id | id | yes | unique prop id, prefixed with the mod id and a dash, at most 38 characters; its drawing is the sheet `d.<id>` | |
| name | text | yes | the prop's name in the editor's palette | |
| fw | integer 1–8 | 1 | footprint width in tiles: every tile of it is an obstacle, as a building's is | |
| fh | integer 1–8 | 1 | footprint height in tiles | |
| hp | number 1–5000 | yes | hit points, taken off raw: only force fire and splash ever reach a prop (a pole has 20, a tent 90, a bunker 340) | |
| color | string | #625e56 | its paint on the minimap and the map cards, #RRGGBB | |
| variants | integer 1–8 | 1 | how many drawings it has: `d.<id>`, then `d.<id>2`, `d.<id>3`…; each item wears one, chosen by its tile | |
| shadow | number 0–48 | 0 | a contact shadow under its foot, the half-width in world px: for a tall thing on a trunk or legs whose art has no ground to stand on (a palm has 9) | |
| water | boolean | false | stands on deep water rather than on floor, and sinks rather than falls (a wreck) |
Last edited