• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Talent Jui

What is Talent Jui



Talent Jui is the 3. edition of my resource Talent. It offers a choice talent system similar to heroes of the storm. On levels you decided, heroes/units can pick one talent from a group of choices (tier) specially defined for that unitTyped. This system works for any amount of units at the same time. But one player can only obeserve talents of one unit at one time. Talent Jui provides a custom created dialog (which can be slightly customized) to perform the choices from the player perspective. Choices and tiers are created using jass/GUI. Cause of using the frame natives, Talent Jui does not need any object Editor data to manage itself.
This system also includes an easy way to create unlearning/reseting choices.

How to install


Requiers Warcraft 3 1.31+
  • Make sure World Editor generates unknown variables in Preferences is set.
  • Copy the Talent Folder.
  • update references inside Talent Init
  • export
    • war3mapImported\TalentBox.fdf
      war3mapImported\TalentBox.toc
      WHEN USING THE EXPORT ALL BUTTON, IT CAN HAPPEN THAT THE CONTENT OF THIS FILES SWAP
    • import them into your map
  • Installed

How to Use



You have to feed the talent data with choices and tiers for unitTypes that shall use talent. Also your choices needs to activade code/triggers when they were picked. Talent provides 2 ways to handle that: events or code binding. Checkout the examples included in the map for that.

Lua version



The Lua Version has differences to the jass Version outside of beeing not jass. In the jass Version Level 0 was a valid Level for a Tier. The Lua Version starts with Level 1. It has a different api when not using the GUI triggers. The Trigger binding is gone, Lui calls binded functions instead of Triggers. Each Choice is a table, one can attach data to it like to any table. Cause it is dangerous to execute stuff in the root (crash wise and garbage collector wise) The Lua Version starts a 0.0s timer after it passed registered so named "unitSheetsFunctions" are called which should be the Custom Unit Talent Trees (checkout the Hero Demos). UnitSheetsFunctions are only relevant when using Lua directly. When using GUI, it is not important.

TasStats



Talent has a feature called TasStats this feature is optional, you could delete it and Talent would still work. It is an "simple" editable addon to make choices add/reduce stats when a specific key for the choice table is set and it reverts it onreset. Unlike the old TalentPreMadeChoice TasStats does not use OnLearn/OnReset.
Having TasStats installed makes picking/reseting choices a little bit heavier. But it reduces the need of OnLearn/OnReset callbacks/Triggers.
TasStats does not work for morphing units or illusions.

Lua

jass


On default TasStats provides this keys for stats
Lua:
TasStr
TasAgi
TasInt
TasLife
TasLifeReg
TasMana
TasManaReg
TasArmor
TasDamage
TasAttackSpeed
TasTurnSpeed
TasCastPoint
TasCastBackswing
Using it is done this way (inside a UnitSheet:
Lua:
local choice
-- create a choice
choice = TalentHeroCreateChoiceEx()
-- set TasStat - TasLife to 200
choice.TasLife = 200
choice.TasMana = 100
choice.TasArmor = 1
-- Set Title
choice.Head = "Sustain Healer"
-- set icon
choice.Icon = "ReplaceableTextures\\CommandButtons\\BTNForestTrollShadowPriest.blp"
-- autocalc Text
TalentTasStatsGetText()

TasStats (Lua version) has another feature it can change integer/real(Level) fields of abilities which is done over the Choice.Key TasSpellField.
One has to be aware that to use this feature without wierd results, the ability-fields current value should not be set to x only add value x to it.
An example
Lua:
choice = TalentHeroCreateChoiceEx()
choice.TasSpellField = {
    -- change Ability Anh1
    Anh1 = {
        -- reduce manacosts of all levels by 2
        ABILITY_ILF_MANA_COST = -2
        -- reduce cooldown by 0.1 seconds
        ,ABILITY_RLF_COOLDOWN = -0.1
    }
}

Ability Fields support Level specific changes, instead of a number use a table
choice.TasSpellField = {
    -- holy Light
    AHhb = {
        -- reduce cooldown of Level 3 (object Editor Level 3)
        ABILITY_RLF_COOLDOWN = {-0, -0, -5}
        -- Instead of Listing the 0s you could write to an int index. Don't forget the [], if you plan to use this feature.
        ABILITY_RLF_COOLDOWN = {[3] = -5}
    }

the Jass version has a set of array variables, when you set a value at the index of the choice. Then it will adjuste the wanted base stat when the choice is picked.
This are the arrays
JASS:
integer array udg_TalentTasStatStr
integer array udg_TalentTasStatAgi
integer array udg_TalentTasStatInt
integer array udg_TalentTasStatLife
integer array udg_TalentTasStatMana
real array udg_TalentTasStatLifeReg
real array udg_TalentTasStatManaReg
real array udg_TalentTasStatArmor
integer array udg_TalentTasStatDamage
real array udg_TalentTasStatAttackSpeed
real array udg_TalentTasStatCastPoint
real array udg_TalentTasStatCastBackswing
use udg_TalentChoiceLast to get the index used by the last created Choice, right after you created a Choice.
The GUI example below adds 20 Base-ATK on pick
  • Set TalentGUI_UnitType = Bergkönig
  • Set TalentGUI_Level = 1
  • Set TalentGUI_ChoiceHead = Axe
  • Set TalentGUI_ChoiceIcon = ReplaceableTextures\CommandButtons\BTNOrcMeleeUpOne.blp
  • Set TalentGUI_ChoiceText = Gain 20 Base-ATK
  • Trigger - Run TalentGUICreateChoice (ignoring conditions)
  • Set TalentTasStatDamage[TalentChoiceLast] = 20


Credits


Nestharus
Bribe
Luashine


ChangeLog

1.38 LUI/1.36e JUI) Icon Show Button, Useage conditions.
1.37) (Lua) Unit Specific TalentTrees
1.36d) (vjass) Fixed an minior Error in TalentGrid
1.36c)
Added OnlyOwnUnit & FixedTarget
Lua) Fixed some problems with TalentBox
1.36b) Lua)
Reworked the Included Save&Load helpers
improved TalentGrid Settings​
1.36
Added a new additional UI
A model hints a possible choice​
1.35b (v)jass)
Added TasTalentStat , without AbilityField
Model over the show Button hints a possible choice
Moved TalentChoiceCreateAddSpells & TalentChoiceCreateReplaceSpell from Premade into Talent
Added function TalentChoiceAddSpells​
1.35a

Added GroupMode
more support for GetLocalizedString​
1.35

TalentGUIAddSpell resets the Spell to 0 after usage
Added the tooltip from TasButtonList
Can Hide choiceText+Box
(Lua)
Improved error messages for UnitSheets callbacks.
+function TalentChoiceAddSpells(choice, "AHbz,AHwe,AHab,AHmt")
+Talent.TasStats (choice add stats/AbilityFields)
Removed TalentPreMadeChoice
fixed some mp unSafe code​
1.34d

Supports Localized data for choices
(jass) FrameLoader is optional now
(Lua) Improved OnLearn/OnReset callback functions
(Lua) Talent-functions taking ObjectEditor ObjectCodes now work without putting them into FourCC.​
1.34c (vjass only) repeats the toc Loding after Loading the game
1.34b Recreates all Talent custom UI, after Loading the game to counter Save&Load Bug.
1.34a Fixed a possible desync with the Lua version
1.34 Added function TalentGetMacro(unit) it returns a text that could be used in TalentMacroDo to pick the talents the unit had done.
1.33

