Creating A Skill Tree

The following will show the you steps of creating a basic skill tree, along with how to add certain buffs/effects to certain skills

Part 1: Creating a skill tree file

You will need to navigate to lua/wos/advswl/skills/trees

Next you must create a file, change the name of it to anything you want, but make sure that the extension is a lua file. EX: "exampletree.lua"

Navigate to https://pastebin.com/Ny76FhpP and copy all of its contents, you will want to copy this into your new skill tree lua file

 

Part 2: Setting up a skill tree's basic config

Upon opening your skill tree file, you will see something similar to this:

  1. local TREE = {}
  2.  
  3. --Name of the skill tree
  4. TREE.Name = "Ravager"
  5.  
  6. --Description of the skill tree
  7. TREE.Description = "Master the blade, not the mind"
  8.  
  9. --Icon for the skill tree ( Appears in category menu and above the skills )
  10. TREE.TreeIcon = "wos/skilltrees/ravager/main.png"
  11.  
  12. --What is the color for the background of skill icons
  13. TREE.BackgroundColor = Color( 255, 0, 0 )
  14.  
  15. --How many tiers of skills are there?
  16. TREE.MaxTiers = 3
  17.  
  18. --Add user groups that are allowed to use this tree. If anyone is allowed, set this to FALSE ( TREE.UserGroups = false )
  19. TREE.UserGroups = { "vip", "superadmin" }
  20.  
  21. --Add user groups that are allowed to use this tree. If anyone is allowed, set this to FALSE ( TREE.UserGroups = false )
  22. TREE.JobRestricted = { "TEAM_ONE", "TEAM_TWO" }
  23.  
  24. TREE.Tier = {}

 

 

  • Change the "TREE.Name" value to something unique, and different from all of your other trees. as otherwise errors will occur. This is what will display as the name when you access it through your Character Skill Station
  • "TREE.Description" will determine the sub-text beneath the name of the tree in your Character Skill Station, this does not have to be unique.
  • "TREE.TreeIcon" determines the icon of the tree itself, it will be displayed on the 3D cube when accessing the skill tree. Just place the file path of the icon you wish to use in place of the current one.
  • "TREE.BackgroundColor" determines the background color of the skill tree when accessing it, it is set by an RGB value
  • "TREE.MaxTiers" is a very important value which determines how many TIERS or LEVELS of skills there are, specifically we are talking about how many rows of skills there are. Remember to edit this value if you add more TIERS than the value set here.
  • "TREE.UserGroups" says which usergroups are allowed to access this skill tree, if set to "false" then all people, regardless of their usergroup, will be able to see it. 
  • "TREE.JobRestricted" says which darkrp jobs are allowed to access this skill tree, if set to "false" then all people, regardless of their job, will be able to see it. 

 

Part 3: Creating skills, tiers, etc.

Here we will actually create skills in your skill tree

What you should have currently looks like this:

  1. TREE.Tier[1] = {}
  2. TREE.Tier[1][1] = {
  3.     Name = "Strength",
  4.     Description = "+50 Max Health",
  5.     Icon = "wos/skilltrees/ravager/aid.png",
  6.     PointsRequired = 1,
  7.     Requirements = {},
  8.     LockOuts = {
  9.         [1] = { 2 }
  10.     },
  11.     OnPlayerSpawn = function( ply )
  12.         ply:SetMaxHealth( ply:GetMaxHealth() + 50 )
  13.     end,
  14.     OnPlayerDeath = function( ply ) end,
  15.     OnSaberDeploy = function( wep ) end,
  16. }
  17.  
  18. TREE.Tier[1][2] = {
  19.     Name = "Combatant",
  20.     Description = "Adds 30 base damage to your lightsaber",
  21.     Icon = "wos/skilltrees/ravager/comb.png",
  22.     PointsRequired = 1,
  23.     Requirements = {},
  24.     OnPlayerSpawn = function( ply ) end,
  25.     OnPlayerDeath = function( ply ) end,
  26.     OnSaberDeploy = function( wep )
  27.         wep.SaberDamage = wep.SaberDamage + 30
  28.     end,
  29. }
  30.  
  31. TREE.Tier[2] = {}
  32. TREE.Tier[2][1] = {
  33.     Name = "Tormented Soul",
  34.     Description = "Learn to use your rage as a weapon",
  35.     Icon = "wos/skilltrees/ravager/tormented_soul.png",
  36.     PointsRequired = 1,
  37.     Requirements = {
  38.         [1] = { 2 },
  39.     },
  40.     OnPlayerSpawn = function( ply ) end,
  41.     OnPlayerDeath = function( ply ) end,
  42.     OnSaberDeploy = function( wep )
  43.         wep:AddForcePower( "Rage" )
  44.     end,
  45. }
  46.  
  47. TREE.Tier[3] = {}
  48. TREE.Tier[3][1] = {
  49.     Name = "Final Blow",
  50.     Description = "Release an explosion when you die",
  51.     Icon = "wos/skilltrees/ravager/phoenix.png",
  52.     PointsRequired = 1,
  53.     Requirements = {    
  54.         [2] = { 1 },
  55.     },
  56.     OnPlayerSpawn = function( ply ) end,
  57.     OnPlayerDeath = function( ply )
  58.         util.BlastDamage( ply:GetActiveWeapon(), ply, ply:GetPos(), 25, 100 )  
  59.     end,
  60.     OnSaberDeploy = function( wep ) end,
  61. }

 

