Mega Tree API
Validator
Paste a definition and see what Mega Tree would say about it - before you build, install and load a save to find out.
Paste the object initializer - the lines from Id = ... to the last
field. The surrounding tree.Register(new UpgradeDefinition { ... }) can
be there or not. Equivalent JSON works too. Nothing leaves your browser.
ForPlugin. Checked against the 18-character limit.
Result
Cost table
What it checks
| Area | Checks |
|---|---|
| Id | Present, 3-64 characters, prefix.name, lower case only, no double dot, not megatree./mt., not one of Mega Tree's own ids. |
| Name | DisplayName or NameKey present; warns when only the key is set. |
| Effect | DescribeLevel present. |
| Levels | 1 to 20; warns above 8 because the column gets hard to read. |
| Cost | A positive BaseCost or a CostForLevel; flags a multiplier below 1 or above 3, and a base high enough to be late-game money on its own. |
| Sell-back | SellBackRate inside 0..1, and flags a rate high enough to turn the upgrade into a piggy bank. |
| Icon | Built-in name exists; reminds you of the white-with-alpha rule for a PNG. |
| Gate | IsUnlocked without a LockedReason, and a RequiredStoreLevel that goes backwards or out of range. |
| Fields | Anything that is not a field of UpgradeDefinition - usually a typo. |
| Sub-tab | Length against the 18-character cut, when you fill it in. |
It knows the reserved prefixes and Mega Tree's own node ids. It has no idea which ids other mods in the community have already taken - there is no registry to ask. A unique-looking prefix based on your plugin guid is still your best protection against a collision.
It also cannot tell whether
DescribeLevel matches what your effect actually does. That one is on
you.
The cost table is the point
Beyond validation, this is a balancing tool. The table shows what each level costs, what the
whole line costs, and what the player gets back when they sell - at 50% by default, or at your
own SellBackRate if you set one.
Megastore's economy is the ruler. The player starts with $400, and these are the numbers the game itself charges:
| The game charges | Level 1 | Top | Whole thing |
|---|---|---|---|
| Store expansion | 600 | 13 800 | ~80 000 |
| Licence | 100 | 2 800 | ~15 000 |
And these are Mega Tree's own lines, for a closer comparison:
| Built-in | Levels | Level 1 | Full line |
|---|---|---|---|
| Walking Speed | 5 | 250 | 9 550 |
| Long Reach | 4 | 400 | 7 800 |
| Fast Cashier | 5 | 800 | 27 900 |
| Full Day Shift | 1 | 60 000 | 60 000 |
Land in that range and your upgrade sits naturally next to the rest of the tree. Come in far cheaper and it is the obvious first buy for everyone; far more expensive and nobody finds out what it does. The one exception is Full Day Shift, and it earns its price by changing how the entire store operates - if your node does that too, charge for it.