Resets the Talent Event real before Setting it to the wanted value.
TalentBox will now close when the current Selected Target dies.
TalentBox will now close after doing a choice and no further choice can be done.
Maybe the overglowing was fixed.​
1.32a Fixed a bug in Lui with Talents beeing unselectable when adding abilties.
1.32.00

Improved the Dialog for allied shared Units.
Improved Level Boxes and Page switching.
fixed a bug with the Reset Button will be disable on Level not beeing the current selection.
One can now alter the space between Choice, the Bottom and the top.
Added an boolean array to disable the reset button as long that boolean is true.
Added udg_Talent__UnitCode inside Events binded Code it is the unitType beeing used by udg_Talent__Unit.
The Choice-Description fuses now with the Bottom and Right of the Choice Frame.
Fixed a glitch with disabled Reset Button.
Non Talent Users Show now a Box with the title reading "No Talent User".
Added a Lua Version​
Requiers Warcraft 3 1.31+

Keywords: SkillTree, Talents, masteries, hots like, hero progress, 1 of 3, 1 of 2, 1 of many.
Contents

Talent Jui 1.36f (Map)

Talent Lui 1.38a (Map)

Reviews
MyPad
Tested, and works very well with the game. Approved.
Correct me if I'm wrong but there appear to be a few minor leaks throughout the JASS. Basically, they always occur during error catching, where when function should not fire due to it not being the correct player, but the locals are failed to be cleaned up when returning. I forget where I saw a few other errors like this, they are few and far between but also wanted to double-check if this would cause a leak.
Your are right. This are indeed minior leaks in jass. As they prevent that the handleId of unit u is reused as soon unit u is removed from the Game.
 
The system did not create code to do that, Therefore you need to write/change some code when you want that.
if you mod a version with BlzFrameGetChild you could set the texture of child [0] [1] [2] & [3] of open button to the wanted Icon. After Talent created the UI-Frames should be (1s expired event). use on some of the lines from the hidden tag. but only use the lines for the UI mode you use (Grid/Box). Running them when the Show Button is missing probably crashs warcraft 3.

Code:
BlzFrameSetTexture(BlzFrameGetChild(TalentGrid.Frame.Show, 0) , iconPath, 0, false)
BlzFrameSetTexture(BlzFrameGetChild(TalentGrid.Frame.Show, 1) , iconPath, 0, false)
BlzFrameSetTexture(BlzFrameGetChild(TalentGrid.Frame.Show, 2) , iconPath, 0, false)
BlzFrameSetTexture(BlzFrameGetChild(TalentGrid.Frame.Show, 3) , iconPath, 0, false)

BlzFrameSetTexture(BlzFrameGetChild(TalentBox.Frame.Show, 0) , iconPath, 0, false)
BlzFrameSetTexture(BlzFrameGetChild(TalentBox.Frame.Show, 1) , iconPath, 0, false)
BlzFrameSetTexture(BlzFrameGetChild(TalentBox.Frame.Show, 2) , iconPath, 0, false)
BlzFrameSetTexture(BlzFrameGetChild(TalentBox.Frame.Show, 3) , iconPath, 0, false)


call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentShowButton", 0), 0) , iconPath, 0, false)
call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentShowButton", 0), 1) , iconPath, 0, false)
call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentShowButton", 0), 2) , iconPath, 0, false)
call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentShowButton", 0), 3) , iconPath, 0, false)

call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentGridShowButton", 0), 0) , iconPath, 0, false)
call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentGridShowButton", 0), 1) , iconPath, 0, false)
call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentGridShowButton", 0), 2) , iconPath, 0, false)

or You would need to change the code that creates the open button and create a button with instead. The show button is in the grid or box script and you would search for such lines

