Jump to content

7 Screenshots

  • 4.8k
  • 50
  • 45.03 kB

depends on

Works with

About Techtree

The plugin has been revamped. Customize the Techtree however you like. It will replace the vanilla one by default, but this option can be changed in the configuration. 

Data files from previous versions are not compatible with the new version. 

 

You have two options:

  1.  Replace the vanilla tech tree and customize it. 
  2.  Keep the vanilla tech tree and create a completely customized tech tree. 


⚠️ If you use Oxide,  Carbon Aliases  if required ! Else ignore this.

 

 

Feature

  • TechTree customizable
  • TechTree by Workbenchlevel
  • Multiple rewards (ChatCommand / ConsoleCommand / Economics)
  • Item custom support
  • Reward if tree is all unlocked (in datafiles)
  • No command to open
  • Automatic replace the vanilla tree or press the Use key R  on the Workbench to open
  • Multilingual support
  • CUI Editor

 

CUI Editor

 


Permissions

  • techtree.use                             // Grants permission to use the tech tree
  • techtree.unlock.free                // Grants permission to unlock everything for free
  • techtree.unlock.instant           // Grants permission to bypass unlock time
  • techtree.unlock.path              // Grants permission to unlock the entire branch up to the unlocked node

 

Information

  • Default vanilla tree are created on plugin load
  • Automatic import of new nodes added by Facepunch
     
  • ❗If you want to remove a vanilla node from your TechTree, you must first backlist it, otherwise it will be automatically added back the next time the plugin is reloaded. An option is available for this.
  • ❗I recommend modifying the tree only when players are not using it to avoid synchronization issues. 

 

General Settings

 

{
  "Settings": {
    "Wipe Player Data at Wipe": true,
    "Time For Unlock Node": 1.0,
    "Selected Theme": "Default",
    "Use Permissions ?": false,
    "Use Economics ?": false,
    "Replace tree vanilla ? Open with [R] if false": true
  }
}

 

Techtree Data

 

  • ID: ID  of the node.
  • Vanilla ID: default ID for facepunch
  • Parent: List of parent node required to unlock this node.
  • Image URL or Item: Image used, via URL or in-game item (ID/Skin).
    • Type: Type of Image (URL  or Item).
    • Value: Url (string) if URL or ItemID and SkinID if Item.
  • Grid Position: Node position on the grid (x, y).
  • Player Info: information displayed on the UI
    • Name: In-game name for this node.
      • Lang: Dictionary for multilingual support
    • Description: Short description of the node.
      • Lang: Dictionary for multilingual support
  • Price: Cost to unlock this node.
  • Curency: Resource needed to pay the price (ID/Skin).
    • ItemID
    • SkinID
  • Rewards: List of rewards obtained after unlocking.
    • Type: Type of reward (ChatCommand, ConsoleCommand or Economics).
    • Value: Value or command associated with the reward (string).

 

"TechTree": [
	{
      "ID": 40046421,
      "Vanilla ID": 84,
      "Parent": [
        1865581242
      ],
      "Image URL or Item": {
        "Type": "Item",
        "Value": {
          "Item ID": 2090395347,
          "Skin ID": 0
        }
      },
      "Grid Position": {
        "x": 3.5,
        "y": 6.5
      },
      "Player Info": {
        "Ingame Name": {
          "Lang": {}
        },
        "Description": {
          "Lang": {}
        }
      },
      "Price": 30,
      "Curency": {
        "Item ID": -932201673,
        "Skin ID": 0
      },
        "Rewards": [
          {
            "Type": "ChatCommand",
            "Value": "say Congratulations!"
          },
          {
            "Type": "ConsoleCommand",
            "Value": "c.grant user playerID perm.use"
          },
          {
            "Type": "Economics",
            "Value": "6500"
          }
        ]
      },
  ],
  "Extra": {
    "Reward On All Node Unlocked": [
      {
        "Type": "ChatCommand",
        "Value": "say Congratulations, you all unlocked!"
      },
      {
        "Type": "Economics",
        "Value": "20000"
      }
    ]
  }

 

Image configuration exemple

With URL :  

"Image URL or Item": {
          "Type": "Url",
          "Value": "https://imgur.com/SRGgaKX.png"
        },

With ITEM :  

"Image URL or Item": {
        "Type": "Item",
        "Value": {
          "Item ID": -1966748496,
          "Skin ID": 0
        }
      },

 

