TalentTreeDef - Grim-/Talented GitHub Wiki

TalentTreeDef

The TalentTreeDef is a the main container for talent tree nodes, their connections and available paths.

The web app can generate these for you when you export your node arrangement.

TalentTreeDef Fields

treeName

  • Type: string
  • Description: The name of the talent tree shown to the user.
  • Example: "A Test Talent Tree"

dimensions

  • Type: IntVec2
  • Description: The dimensions of the talent tree layout, generally in pixels or logical units.
  • Example: "(800,600)"

handlerClass

  • Type: Type
  • Description: Specifies the type of handler that defines the behavior of the tree.
    • ActiveTreeHandler: Requires user input to unlock nodes.
    • PassiveTreeHandler: Automatically unlocks nodes under certain conditions.
  • Example: "Talented.ActiveTreeHandler"

skin

  • Type: TalentTreeSkinDef
  • Description: The visual style for the tree. Defaults to "DefaultTreeSkin" if none is specified.
  • Example: "DefaultTreeSkin"

nodes

  • Type: List<TalentTreeNodeDef>
  • Description: A list of root or start nodes in the talent tree. Typically includes the first node of the tree.
  • Example:
    <nodes>
      <li>ROOT_NODE</li>
    </nodes>
    

availablePaths

  • Type: List<TalentPath>
  • Description: A collection of the data of all paths used in this tree, if you use the web app this is generated for you.
  • Example:
<availablePaths>
           <li>
        <name>DeathKnightPath</name>
        <pathDescription></pathDescription>
        <pathColor>(0,0,0)</pathColor>
        <exclusiveWith>
          <li>GravityMagePath</li>
          <li>BuccaneerPath</li>
        </exclusiveWith>
      </li>
      <li>
        <name>BuccaneerPath</name>
        <pathDescription></pathDescription>
        <pathColor>(0,0,0)</pathColor>
        <exclusiveWith>
          <li>GravityMagePath</li>
          <li>DeathKnightPath</li>
        </exclusiveWith>
      </li>
      <li>
        <name>GravityMagePath</name>
        <pathDescription></pathDescription>
        <pathColor>(0,0,0)</pathColor>
        <exclusiveWith>
          <li>DeathKnightPath</li>
          <li>BuccaneerPath</li>
        </exclusiveWith>
      </li>
    </availablePaths>

Example Def

  <Talented.TalentTreeDef>
    <defName>GenericExampleTree</defName>
    <dimensions>(600,400)</dimensions>
    <handlerClass>Talented.ActiveTreeHandler</handlerClass>
    <skin>DefaultTreeSkin</skin>
    <nodes>
      <li>ROOT_NODE</li>
    </nodes>
    <availablePaths>
      <li>
        <name>DeathKnightPath</name>
        <pathDescription></pathDescription>
        <pathColor>(0,0,0)</pathColor>
        <exclusiveWith>
          <li>GravityMagePath</li>
          <li>BuccaneerPath</li>
        </exclusiveWith>
      </li>
      <li>
        <name>BuccaneerPath</name>
        <pathDescription></pathDescription>
        <pathColor>(0,0,0)</pathColor>
        <exclusiveWith>
          <li>GravityMagePath</li>
          <li>DeathKnightPath</li>
        </exclusiveWith>
      </li>
      <li>
        <name>GravityMagePath</name>
        <pathDescription></pathDescription>
        <pathColor>(0,0,0)</pathColor>
        <exclusiveWith>
          <li>DeathKnightPath</li>
          <li>BuccaneerPath</li>
        </exclusiveWith>
      </li>
    </availablePaths>
    <displayStrategy>FixedPosition</displayStrategy>
    <talentPointFormula>PerLevel</talentPointFormula>
  </Talented.TalentTreeDef>
⚠️ **GitHub.com Fallback** ⚠️