set FrameShow = BlzCreateFrameByType("GLUETEXTBUTTON", "TalentGridShowButton",
local framehandle showButton = BlzCreateFrameByType("GLUETEXTBUTTON", "TalentShowButton"

TalentGrid.Frame.Show = BlzCreateFrameByType("GLUETEXTBUTTON", "TalentGridShowButton",
TalentBox.Frame.Show = BlzCreateFrameByType("GLUETEXTBUTTON"
 
Level 4
Joined
Oct 31, 2011
Messages
69
The system did not create code to do that, Therefore you need to write/change some code when you want that.
if you mod a version with BlzFrameGetChild you could set the texture of child [0] [1] [2] & [3] of open button to the wanted Icon. After Talent created the UI-Frames should be (1s expired event). use on some of the lines from the hidden tag. but only use the lines for the UI mode you use (Grid/Box). Running them when the Show Button is missing probably crashs warcraft 3.

Code:
BlzFrameSetTexture(BlzFrameGetChild(TalentGrid.Frame.Show, 0) , iconPath, 0, false)
BlzFrameSetTexture(BlzFrameGetChild(TalentGrid.Frame.Show, 1) , iconPath, 0, false)
BlzFrameSetTexture(BlzFrameGetChild(TalentGrid.Frame.Show, 2) , iconPath, 0, false)
BlzFrameSetTexture(BlzFrameGetChild(TalentGrid.Frame.Show, 3) , iconPath, 0, false)

BlzFrameSetTexture(BlzFrameGetChild(TalentBox.Frame.Show, 0) , iconPath, 0, false)
BlzFrameSetTexture(BlzFrameGetChild(TalentBox.Frame.Show, 1) , iconPath, 0, false)
BlzFrameSetTexture(BlzFrameGetChild(TalentBox.Frame.Show, 2) , iconPath, 0, false)
BlzFrameSetTexture(BlzFrameGetChild(TalentBox.Frame.Show, 3) , iconPath, 0, false)


call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentShowButton", 0), 0) , iconPath, 0, false)
call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentShowButton", 0), 1) , iconPath, 0, false)
call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentShowButton", 0), 2) , iconPath, 0, false)
call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentShowButton", 0), 3) , iconPath, 0, false)

call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentGridShowButton", 0), 0) , iconPath, 0, false)
call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentGridShowButton", 0), 1) , iconPath, 0, false)
call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentGridShowButton", 0), 2) , iconPath, 0, false)

or You would need to change the code that creates the open button and create a button with instead. The show button is in the grid or box script and you would search for such lines

set FrameShow = BlzCreateFrameByType("GLUETEXTBUTTON", "TalentGridShowButton",
local framehandle showButton = BlzCreateFrameByType("GLUETEXTBUTTON", "TalentShowButton"

TalentGrid.Frame.Show = BlzCreateFrameByType("GLUETEXTBUTTON", "TalentGridShowButton",
TalentBox.Frame.Show = BlzCreateFrameByType("GLUETEXTBUTTON"
Thank you very much, I will try!
 
Level 4
Joined
Oct 31, 2011
Messages
69
Another question, how do I remove all talent choices from a hero and add other talent choices? Like in RPGs where the mage class is fire and changes to ice and the talent tree changes completely.
 
This system is an unitcode/unittype based system. Therefore changing a talent-Tree for one unit is not supported.
you could morph the hero, that makes your unit use a different talent tree.
There is also the use Talents of another unitcode, but it only supports unitCode -> unitCode. (now I wonder why I did not allow to treat one unit as another unitCode?)
Lua:
  TalentHeroCopy(unitCode, copyOrigin)
JASS:
 call TalentHeroSetCopy('H003', 'H001')	//'H003' uses the same talents as 'H001'

When that mage is only picked once in the match your could change the current used one. By TalentHeroCopy or TalentHeroSetCopy inside the Choice Action

Removing Tier-choices has no api and I don't want to talk about that right now as that would be to much.
 
Level 4
Joined
Oct 31, 2011
Messages
69
I understood. Example, I have a hero and I use an integer variable, when my integer variable has the value 1 that hero has a talent tree, and when I change this variable to 2 I have another one and so on during the game.
 
Your example is almost right, it is just a variable inside Talent. Hence you need to use that function. When none such value is stored it uses the own unitCode/HeroClass (default).

Edit: Updated Talent Lui to V1.37)
TalentGetUnitCode & TalentHeroCopy now also work for specific units -> specific units can now be given a wanted Talent Tree.
Updated Talent, TalentGrid & TalentBox

Checkout the 3 new GUI demo Triggers, when one wants to give an non Talent User a TalentTree one needs to do some steps.

  • Antonidas Copy bloodmage
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Antonidas
      • Set Talent__Unit = Antonidas 0059 <gen>
      • -------- Create Unit data --------
      • Custom script: TalentAddUnit(udg_Talent__Unit)
      • -------- If the unit already has picked Talents it might be smart to first reset it --------
      • Custom script: TalentMacroDo(udg_Talent__Unit, "-u")
      • -------- Make Unit Copy Bloodmage --------
      • Custom script: TalentHeroCopy(udg_Talent__Unit, 'H005')
      • -------- Tell Talent to check for possible choices --------
      • Custom script: TalentAddSelection(udg_Talent__Unit)
      • Game - Display to (All players) the text: Antonidas done
  • Sylva Copy Antonidas
    • Events
      • Time - Elapsed game time is 3.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Ranger
      • Set Talent__Unit = Sylvanas Windrunner 0060 <gen>
      • Set Unit = Antonidas 0059 <gen>
      • Custom script: TalentAddUnit(udg_Talent__Unit)
      • Custom script: TalentHeroCopy(udg_Talent__Unit, udg_Unit)
      • Custom script: TalentAddSelection(udg_Talent__Unit)
      • Game - Display to (All players) the text: Ranger Done
      • Wait 5.00 seconds
      • -------- Change another time --------
      • Set Talent__Unit = Sylvanas Windrunner 0060 <gen>
      • Game - Display to (All players) the text: Ranger Copy Pala
      • Custom script: TalentMacroDo(udg_Talent__Unit, "-u")
      • Custom script: TalentHeroCopy(udg_Talent__Unit, 'H001')
      • Custom script: TalentAddSelection(udg_Talent__Unit)
      • Game - Display to (All players) the text: Ranger Done
 
Last edited:
Level 4
Joined
Oct 31, 2011
Messages
69
Your example is almost right, it is just a variable inside Talent. Hence you need to use that function. When none such value is stored it uses the own unitCode/HeroClass (default).

Edit: Updated Talent Lui to V1.37)
TalentGetUnitCode & TalentHeroCopy now also work for specific units -> specific units can now be given a wanted Talent Tree.
Updated Talent, TalentGrid & TalentBox

Checkout the 3 new GUI demo Triggers, when one wants to give an non Talent User a TalentTree one needs to do some steps.

  • Antonidas Copy bloodmage
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Antonidas
      • Set Talent__Unit = Antonidas 0059 <gen>
      • -------- Create Unit data --------
      • Custom script: TalentAddUnit(udg_Talent__Unit)
      • -------- If the unit already has picked Talents it might be smart to first reset it --------
      • Custom script: TalentMacroDo(udg_Talent__Unit, "-u")
      • -------- Make Unit Copy Bloodmage --------
      • Custom script: TalentHeroCopy(udg_Talent__Unit, 'H005')
      • -------- Tell Talent to check for possible choices --------
      • Custom script: TalentAddSelection(udg_Talent__Unit)
      • Game - Display to (All players) the text: Antonidas done
  • Sylva Copy Antonidas
    • Events
      • Time - Elapsed game time is 3.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Ranger
      • Set Talent__Unit = Sylvanas Windrunner 0060 <gen>
      • Set Unit = Antonidas 0059 <gen>
      • Custom script: TalentAddUnit(udg_Talent__Unit)
      • Custom script: TalentHeroCopy(udg_Talent__Unit, udg_Unit)
      • Custom script: TalentAddSelection(udg_Talent__Unit)
      • Game - Display to (All players) the text: Ranger Done
      • Wait 5.00 seconds
      • -------- Change another time --------
      • Set Talent__Unit = Sylvanas Windrunner 0060 <gen>
      • Game - Display to (All players) the text: Ranger Copy Pala
      • Custom script: TalentMacroDo(udg_Talent__Unit, "-u")
      • Custom script: TalentHeroCopy(udg_Talent__Unit, 'H001')
      • Custom script: TalentAddSelection(udg_Talent__Unit)
      • Game - Display to (All players) the text: Ranger Done
Very good, your triggers are very good, they help the community a lot. This talent is one of the most interesting I've ever seen. I always follow to see if there are new updates.
 
unit specific talent trees was added in V1.37, vjass version is on V1.36d so it does not have it.

But one is able to replace/change the current TalentTree for an unitCode during a match or swap out Tiers at wanted Levels. the given api for tiers and choices (Talenttree) are mostly about adding.

One can use TalentHeroSetCopy to use a different talentree. That also works during match, but one needs to unlearn all talents and restore the talent progress to avoid bugs.
An example that makes all bloodmages swap between Bloodmage & Paladin TalentTree. one would need to do unlearning for all Bloodmages, restore the Talent progress and search for current Talent. If one has more than one bloodmage
  • DemoReplaceBloodMageTree
    • Events
      • Player - Player 1 (Red) types a chat message containing BlutMagier as An exact match
    • Conditions
    • Actions
      • Game - Display to (All players) for 30.00 seconds the text: (Name of the current trigger)
      • Set Talent__Unit = Blutmagier 0024 <gen>
      • Custom script: call TalentMacroDo(udg_Talent__Unit, "-u")
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Execution count of (This trigger)) And 1) Equal to 1
        • Then - Actions
          • Custom script: call TalentHeroSetCopy('H005', 'H001')
        • Else - Actions
          • Custom script: call TalentHeroSetCopy('H005', 0)
      • Custom script: call SaveBoolean(udg_TalentHash, GetHandleId(udg_Talent__Unit), TalentHashIndex_HasChoice(), false)
      • Custom script: call SaveInteger(udg_TalentHash, GetHandleId(udg_Talent__Unit), TalentHashIndex_LevelOfLastChoice(), 0)
      • Custom script: call TalentAddSelection(udg_Talent__Unit)
One could swap out only tiers. But this needs tier-variables.
Lets say we want that Bloodmage can either pick stats or spells at Level 5.
JASS:
//Example for using Talent by Tasyen.
function TalentBloodMage takes nothing returns nothing
	local integer heroTypeId = 'H005'	//Custom BloodMage
	local integer choice
	local integer abilityId

	call TalentHeroSetFinalTier(heroTypeId, 10) 	//Mark Level 10 as last choice, after the heroe picks it, the selection skills are removed.

	call TalentHeroTierCreate(heroTypeId, 0)

	set choice = TalentChoiceCreateAddSpellsSimple("AHfs,ANbf,ANfb") //Create a choice adding this 3 spells and add the choice to the last created Tier
	set udg_TalentChoiceHead[choice] = "Fire Magic"
	set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNFire.blp"
	
	set choice = TalentChoiceCreateAddSpellsSimple("ANfl,AOcl,ANmo")
	set udg_TalentChoiceHead[choice] = "Lightning Magic"
	set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNMonsoon.blp"

	//LEVEL 5
	call TalentHeroTierCreate(heroTypeId, 5)
set udg_BlutMagierTier5[0] = udg_TalentTierLast // store this for later usage

 	set choice = TalentChoiceCreateStats(6, 3, 3)
	set udg_TalentChoiceHead[choice] = "Magic Power: Str"
	set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNHelmOfValor.blp"

 	set choice = TalentChoiceCreateStats(3, 6, 3)
	set udg_TalentChoiceHead[choice] = "Magic Power: AGI"
	set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNHoodOfCunning.blp"

 	set choice = TalentChoiceCreateStats(3, 3, 6)
	set udg_TalentChoiceHead[choice] = "Magic Power: Int"
	set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNPipeOfInsight.blp"


set udg_BlutMagierTier5[1] = TalentTierCreate() // store this for later usage // this is not used in the default Tree
	set choice = TalentChoiceCreateAddSpellsSimple("AHhb,AHds,AHad") //Create a choice adding this 3 spells and add the choice to the last created Tier
	set udg_TalentChoiceHead[choice] = "Holy Magic"
	set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNHolyBolt.blp"

	set choice = TalentChoiceCreateAddSpellsSimple("AHad,AHab,AOae")
	set udg_TalentChoiceHead[choice] = "Aura Magic"
	set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNBrilliance.blp"
	
	//Level 10
	call TalentHeroTierCreate(heroTypeId, 10)

	call TalentChoiceCreateAddSpell('AHpx',true)
	call TalentChoiceCreateAddSpell('AUin',true)


endfunction

//===========================================================================
function InitTrig_Talent_BloodMag_Kopieren takes nothing returns nothing
    set gg_trg_Talent_BloodMag_Kopieren = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Talent_BloodMag_Kopieren, function TalentBloodMage )
endfunction
  • DemoReplaceBloodMageTier
    • Events
      • Player - Player 1 (Red) types a chat message containing BlutMagier2 as An exact match
    • Conditions
    • Actions
      • Game - Display to (All players) for 30.00 seconds the text: (Name of the current trigger)
      • Set Talent__Unit = Blutmagier 0024 <gen>
      • Custom script: call TalentMacroDo(udg_Talent__Unit, "-u")
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Execution count of (This trigger)) And 1) Equal to 1
        • Then - Actions
          • Custom script: call TalentHeroSetTier('H005',5, udg_BlutMagierTier5[1])
        • Else - Actions
          • Custom script: call TalentHeroSetTier('H005',5, udg_BlutMagierTier5[0])
      • Custom script: call SaveBoolean(udg_TalentHash, GetHandleId(udg_Talent__Unit), TalentHashIndex_HasChoice(), false)
      • Custom script: call SaveInteger(udg_TalentHash, GetHandleId(udg_Talent__Unit), TalentHashIndex_LevelOfLastChoice(), 0)
      • Custom script: call TalentAddSelection(udg_Talent__Unit)

I updated the vjass version to include this 2 demos.
 
Last edited:
Level 4
Joined
Oct 31, 2011
Messages
69
unit specific talent trees was added in V1.37, vjass version is on V1.36d so it does not have it.

But one is able to replace/change the current TalentTree for an unitCode during a match or swap out Tiers at wanted Levels. the given api for tiers and choices (Talenttree) are mostly about adding.

One can use TalentHeroSetCopy to use a different talentree. That also works during match, but one needs to unlearn all talents and restore the talent progress to avoid bugs.
An example that makes all bloodmages swap between Bloodmage & Paladin TalentTree. one would need to do unlearning for all Bloodmages, restore the Talent progress and search for current Talent. If one has more than one bloodmage
  • DemoReplaceBloodMageTree
    • Events
      • Player - Player 1 (Red) types a chat message containing BlutMagier as An exact match
    • Conditions
    • Actions
      • Game - Display to (All players) for 30.00 seconds the text: (Name of the current trigger)
      • Set Talent__Unit = Blutmagier 0024 <gen>
      • Custom script: call TalentMacroDo(udg_Talent__Unit, "-u")
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Execution count of (This trigger)) And 1) Equal to 1
        • Then - Actions
          • Custom script: call TalentHeroSetCopy('H005', 'H001')
        • Else - Actions
          • Custom script: call TalentHeroSetCopy('H005', 0)
      • Custom script: call SaveBoolean(udg_TalentHash, GetHandleId(udg_Talent__Unit), TalentHashIndex_HasChoice(), false)
      • Custom script: call SaveInteger(udg_TalentHash, GetHandleId(udg_Talent__Unit), TalentHashIndex_LevelOfLastChoice(), 0)
      • Custom script: call TalentAddSelection(udg_Talent__Unit)
