TechTree (4)

All currently available hooks that are found in Carbon. Most hooks would be ones compatible with Oxide, although there are Carbon-only ones as well.

  • Called when a player is attempting to unlock a blueprint in a tech tree.

  • Useful for bypassing unlock requirements or disallowing particular blueprints from being unlocked.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches TechTreeData.PlayerCanUnlock of Assembly-CSharp.dll.

Example
object CanUnlockTechTreeNode(BasePlayer player, TechTreeData.NodeInstance node, TechTreeData self)
{
    Puts("CanUnlockTechTreeNode was called!");
    return (bool) null;
}
  • Called when a player is attempting to unlock a blueprint in a tech tree, after the CanUnlockTechTreeNode hook, when determining whether they have the prerequisite blueprints unlocked.

  • Useful for customizing prerequisites without conflicting with the CanPlayerUnlock hook.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches TechTreeData.PlayerHasPathForUnlock of Assembly-CSharp.dll.

Example
object CanUnlockTechTreeNodePath(BasePlayer player, TechTreeData.NodeInstance node, TechTreeData self)
{
    Puts("CanUnlockTechTreeNodePath was called!");
    return (bool) null;
}
  • Called when a player is attempting to unlock a blueprint in a tech tree, after the CanUnlockTechTreeNode and CanUnlockTechTreeNodePath hooks, before the player is charged scrap.

  • Useful for replacing the default behavior to charge the player a different currency, or to unlock multiple blueprints at once (such as those leading up to the one selected).

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches Workbench.RPC_TechTreeUnlock of Assembly-CSharp.dll.

Example
object OnTechTreeNodeUnlock(Workbench self, TechTreeData.NodeInstance local2, BasePlayer local0)
{
    Puts("OnTechTreeNodeUnlock was called!");
    return (object) null;
}
  • Called after a player has unlocked a blueprint in a tech tree.

  • Useful for automatically unlocking blueprints for team members.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches Workbench.RPC_TechTreeUnlock of Assembly-CSharp.dll.

Example
void OnTechTreeNodeUnlocked(Workbench self, TechTreeData.NodeInstance local2, BasePlayer local0)
{
    Puts("OnTechTreeNodeUnlocked was called!");
}

This hook requires OnTechTreeNodeUnlock, which loads alongside OnTechTreeNodeUnlocked.

Last updated