Effect templates
A template is one map effect saved on its own, so you can use it on many maps. Changing the template changes everywhere it’s used.
Templates are in blockfront/assets/server/templates/.
Writing a template
Section titled “Writing a template”A template holds one effect, in mapEffect:
{ "mapEffect": { "effectType": "positioned_timed_sound", "uuid": "3edfacf0-51b5-4262-ac30-045d44962e92", "sound": "bf:ambient.lsp.church.bell0", "volume": 8.0, "pitch": 1.0, "activationDistance": 512.0, "maxTime": 3600 }}| Field | Required | Default | Description |
|---|---|---|---|
mapEffect |
Yes | The effect. | |
type |
No | single |
Reserved, and ignored. |
An effect’s position in a template is an offset from where the template is placed, not a world position. Leave it out or use zero, unless the effect should sit away from that spot.
Using a template
Section titled “Using a template”Add a template to an environment’s mapEffectTemplates list in a map asset. Templates can only be used in environments, not in the map’s top-level mapEffects.
{ "mapEffectTemplates": [ { "template": "tmp_positioned_sound_church_bell", "overrides": { "position": { "x": -30.5, "y": 27.0, "z": 703.5 } } } ]}| Field | Required | Description |
|---|---|---|
template |
Yes | The template’s name, which is its file name without .json. |
overrides |
No | The position, and any fields to change for this use. |
Overrides
Section titled “Overrides”position in overrides is where the template goes in the world. It’s added to the template’s own offset, and it’s 0, 0, 0 if you leave it out.
Any other key replaces that field of the effect, for this use only:
{ "template": "tmp_positioned_sound_church_bell", "overrides": { "position": { "x": 100.0, "y": 64.0, "z": 200.0 }, "volume": 5.0 }}An override replaces the whole field, so to change one value inside a nested object, include the full object.
A placed template always gets its own generated uuid, built from the template’s name and its place in the mapEffectTemplates list. It stays the same across reloads unless the list order changes. A uuid in overrides or in the template itself is ignored.
Making a template in game
Section titled “Making a template in game”Open an effect in the map effect edit screen and choose to convert it to a template, then give it a name. The game saves the template, and replaces the effect with a template placed at the same position.
Templates load before maps. After changing a template file by hand, run /assets reload.