One could swap out only tiers. But this needs tier-variables.
Lets say we want that Bloodmage can either pick stats or spells at Level 5.
JASS:
//Example for using Talent by Tasyen.
function TalentBloodMage takes nothing returns nothing
    local integer heroTypeId = 'H005'    //Custom BloodMage
    local integer choice
    local integer abilityId

    call TalentHeroSetFinalTier(heroTypeId, 10)     //Mark Level 10 as last choice, after the heroe picks it, the selection skills are removed.

    call TalentHeroTierCreate(heroTypeId, 0)

    set choice = TalentChoiceCreateAddSpellsSimple("AHfs,ANbf,ANfb") //Create a choice adding this 3 spells and add the choice to the last created Tier
    set udg_TalentChoiceHead[choice] = "Fire Magic"
    set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNFire.blp"
   
    set choice = TalentChoiceCreateAddSpellsSimple("ANfl,AOcl,ANmo")
    set udg_TalentChoiceHead[choice] = "Lightning Magic"
    set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNMonsoon.blp"

    //LEVEL 5
    call TalentHeroTierCreate(heroTypeId, 5)
set udg_BlutMagierTier5[0] = udg_TalentTierLast // store this for later usage

     set choice = TalentChoiceCreateStats(6, 3, 3)
    set udg_TalentChoiceHead[choice] = "Magic Power: Str"
    set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNHelmOfValor.blp"

     set choice = TalentChoiceCreateStats(3, 6, 3)
    set udg_TalentChoiceHead[choice] = "Magic Power: AGI"
    set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNHoodOfCunning.blp"

     set choice = TalentChoiceCreateStats(3, 3, 6)
    set udg_TalentChoiceHead[choice] = "Magic Power: Int"
    set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNPipeOfInsight.blp"


set udg_BlutMagierTier5[1] = TalentTierCreate() // store this for later usage // this is not used in the default Tree
    set choice = TalentChoiceCreateAddSpellsSimple("AHhb,AHds,AHad") //Create a choice adding this 3 spells and add the choice to the last created Tier
    set udg_TalentChoiceHead[choice] = "Holy Magic"
    set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNHolyBolt.blp"

    set choice = TalentChoiceCreateAddSpellsSimple("AHad,AHab,AOae")
    set udg_TalentChoiceHead[choice] = "Aura Magic"
    set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNBrilliance.blp"
   
    //Level 10
    call TalentHeroTierCreate(heroTypeId, 10)

    call TalentChoiceCreateAddSpell('AHpx',true)
    call TalentChoiceCreateAddSpell('AUin',true)


endfunction

//===========================================================================
function InitTrig_Talent_BloodMag_Kopieren takes nothing returns nothing
    set gg_trg_Talent_BloodMag_Kopieren = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Talent_BloodMag_Kopieren, function TalentBloodMage )