Lang

 

{
  "CLOSE": "Close",
  "EDITMODE": "Edit mode",
  "PLAYERMODE": "Player mode",
  "SAVE": "Save",
  "ADD": "Add",
  "REMOVE": "Remove",
  "MODIFY": "Modify",
  "CANCEL": "Cancel",
  "CONFIRM": "Confirm",
  "SELECT": "Select",
  "NONE": "None",
  "GRIDSETTING": "Grid Setting",
  "NOTAVAILABLE": "Not yet available",
  "TOTALREQUIRED": "Total required",
  "OPEN": "[R] OPEN",
  "Workbench_1": "LEVEL 1",
  "Workbench_2": "LEVEL 2",
  "Workbench_3": "LEVEL 3",
  "Engineering": "ENGINEERING",
  "NO PERM": "You don't have permission.",
  "EXCLUDE": "Exclude from vanilla sync",
  "EXCLUDED_NODES": "Excluded Nodes",
  "NO_EXCLUDED_NODES": "No excluded nodes",
  "EXCLUDE_RESTORED": "{0} nodes restored",
  "EXCLUDE_ADDED": "{0} nodes excluded",
  "EXCLUDE_ALL": "Exclude All",
  "CLEAR_ALL": "Clear All",
  "DELETE_ALL_NODES": "Delete All Nodes",
  "UPDATE_GRID": "Update Grid",
  "NODES_DELETED": "{0} nodes deleted",
  "RESET_TO_VANILLA": "Reset to Vanilla",
  "ARE_YOU_SURE": "Are you sure ?",
  "SAVING_APPLY_TOOLTIP": "Saving apply",
  "RESET_VANILLA_TOOLTIP": "Tech tree reset to vanilla defaults",
  "EXCLUDE_TOOLTIP": "Excludes this vanilla node from automatic imports. Useful for permanently removing a vanilla node from your tech tree.",
  "REWARD_TOOLTIP": "Use the “playerID” tag in your command if you need to specify a player. ex: c.grant user playerID perm.use.",
  "LANG_TOOLTIP": "“Default” will use the default text for the item; otherwise, the added language will be used."
}


Api
 

(Dictionary<string, object>) GetPlayerUnlocked(BasePlayer player)
// Return key "workbench" and Dictionary value { Workbench, List<int> }

(List<int>) GetPlayerUnlocked(BasePlayer player, Workbench workbench)
// Return List<int> 


Hook
 

// Called before a tech tree node is unlocked.
private object OnNodeUnlock(Workbench workbench, Dictionary<string, object> node, BasePlayer player)
{
  Puts("OnNodeUnlock has been called!");
  return null;
}

// Called before a tech tree node is unlocked.
private object OnNodeUnlock(BasePlayer player, Dictionary<string, object> node, Dictionary<string, object> treeData)
{
  Puts("OnNodeUnlock has been called!");
  return null;
}

// Called when a tech tree node is unlocked.
private void OnNodeUnlocked(Workbench workbench, Dictionary<string, object> node, BasePlayer player)
{
  Puts("OnNodeUnlocked has been called!");
}

// Called when a tech tree node is unlocked.
// Same behavior as OnNodeUnlocked but returns the list of notes directly.
private void OnPathNodeUnlocked(Workbench workbench, List<object> nodes, BasePlayer player)
{
  Puts("OnPathNodeUnlocked has been called!");
}


Api and Hook Doc

 

  Dictionary<string, object> node:

  "id"           : int
  "vanillaId"    : int?
  "price"        : int
  "parents"      : List<int>
  "isVanilla"    : bool
  "currency"     : Dictionary<string, object> => "itemId"  : int
  						 "skinId"  : ulong 

  Dictionary<string, object> treeData:

  "workbench"    : Workbench
  "nodes"        : List<Dictionary<string, object>>


  Api GetPlayerUnlocked(BasePlayer player) : Dictionary<string, object> => "workbench", { Workbench, List<int> }

  Api GetPlayerUnlocked(BasePlayer player, Workbench workbench) : List<int>


Contact

  • Send me a private message on Codefling
  • Send me a message on Discord: gd.kenni
  • Like 1
  • Love 2

Gd.Kenni's Collection

User Feedback

2.2m

Downloads

Total number of downloads.

10.1k

Customers

Total customers served.

146.3k

Files Sold

Total number of files sold.

3.1m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.