TMT HELP
Hello! If you have ever tried to make a TMT mod but just couldn't figure out how to get started, this website will hopefully help you get started and make your first TMT masterpiece. This will go over how to make layers, upgrades, and much more. So, let's get started!
What Is TMT?
So first of all, what even is TMT? TMT is an abbreviation for The Modding Tree. The Modding Tree is a GitHub fork where you can make your own Prestige Tree like game. This can also refer to the website called The Modding Tree, that you probably found this on, which is 1 of the 2 places I like to share my TMT games. There's also Galaxy.click, which is more high-maintained and harder to get games public on, so I recommend starting with using The Modding Tree for your first mod or 2. So now that you know what TMT is, let's get started with the basics of making your first mod.
Let's Start With Mod.js
Mod.js is the file where most of your game information is. This includes the following: mod name, mod ID, pointsName, discord link, discord name, mod author, and more. You're probably wondering what most of this stuff is, so here's a fast breakdown:
-
name: the name of your TMT mod. This is also what will appear on the tab of your game.
-
author: the name of the person who made the mod.
-
pointsName: the name of the points currency on the top of the screen. This will not affect what you type in the code.
-
id: I don't recommend changing this, as it may interfere with other TMT mods.
That is the main mod info, but there's still a lot more in mod.js to talk about. Mod.js also contains your changelog, point gain, start points, and max offline time. Let's start with the changelog. The changelog is basically where you log your updates, or changes. This can use basic HTML, or Hyper Text Makeup Language. It may sound complicated, but it's really just plain text. for example, if you want something to say "hello!", you just type "hello!".
That's how easy HTML is. There are also many ways you can customize your text. For example, if you want to make something bold, you would type "<b>my bold text</b>. Any text customization will be formatted like <{text command>your text</{same text command}>. The slash (/) in the end <> is for the end, as the text command will continue forever without it. For more text customization, go to HTML Reference. Another important thing to know is that every time a line ends, no matter how short it is, needs a comma at the end, or the code after it won't work. Start points is how many points you start with after doing a hard reset. And what may be the most important thing in mod.js, functionGetPointGain(). This will set how many points you get per second. When you look at this, your first reaction might be "why does it say new Decimal(number)?" That's because the numbers are decimals, to break infinity. So just remember to type new Decimal(number) for every number and you should be good. For numbers more than infinity, or 1.78e308, the only thing that is different is that you change the (number) to ("number"), with commas. So, now let's get started with...
Layers.js
Layers.js is where all your layers and most content is. To add your first layer, this is what to copy and paste (for blank file only), with what most code does:
addLayer("p", {
name: "prestige", // This is optional, only used in a few places, If absent it just uses the layer id.
symbol: "P", // This appears on the layer's node. Default is the id with the first letter capitalized
position: 0, // Horizontal position within a row. By default it uses the layer id and sorts in alphabetical order
startData() { return {
unlocked: true, //determinds if it's unlocked by default
points: new Decimal(0), //sets the amount of this layer to that number when hard reseted
}},
color: "#4BDC13", //the color that appears on the layer node
requires: new Decimal(10), // Can be a function that takes requirement increases into account
resource: "prestige points", // Name of prestige currency
baseResource: "points", // Name of resource prestige is based on
baseAmount() {return player.points}, // Get the current amount of baseResource
type: "normal", // normal: cost to gain currency depends on amount gained. static: cost depends on how much you already have
exponent: 0.5, // Prestige currency exponent
gainMult() { // Calculate the multiplier for main currency from bonuses
mult = new Decimal(1)
return mult
},
gainExp() { // Calculate the exponent on main currency from bonuses
exp = new Decimal(1)
return exp
},
row: 1, // Row the layer is in on the tree (1 is the first row)
hotkeys: [
{key: "p", description: "P: Reset for prestige points", onPress(){if (canReset(this.layer)) doReset(this.layer)}},
],
layerShown(){return true}, //what needs to be true for the layer to show
}) // end of layer