endfunction
  • DemoReplaceBloodMageTier
    • Events
      • Player - Player 1 (Red) types a chat message containing BlutMagier2 as An exact match
    • Conditions
    • Actions
      • Game - Display to (All players) for 30.00 seconds the text: (Name of the current trigger)
      • Set Talent__Unit = Blutmagier 0024 <gen>
      • Custom script: call TalentMacroDo(udg_Talent__Unit, "-u")
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Execution count of (This trigger)) And 1) Equal to 1
        • Then - Actions
          • Custom script: call TalentHeroSetTier('H005',5, udg_BlutMagierTier5[1])
        • Else - Actions
          • Custom script: call TalentHeroSetTier('H005',5, udg_BlutMagierTier5[0])
      • Custom script: call SaveBoolean(udg_TalentHash, GetHandleId(udg_Talent__Unit), TalentHashIndex_HasChoice(), false)
      • Custom script: call SaveInteger(udg_TalentHash, GetHandleId(udg_Talent__Unit), TalentHashIndex_LevelOfLastChoice(), 0)
      • Custom script: call TalentAddSelection(udg_Talent__Unit)

I updated the vjass version to include this 2 demos.
Very good, thank you for your attention, your systems are always very useful and unique and help keep the Warcraft community alive.

As a suggestion for the next versions, it would be nice to facilitate this change of a hero's talent tree and use an icon instead of the button to access the talents.
 
Level 4
Joined
Oct 31, 2011
Messages
69
Hello friend! Would there be a way to clear a unit's entire talent tree and add a completely new one as many times as I want during the game?

in jass version
 
y, same answer as last time. Jass only has unitTypeId based talenttrees and you can change the tree during the match for all of unitTypeId. But first need to unlearn all choosen talents.

unit specific talent trees was added in V1.37, vjass version is on V1.36d so it does not have it.

But one is able to replace/change the current TalentTree for an unitCode during a match or swap out Tiers at wanted Levels. the given api for tiers and choices (Talenttree) are mostly about adding.

One can use TalentHeroSetCopy to use a different talentree. That also works during match, but one needs to unlearn all talents and restore the talent progress to avoid bugs.
An example that makes all bloodmages swap between Bloodmage & Paladin TalentTree. one would need to do unlearning for all Bloodmages, restore the Talent progress and search for current Talent. If one has more than one bloodmage
  • DemoReplaceBloodMageTree
    • Events
      • Player - Player 1 (Red) types a chat message containing BlutMagier as An exact match
    • Conditions
    • Actions
      • Game - Display to (All players) for 30.00 seconds the text: (Name of the current trigger)
      • Set Talent__Unit = Blutmagier 0024 <gen>
      • Custom script: call TalentMacroDo(udg_Talent__Unit, "-u")
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Execution count of (This trigger)) And 1) Equal to 1
        • Then - Actions
          • Custom script: call TalentHeroSetCopy('H005', 'H001')
        • Else - Actions
          • Custom script: call TalentHeroSetCopy('H005', 0)
      • Custom script: call SaveBoolean(udg_TalentHash, GetHandleId(udg_Talent__Unit), TalentHashIndex_HasChoice(), false)
      • Custom script: call SaveInteger(udg_TalentHash, GetHandleId(udg_Talent__Unit), TalentHashIndex_LevelOfLastChoice(), 0)
      • Custom script: call TalentAddSelection(udg_Talent__Unit)
One could swap out only tiers. But this needs tier-variables.
Lets say we want that Bloodmage can either pick stats or spells at Level 5.
JASS:
//Example for using Talent by Tasyen.
function TalentBloodMage takes nothing returns nothing
    local integer heroTypeId = 'H005'    //Custom BloodMage
    local integer choice
    local integer abilityId

    call TalentHeroSetFinalTier(heroTypeId, 10)     //Mark Level 10 as last choice, after the heroe picks it, the selection skills are removed.

    call TalentHeroTierCreate(heroTypeId, 0)

    set choice = TalentChoiceCreateAddSpellsSimple("AHfs,ANbf,ANfb") //Create a choice adding this 3 spells and add the choice to the last created Tier
    set udg_TalentChoiceHead[choice] = "Fire Magic"
    set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNFire.blp"
   
    set choice = TalentChoiceCreateAddSpellsSimple("ANfl,AOcl,ANmo")
    set udg_TalentChoiceHead[choice] = "Lightning Magic"
    set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNMonsoon.blp"

    //LEVEL 5
    call TalentHeroTierCreate(heroTypeId, 5)
set udg_BlutMagierTier5[0] = udg_TalentTierLast // store this for later usage

     set choice = TalentChoiceCreateStats(6, 3, 3)
    set udg_TalentChoiceHead[choice] = "Magic Power: Str"
    set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNHelmOfValor.blp"

     set choice = TalentChoiceCreateStats(3, 6, 3)
    set udg_TalentChoiceHead[choice] = "Magic Power: AGI"
    set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNHoodOfCunning.blp"

     set choice = TalentChoiceCreateStats(3, 3, 6)
    set udg_TalentChoiceHead[choice] = "Magic Power: Int"
    set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNPipeOfInsight.blp"


set udg_BlutMagierTier5[1] = TalentTierCreate() // store this for later usage // this is not used in the default Tree
    set choice = TalentChoiceCreateAddSpellsSimple("AHhb,AHds,AHad") //Create a choice adding this 3 spells and add the choice to the last created Tier
    set udg_TalentChoiceHead[choice] = "Holy Magic"
    set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNHolyBolt.blp"

    set choice = TalentChoiceCreateAddSpellsSimple("AHad,AHab,AOae")
    set udg_TalentChoiceHead[choice] = "Aura Magic"
    set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNBrilliance.blp"
   
    //Level 10
    call TalentHeroTierCreate(heroTypeId, 10)

    call TalentChoiceCreateAddSpell('AHpx',true)
    call TalentChoiceCreateAddSpell('AUin',true)


endfunction

//===========================================================================
function InitTrig_Talent_BloodMag_Kopieren takes nothing returns nothing
    set gg_trg_Talent_BloodMag_Kopieren = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Talent_BloodMag_Kopieren, function TalentBloodMage )
endfunction
  • DemoReplaceBloodMageTier
    • Events
      • Player - Player 1 (Red) types a chat message containing BlutMagier2 as An exact match
    • Conditions
    • Actions
      • Game - Display to (All players) for 30.00 seconds the text: (Name of the current trigger)
      • Set Talent__Unit = Blutmagier 0024 <gen>
      • Custom script: call TalentMacroDo(udg_Talent__Unit, "-u")
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Execution count of (This trigger)) And 1) Equal to 1
        • Then - Actions
          • Custom script: call TalentHeroSetTier('H005',5, udg_BlutMagierTier5[1])
        • Else - Actions
          • Custom script: call TalentHeroSetTier('H005',5, udg_BlutMagierTier5[0])
      • Custom script: call SaveBoolean(udg_TalentHash, GetHandleId(udg_Talent__Unit), TalentHashIndex_HasChoice(), false)
      • Custom script: call SaveInteger(udg_TalentHash, GetHandleId(udg_Talent__Unit), TalentHashIndex_LevelOfLastChoice(), 0)
      • Custom script: call TalentAddSelection(udg_Talent__Unit)

I updated the vjass version to include this 2 demos.
 
Level 5
Joined
Nov 3, 2018
Messages
80
Hey there! i just got back into editing and back your system helped me a lot , thanks!

i had a question about the actual version of the system , is it possible to pick multiple choices for one level or picking choices from previous tiers in other levels?

like for example you have 5 skills on level 1 and you can pick 2 instead of just 1

if this is possible could you provide me with a GUI example pretty please? :)
 
