import{_ as e,c as a,o as t,d as o}from"./app.99998402.js";const p=JSON.parse('{"title":"The-Modding-Tree","description":"","frontmatter":{},"headers":[{"level":2,"title":"General:","slug":"general","link":"#general","children":[]},{"level":2,"title":"Common components","slug":"common-components","link":"#common-components","children":[]},{"level":2,"title":"Other components","slug":"other-components","link":"#other-components","children":[]}],"relativePath":"public/gamedevtree/docs/!general-info.md","lastUpdated":null}'),n={name:"public/gamedevtree/docs/!general-info.md"},r=o('
The main way to add content is through creating layers. You can either add a layer directly in the layers object in layersSupportjs, or declare it in another file and then do "addLayer(layername, layerdata)
" (good for breaking things up into smaller files). The existing layers are just examples and can be freely deleted. You can also use them as references and a base for your own layers.
The first thing you need to do is to edit the modInfo at the top of game.js to set your modID (a string). A unique modId will prevent your mod's saves from conflicting with other mods.
Most of the time, you won't need to dive deep into the code to create things, but you still can if you really want to.
The Modding Tree uses break_eternity.js to store large values. This means that many numbers are Decimal objects, and must be treated differently. For example, you have to use new Decimal(x)
to create a Decimal value instead of a plain number, and perform operations on them by calling functions. e.g, instead of x = x + y
, use x = x.add(y)
.
Almost all values can be either a constant value, or a dynamic value. Dynamic values are defined by putting a function that returns what the value should be at any given time.
All display text can be basic HTML instead (But you can't use most Vue features there).