Tech Tree API
FAQ
Symptoms, and what actually causes them.
Nothing appears in the tree
First: read the log. Open
BepInEx/LogOutput.log and search for
[api]. Every registration, rejection and reason is written there with
your plugin guid.
| Log line | Fix |
|---|---|
id must be in 'prefix.name' form |
Ids need a dot: bigboxes.capacity, not capacity. |
invalid character '...' |
Lower case only, plus digits, _, - and dots. |
DescribeLevel is required |
Set it. It is the text the player reads. |
already belongs to ... |
Another mod claimed that id. Pick another. |
Nothing at all under [api] |
Your Load() never ran, or never reached the registration. Log something at the very top of it. |
An empty sub-tab is never drawn, and if yours was the only mod, the whole Mods tab is missing too - which looks like Tech Tree ignoring you when it is really every registration having failed.
My plugin does not load at all
| Symptom | Cause |
|---|---|
TypeLoadException mentioning TechTree.Api |
Installed Tech Tree is older than 1.3.0. |
| BepInEx says a dependency is missing | Tech Tree is not installed, or its dll is not in BepInEx/plugins. |
| Silence, no error | You inherited BaseUnityPlugin (Mono). IL2CPP needs BasePlugin and Load(). |
BepInEx logs a duplicate guid error for TechTree
Two copies of TechTree.dll are installed - almost always because a
mod shipped it inside its own folder. BepInEx loads one and drops the other, so the player may be
running a different version from the one they installed. Set
<Private>false</Private> on the reference and re-publish.
Project setup
The node is there but does nothing
You registered it and never wrote the effect. Tech Tree stores a number; what that number means is always your code. Events covers the three shapes an effect can take.
The effect works, then stops
You are writing a field the game rewrites on its own schedule. Patch the getter instead - the
game asks, you answer, and nothing can undo it. If there is no getter, re-apply on
Apply, always computing from a remembered base value rather than
adding to the current one.
The effect grows forever
Apply runs about every two seconds and you used
+=. Compute absolutely: value = base * factor,
never value += step. Details
The icon is invisible, or the wrong colour
Tech Tree tints icons through Image.color, and tinting multiplies.
Ship white artwork on a transparent background, or pass
whiteSilhouette: true. A dark icon multiplied by anything stays dark.
Icons
My node is locked forever
Your IsUnlocked returns false, or it throws - in which case the node
is treated as unlocked and there will be a warning in the log naming it. Also check
ComingSoon: that one can only be cleared by a mod update, never by the
player. Requirements
A player says my node is grey and wants a store level
That is Tech Tree 1.5.0's store-level gating, and it only touches your node if you set
RequiredStoreLevel. If you never set it, your node has no level
requirement and something else is locking it — check IsUnlocked
first.
If you did set it, remember the scale: the game's own last restocker unlocks at store level 50.
A node asking for 80 is a node almost nobody reaches. Players can also turn the whole mechanic off
with RequireStoreLevel = false in
BepInEx/config/TechTree.cfg, and that ignores your requirement along
with everyone else's. Node definition
Levels vanished after I updated my mod
You changed an id. The id is the save key: renaming it starts that line from zero and parks the old level in the kept block. Change the name, the price, the icon, the effect - never the id. Versioning
A player uninstalled my mod and lost their upgrades
They should not have, from Tech Tree 1.3.0 on: unknown ids are kept in the slot file and come back when your mod returns. If it happened, they were on 1.2.0 or earlier, where unknown ids were dropped on read and erased on the next save. Persistence
How do I change the sell-back rate for my node?
Since 1.3.1, set SellBackRate on your definition.
It takes 0 to 1 and affects only your node - the ten built-in upgrades stay at
60%, and there is no player-facing setting for it.
SellBackRate = 0.8f, // this node refunds 80%; everything else stays at 60%Anything outside 0..1 is clamped, with a warning in the log. Above 1 the player would profit by buying and selling in a loop.
Straying far from 60% costs you something, though. Near 1.0 the upgrade becomes a piggy bank - buy to park money, sell when you need it, for free. Near 0 it punishes anyone who experiments. And a player looking at one node that refunds 90% next to one that refunds 60% has no way to know why. Use it when your line genuinely needs it, not by default.
Can I add my own top-level tab?
No. There are three fixed categories plus Mods, and everything registered through the API lives in Mods, in your own sub-tab. That is what keeps the header readable with ten mods installed. The Mods tab
Can I pick my node's colour?
No. The Mods branch is violet for everyone. A tree where each mod picks its own palette stops reading as one tree.
Can I read or change another mod's node?
You can read any level with TechTreeApi.GetLevel, which is
what gating on another mod is built on. You cannot change or unregister a node you do not own -
Unregister checks the owner guid and returns false.
Can I give the player a level for free?
No. Levels change through the player buying or selling them, and that is deliberate: an API that could hand out levels would also be an API that could take them away, and both belong to the player. If you want a free effect, apply it in your own code without a node.
Does this work in multiplayer?
Levels are stored locally, per slot, and are not synchronised over Photon. In a co-op session each player has their own tree, and whether your effect is visible to everyone depends entirely on what your effect touches. Treat multiplayer as unsupported until you have tested your specific case.
Does registering many nodes slow the game down?
No. Lookups are dictionary-based and the applier caches its node references, so the cost of a node is roughly the cost of your own effect code. The 64-per-plugin limit is there to stop a runaway loop, not because 30 nodes would be slow.
Where do I ask something not on this page?
The Posts
tab on Nexus, or the Supermarket Simulator modding Discord. Include the
[api] lines from your log - they usually contain the answer already.