Last edited:
Level 5
Joined
Nov 3, 2018
Messages
80
this system was made to pick only one choice per tier.

One can make choices that give more than one skill.

The same tier can be in multiple levels, but then one could still pick the same option again, there is no feature to disable a choice codewise.
I Understand , thank you very much for replying so quickly! :)

is it possible to make certain talents appear triggering it ? ill try to explain it
Hero has 2 abilities Fireball and Iceball

there's 6 talents in the first talent row (ice and fireball talents) all hidden or non existant atm

HERO LEVELS UP and chooses to learn Fireball
1st row shows/creates 3 talents regarding fireball while keeping the iceball ones hidden/not created

is it possible in gui?
 
It is possible to extend/create a talent tree while the game runs or make an unit use a new/different tree.

Adding an non talent unit to talent was not ported to gui. so easiest to have some talent already for the unitcode.

Gui examples to add new choices after the hero learns a skill using the default warcraft 3 hero learn feature: The examples will change the tree for all instances of that hero, so it best works when each hero is unique.
For this examples the blademaster was given some choice at lvl 1 like all demos do.

  • Talent BladeMaster
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Windlauf
    • Actions
      • Trigger - Turn off (This trigger)
      • -------- Who uses this? --------
      • Set TalentGUI_UnitType = Klingenmeister
      • -------- ---- --------
      • -------- ---- --------
      • -------- For which Level create choices? --------
      • Set TalentGUI_Level = 1
      • Set TalentGUI_Head = Axe
      • Set TalentGUI_Icon = ReplaceableTextures\CommandButtons\BTNOrcMeleeUpOne.blp
      • Set TalentGUI_Text = Gain 20 Base-ATK
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentGUI_Spell = Kritischer Schlag
      • Set TalentGUI_Head = (Name of TalentGUI_Spell)
      • Set TalentGUI_Icon = (Icon of TalentGUI_Spell)
      • Set TalentGUI_Text = (Extended Tooltip of TalentGUI_Spell for level 3)
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentGUI_Level = 4
      • Set TalentGUI_Spell = Inferno (Tichondrius)
      • Set TalentGUI_Head = (Name of TalentGUI_Spell)
      • Set TalentGUI_Icon = (Icon of TalentGUI_Spell)
      • Set TalentGUI_Text = (Extended Tooltip of TalentGUI_Spell for level 3)
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentGUI_Spell = Hexerei
      • Set TalentGUI_Head = (Name of TalentGUI_Spell)
      • Set TalentGUI_Icon = (Icon of TalentGUI_Spell)
      • Set TalentGUI_Text = (Extended Tooltip of TalentGUI_Spell for level 3)
      • Custom script: TalentAddSelection(GetTriggerUnit())
  • Talent BladeMaster Kopieren
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Spiegelbild
    • Actions
      • Trigger - Turn off (This trigger)
      • -------- Who uses this? --------
      • Set TalentGUI_UnitType = Klingenmeister
      • -------- ---- --------
      • -------- ---- --------
      • -------- For which Level create choices? --------
      • Set TalentGUI_Level = 1
      • Set TalentGUI_Spell = Ausdauer-Aura
      • Set TalentGUI_Head = (Name of TalentGUI_Spell)
      • Set TalentGUI_Icon = (Icon of TalentGUI_Spell)
      • Set TalentGUI_Text = (Extended Tooltip of TalentGUI_Spell for level 3)
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentGUI_Spell = Unheilige Aura
      • Set TalentGUI_Head = (Name of TalentGUI_Spell)
      • Set TalentGUI_Icon = ReplaceableTextures\CommandButtons\BTNGargoyle.blp
      • Set TalentGUI_Text = 200 Life & Unholy Aura
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentGUI_TasLife = 200
      • Trigger - Run TalentGUIAddTasStats (ignoring conditions)


  • Talent Blademaster Expand Windwlak
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Windlauf
    • Actions
      • Trigger - Turn off (This trigger)
      • -------- Who uses this? --------
      • Set TalentGUI_UnitType = Klingenmeister
      • -------- For which Level create choices? --------
      • Set TalentGUI_Level = 1
      • Set TalentGUI_Spell = Gottesschild (Neutral Hostile)
      • Set TalentGUI_ChoiceHead = (Name of TalentGUI_Spell)
      • Set TalentGUI_ChoiceIcon = (Icon of TalentGUI_Spell)
      • Set TalentGUI_ChoiceText = (Extended Tooltip of TalentGUI_Spell for level 1)
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentGUI_Spell = Heiliges Licht
      • Set TalentGUI_ChoiceHead = (Name of TalentGUI_Spell)
      • Set TalentGUI_ChoiceIcon = (Icon of TalentGUI_Spell)
      • Set TalentGUI_ChoiceText = (Extended Tooltip of TalentGUI_Spell for level 1)
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentGUI_Level = 4
      • Set TalentGUI_ChoiceHead = Armor
      • Set TalentGUI_ChoiceIcon = ReplaceableTextures\CommandButtons\BTNArmorGolem.blp
      • Set TalentGUI_ChoiceText = +500 Max Life
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentTasStatLife[TalentChoiceLast] = 500
      • Set TalentGUI_ChoiceHead = ManaStone
      • Set TalentGUI_ChoiceIcon = ReplaceableTextures\CommandButtons\BTNPendantOfMana.blp
      • Set TalentGUI_ChoiceText = +250 Max Mana
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentTasStatMana[TalentChoiceLast] = 250
      • -------- Update Max Talent Level --------
      • Trigger - Run TalentGUI <gen> (ignoring conditions)
  • Talent Blademaster Expand Mirror
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Spiegelbild
    • Actions
      • Trigger - Turn off (This trigger)
      • -------- Who uses this? --------
      • Set TalentGUI_UnitType = Klingenmeister
      • Set TalentGUI_Level = 10
      • Set TalentGUI_ChoiceHead = Helm
      • Set TalentGUI_ChoiceIcon = ReplaceableTextures\CommandButtons\BTNHelmOfValor.blp
      • Set TalentGUI_ChoiceText = +6 STR|n+6 AGI
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentTasStatAgi[TalentChoiceLast] = 6
      • Set TalentTasStatStr[TalentChoiceLast] = 6
      • Set TalentGUI_Spell = Heiltrank (Geringer)
      • Set TalentGUI_ChoiceHead = (Name of TalentGUI_Spell)
      • Set TalentGUI_ChoiceIcon = (Icon of TalentGUI_Spell)
      • Set TalentGUI_ChoiceText = (Extended Tooltip of TalentGUI_Spell for level 1)
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • -------- Update Max Talent Level --------
      • Trigger - Run TalentGUI <gen> (ignoring conditions)


Remove/hide you could do, by creating for each an own tree and changing the used one. Because I did not built any feature to remove choices. This tree replace dont work that good with talent reset, therefore either first reset then change or disable the reset feature.
 

Attachments

  • Talent Lui V1.37 Blademaster.w3x
    106.7 KB · Views: 5
  • Talent Jui V1.36d1 Blademaster.w3x
    125.6 KB · Views: 4
Level 5
Joined
Nov 3, 2018
Messages
80
It is possible to extend/create a talent tree while the game runs or make an unit use a new/different tree.

Adding an non talent unit to talent was not ported to gui. so easiest to have some talent already for the unitcode.