Here you can see examples of skills, tiers, and some effects you can give to certain skills

Let's start by giving you the actual meaning of everything

 

TREE.Tier[1] = {}
TREE.Tier[1][1] = {
    Name = "Strength",
    Description = "+50 Max Health",
    Icon = "wos/skilltrees/ravager/aid.png",
    PointsRequired = 1,
    Requirements = {}
LockedOut = {
[1] = { 2 }
}
    OnPlayerSpawn = function( ply ) ply:SetMaxHealth( ply:GetMaxHealth() + 50 ) end,
    OnPlayerDeath = function( ply ) end,
    OnSaberDeploy = function( wep ) end,
}

 

  • "TREE.Tier[1] = {}" is required in order for TIER 1 to work as it states it as a valid value. You must add one of these before the start of every new TIER, otherwise it will error.
  • "TREE.Tier[1][1] = {" in this we see the first 1 determines the TIER of the skill, and the second 1 is determining the slot in which this skill is being made in the row, if there are multiple skills in one TIER/Row, the skill created before another will be spaced more to the left. 
  • Now in the actual example of the skill, "Name" sets the name of the skill, and "Description" sets the description of when the skill is clicked on. 
  • "PointsRequired" is how many skill points will be taken whenever you attempt to purchase the skill, if the player does not have enough, they will not get their points taken away, and they will not receive the skill
  • The "Requirements" value tells us which skills the player is required to have before purchasing this skill. So if I wanted the player to have the "Tormented Soul" skill, before being able to get the "Final Blow" skill, then I would put "[2] = { 1 }," In between the two brackets, as can be seen above in the prior examples. The first number determines the TIER we are trying to target, and the second, tells which skill we are targeting in that TIER. 
  • The "LockOuts" value indicates which skills should be locked upon purchasing the skill. as shown in the example, if I were to purchase "Strength" then I would not be able to purchase "Combatant"

 

The following three values: "OnPlayerSpawn", "OnPlayerDeath", "OnSaberDeploy", are hook values which if the player has the skill tells it what to do when any of these events happen. As seen with the strength "OnPlayerSpawn" value, it runs a function setting the player's max health to 50 above what it was prior. 

 

Examples of these hooks being used:

Setting player's health, and max health:

"OnPlayerSpawn = function( ply ) ply:SetMaxHealth( ply:GetMaxHealth() + 50 ) ply:SetHealth(ply:Health() + 50) end,"

 

Setting player's armor:

"OnPlayerSpawn = function( ply ) ply:SetArmor( ply:Armor() + 25 ) end,"

 

Setting player's run speed:

"OnPlayerSpawn = function( ply ) ply:SetRunSpeed( ply:GetRunSpeed() + 50 ) end,"

 

Setting player's max force power:

"OnSaberDeploy = function( wep ) wep:SetMaxForce( wep:GetMaxForce() + 5 ) end,"

 

Setting player's saber swing damage:

"OnSaberDeploy = function( wep ) wep.SaberDamage = wep.SaberDamage + 10 end,"

 

Setting player's saber burn damage:

"OnSaberDeploy = function( wep ) wep.SaberBurnDamage = wep.SaberBurnDamage + 10 end,"

 

Giving player a form:

"OnSaberDeploy = function( wep ) wep:AddForm( "Aggressive", 1 ) end,"

 

Giving player a force power:

"OnSaberDeploy = function( wep ) wep:AddForcePower( "Force Pull" ) end,"

 

Slowing the rate at which blocking drains force:

 

"OnSaberDeploy = function( wep ) wep.BlockDrainRate = wep.BlockDrainRate*0.75 end,"

 

Player explodes upon death:

 

"OnPlayerDeath = function( ply ) local effectdata = EffectData() effectdata:SetOrigin( ply:GetPos() ) util.Effect( "HelicopterMegaBomb", effectdata ) ply:EmitSound( "weapons/explode3.wav" ) util.BlastDamage( ply, ply, ply:GetPos(), 50, 100 )  end,"

 

Allow the player to dual wield:

 

"OnPlayerSpawn = function( ply) ply.CanUseDuals = true end,"

 

Give the player a weapon on spawning:

 

"OnPlayerSpawn = function( ply) ply:Give("weapon_stunstick") end,"

 

 

  • 14 Users Found This Useful
Was this answer helpful?

Related Articles

Skill Tree Template File

General template file for those participating in the Calm of Fate update. Please note that...

Disabling Level HUD

Disabling The Level HUD How to disable the XP/Level bar, and player "Combat Level" indicator...

Changing Proficiency XP Gained From Killing Players And NPCS

How to configure XP gain from player/NPC kills Navigate to...

Configure Proficiency Leveling

How to configure proficiency leveling Navigate to lua/wos/advswl/config/crafting/sh_craftwos.lua...

How To Configure XP Gain

How to configure XP gain Navigate to lua/wos/advswl/config/skills/sv_skillwos.lua Scroll to the...