Gui examples to add new choices after the hero learns a skill using the default warcraft 3 hero learn feature: The examples will change the tree for all instances of that hero, so it best works when each hero is unique.
For this examples the blademaster was given some choice at lvl 1 like all demos do.

  • Talent BladeMaster
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Windlauf
    • Actions
      • Trigger - Turn off (This trigger)
      • -------- Who uses this? --------
      • Set TalentGUI_UnitType = Klingenmeister
      • -------- ---- --------
      • -------- ---- --------
      • -------- For which Level create choices? --------
      • Set TalentGUI_Level = 1
      • Set TalentGUI_Head = Axe
      • Set TalentGUI_Icon = ReplaceableTextures\CommandButtons\BTNOrcMeleeUpOne.blp
      • Set TalentGUI_Text = Gain 20 Base-ATK
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentGUI_Spell = Kritischer Schlag
      • Set TalentGUI_Head = (Name of TalentGUI_Spell)
      • Set TalentGUI_Icon = (Icon of TalentGUI_Spell)
      • Set TalentGUI_Text = (Extended Tooltip of TalentGUI_Spell for level 3)
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentGUI_Level = 4
      • Set TalentGUI_Spell = Inferno (Tichondrius)
      • Set TalentGUI_Head = (Name of TalentGUI_Spell)
      • Set TalentGUI_Icon = (Icon of TalentGUI_Spell)
      • Set TalentGUI_Text = (Extended Tooltip of TalentGUI_Spell for level 3)
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentGUI_Spell = Hexerei
      • Set TalentGUI_Head = (Name of TalentGUI_Spell)
      • Set TalentGUI_Icon = (Icon of TalentGUI_Spell)
      • Set TalentGUI_Text = (Extended Tooltip of TalentGUI_Spell for level 3)
      • Custom script: TalentAddSelection(GetTriggerUnit())
  • Talent BladeMaster Kopieren
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Spiegelbild
    • Actions
      • Trigger - Turn off (This trigger)
      • -------- Who uses this? --------
      • Set TalentGUI_UnitType = Klingenmeister
      • -------- ---- --------
      • -------- ---- --------
      • -------- For which Level create choices? --------
      • Set TalentGUI_Level = 1
      • Set TalentGUI_Spell = Ausdauer-Aura
      • Set TalentGUI_Head = (Name of TalentGUI_Spell)
      • Set TalentGUI_Icon = (Icon of TalentGUI_Spell)
      • Set TalentGUI_Text = (Extended Tooltip of TalentGUI_Spell for level 3)
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentGUI_Spell = Unheilige Aura
      • Set TalentGUI_Head = (Name of TalentGUI_Spell)
      • Set TalentGUI_Icon = ReplaceableTextures\CommandButtons\BTNGargoyle.blp
      • Set TalentGUI_Text = 200 Life & Unholy Aura
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentGUI_TasLife = 200
      • Trigger - Run TalentGUIAddTasStats (ignoring conditions)


  • Talent Blademaster Expand Windwlak
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Windlauf
    • Actions
      • Trigger - Turn off (This trigger)
      • -------- Who uses this? --------
      • Set TalentGUI_UnitType = Klingenmeister
      • -------- For which Level create choices? --------
      • Set TalentGUI_Level = 1
      • Set TalentGUI_Spell = Gottesschild (Neutral Hostile)
      • Set TalentGUI_ChoiceHead = (Name of TalentGUI_Spell)
      • Set TalentGUI_ChoiceIcon = (Icon of TalentGUI_Spell)
      • Set TalentGUI_ChoiceText = (Extended Tooltip of TalentGUI_Spell for level 1)
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentGUI_Spell = Heiliges Licht
      • Set TalentGUI_ChoiceHead = (Name of TalentGUI_Spell)
      • Set TalentGUI_ChoiceIcon = (Icon of TalentGUI_Spell)
      • Set TalentGUI_ChoiceText = (Extended Tooltip of TalentGUI_Spell for level 1)
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentGUI_Level = 4
      • Set TalentGUI_ChoiceHead = Armor
      • Set TalentGUI_ChoiceIcon = ReplaceableTextures\CommandButtons\BTNArmorGolem.blp
      • Set TalentGUI_ChoiceText = +500 Max Life
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentTasStatLife[TalentChoiceLast] = 500
      • Set TalentGUI_ChoiceHead = ManaStone
      • Set TalentGUI_ChoiceIcon = ReplaceableTextures\CommandButtons\BTNPendantOfMana.blp
      • Set TalentGUI_ChoiceText = +250 Max Mana
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentTasStatMana[TalentChoiceLast] = 250
      • -------- Update Max Talent Level --------
      • Trigger - Run TalentGUI <gen> (ignoring conditions)
  • Talent Blademaster Expand Mirror
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Spiegelbild
    • Actions
      • Trigger - Turn off (This trigger)
      • -------- Who uses this? --------
      • Set TalentGUI_UnitType = Klingenmeister
      • Set TalentGUI_Level = 10
      • Set TalentGUI_ChoiceHead = Helm
      • Set TalentGUI_ChoiceIcon = ReplaceableTextures\CommandButtons\BTNHelmOfValor.blp
      • Set TalentGUI_ChoiceText = +6 STR|n+6 AGI
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentTasStatAgi[TalentChoiceLast] = 6
      • Set TalentTasStatStr[TalentChoiceLast] = 6
      • Set TalentGUI_Spell = Heiltrank (Geringer)
      • Set TalentGUI_ChoiceHead = (Name of TalentGUI_Spell)
      • Set TalentGUI_ChoiceIcon = (Icon of TalentGUI_Spell)
      • Set TalentGUI_ChoiceText = (Extended Tooltip of TalentGUI_Spell for level 1)
      • Trigger - Run TalentGUICreateChoice (ignoring conditions)
      • -------- Update Max Talent Level --------
      • Trigger - Run TalentGUI <gen> (ignoring conditions)


Remove/hide you could do, by creating for each an own tree and changing the used one. Because I did not built any feature to remove choices. This tree replace dont work that good with talent reset, therefore either first reset then change or disable the reset feature.
This is excellent just what i needed!

1708543062909.png

you even provided map examples , oh thank you so much friend! :D
 
Level 5
Joined
Nov 3, 2018
Messages
80
so i was doing an ability selection that works with a dialog box (basically you choose a skill and depending on which button of the dialog box you clicked its the one you get so i replicated the trigger i used for getting abilities with the talent tiers and they do appear but they're not clickeable for some reason

any idea what i might be doing wrong? the talents are getting created successfully but i cannot click them

EDIT Solved my issue it was just that a level 1 hero cannot choose a talent
1708643319232.png
 

Attachments

  • 1708643345861.png
    1708643345861.png
    5 KB · Views: 9
Last edited:
Level 4
Joined
Oct 31, 2011
Messages
69
1710141486656.png


Would it be possible to change the button to a button icon, or could I create a button that calls the talent tree?

What would be the command that calls the talent tree? And how do I disable the default button?

I would also like the command to disappear with the talent button, please.
 
Last edited:
I did not implement an iconButton mode.
if you mod newest warcraft 3 then you can change the Textures used by the show button,do this one after they are created.
JASS:
// GridMode
call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentGridShowButton",0), 0), icon, 0, true)
call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentGridShowButton",0), 1), icon, 0, true)
call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentGridShowButton",0), 2), icon, 0, true)
call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentGridShowButton",0), 3), icon, 0, true)

call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentShowButton",0), 0), icon, 0, true)
call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentShowButton",0), 1), icon, 0, true)
call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentShowButton",0), 2), icon, 0, true)
call BlzFrameSetTexture(BlzFrameGetChild(BlzGetFrameByName("TalentShowButton",0), 3), icon, 0, true)

if you want to show the talent UI by yourself
JASS:
// Box Mode
call BlzFrameSetVisible(BlzGetFrameByName("TalentBox", 0), true)
call BlzFrameSetVisible(BlzGetFrameByName("TalentShowButton", 0), false)
call TalentBoxUpdate(GetTriggerPlayer())

//Grid mode
call BlzFrameSetVisible(TalentGridJUI_FrameParent, true)
call BlzFrameSetVisible(TalentGridJUI_FrameShow, false)
call TalentGridUpdate(GetTriggerPlayer())

I would also like the command to disappear with the talent button, please.
Hides the hero command for one unit only, call BlzUnitHideAbility(udg_Unit, 'AHer', true) beaware that this is counter based, to undo it you need the same amount of falses as you used true for that unit.
One can hide the learn button for all heroes by using a custom "units/commandfunc.txt" file in your map and giving the learn skill the icon coords 0/-11.

good luck
 
Level 4
Joined
Oct 31, 2011
Messages
69
Custom script: call TalentHeroSetCopy(udg_Talent__Unit, GetUnitTypeId(udg_Talent__Unit, 'o00M'))

I did it and it gave me an error.
Use the GetUnitTypeId() function to get a unit's unit-type (aka unit ID):
  • Custom script: call TalentHeroSetCopy(udg_Talent__Unit, GetUnitTypeId(udg_Talent__Unit))
 
Level 4
Joined
Oct 31, 2011
Messages
69
I don't understand how I'm going to declare the two units in it? This call was for one unit to copy another's taelnto tree. Then I had the ID of both of them on that call.
Look at what I wrote and what you wrote. Hint: They're not the same :p

You can just copy and paste my custom script.
1710620050968.png
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,535
I don't understand how I'm going to declare the two units in it? This call was for one unit to copy another's taelnto tree. Then I had the ID of both of them on that call.
Oh, it takes two Units. You see how it's taking udg_Talent__Unit as the first parameter. Just do that for the second parameter but with your other Unit.
  • Custom script: call TalentHeroSetCopy(udg_Unit_1, udg_Unit_2)
If it were to take two Unit-Types (unit id) then you'd simply wrap your variables with the GetUnitTypeId() function:
  • Custom script: call TalentHeroSetCopy(GetUnitTypeId(udg_Unit_1), GetUnitTypeId(udg_Unit_2))
Or a combination of the two.
 
Last edited:
Level 4
Joined
Oct 31, 2011
Messages
69
This System is very good, Taysen always has great systems that contribute a lot to the community. I would like to leave some suggestions if there is an update following suggestions.

Option for heroes to have more than one Talent Tree and be able to switch between them at any time, just like World of Warcraft where each Class has 2 to 4 Talent Trees each for a role, for example tank, DPS, and Healer.

An icon as a button instead of the current one. icon button that does not take up the skill space.

Option to disable the tree option if the hero is outside a safe region, or in combat.

These are just these 3 suggestions because the system already does the rest very well.
 
Option for heroes to have more than one Talent Tree and be able to switch between them at any time, just like World of Warcraft where each Class has 2 to 4 Talent Trees each for a role, for example tank, DPS, and Healer.
I dont want to extend the system in this direction. There is another public Talent system quite fitting for wow trees. This, my, system aimed more to be something like Heroes of the Storm.

An icon as a button instead of the current one. icon button that does not take up the skill space.

Option to disable the tree option if the hero is outside a safe region, or in combat.
Okay, I add this 2 suggestions (icon button + Talent useage condition), they are good.

Edit: Updated Lua version to V1.38
ShowButton can be an IconButton also can set Size
One can know have an condition to block using Talent.
Talent can now be setuped to not create itself automatic

On default the UseCondition will try to use a GUI Trigger which has to be named "TasTalent_UseCondition" or "TasTalent UseCondition"
  • TasTalent_UseCondition
    • Events
    • Conditions
      • (Talent__Unit is alive) Equal to True
      • (Talent__Unit is paused) Equal to False
      • Or - Any (Conditions) are true
        • Conditions
          • (Talent__Unit has buff Inneres Fire) Equal to True
          • (Talent__Unit is A Hero) Equal to True
    • Actions
      • -------- Talent GUI use Condition, optinal default conditions --------
      • -------- only conditions are used, with Talent__Unit --------
      • -------- This Trigger needs to be called "TasTalent_UseCondition" or "TasTalent UseCondition" --------
one could change the UseCondition in Settings of Talent.

Edit: Updated vjass to 1.36e
ShowButton can be an IconButton also can set Size
One can know have an condition to block using Talent
the Condition requies a GUI trigger existing, if you dont want that remove it from the Talent code.
 
Last edited:
Level 4
Joined
Oct 31, 2011
Messages
69
I dont want to extend the system in this direction. There is another public Talent system quite fitting for wow trees. This, my, system aimed more to be something like Heroes of the Storm.
I understand, but wouldn't it be possible to change the talent tree and declare the unit as a Variable instead of an ID?

Instead of this:
  • Custom script: call TalentHeroSetCopy('H005', 'H001')
Being able to declare it this way:
  • Custom script: call TalentHeroSetCopy('udg_Talent__unit', 'udg_Hero_unit')

one could change the UseCondition in Settings of Talent.

Edit: Updated vjass to 1.36e
ShowButton can be an IconButton also can set Size
One can know have an condition to block using Talent
the Condition requies a GUI trigger existing, if you dont want that remove it from the Talent code.

This is very good, one of the best systems here, the other is also yours than TasItemBag. If you could update the button icon in TalentGrid too, that would be amazing, TalentGrid has a great designer.
 
Last edited:
You are right with some small changes to the vjass system one can have the unit specific Talents by using the TalentHeroSetCopy feature.
Thanks for your will, I didn't consider that it was that easy to make, was expecting that I needed to do big changes. But all it took was changing a constant to avoid data colisions in unit handle data and adding an if check.

Updated vjass to 1.36f) an specific unit can now use an wanted Talent of unitCode.
Has 2 demos that make one dwarf only; use Paladin talents and another to make that dwarf use Uther Talents instead.

aye, thats how to do this, udg_Talent__Unit use 'H001'.
  • Custom script: call TalentHeroSetCopy(GetHandleId(udg_Talent__Unit), 'H001')
Edit:
This is very good, one of the best systems here, the other is also yours than TasItemBag. If you could update the button icon in TalentGrid too, that would be amazing, TalentGrid has a great designer.
Both Modes should support the Icon Button feature. But the default setup is: one Text Mode other Icon mode.
 
Last edited:
Level 4
Joined
Oct 31, 2011
Messages
69
Both Modes should support the Icon Button feature. But the default setup is: one Text Mode other Icon mode.
Sorry if I ask too many questions, I have little knowledge of vjass, is it complicated to add the icon button to TalentGrid?
 
it is easy, you open TalentGrid between globals and endglobals you find variables used by the system. Search for
private string ShowButtonIcon = ""
now insert your wanted IconFilePath into "".
next to ShowButtonIcon you also find other options for the ShowButton

When the path contains \ use \\ or use /
 
Level 4
Joined
Oct 31, 2011
Messages
69
1712434503709.png


Taysen, what command does this button use to reset talents?

If I want to reset talents using an item or something similar.
 
Level 4
Joined
Oct 31, 2011
Messages
69
Tasyen, you contribute a lot to the warcraft community, as do other developers here. I would like to pay tribute to everyone who contributes resources here.

And rather than putting the names of all those I use resources here I will use the names for the characters in my game (map).

As an example in the image I made to honor you.

It is written: Tasyen, Hivework High King.
1712683423079.png
 
Top