• 🏆 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.
Level 9
Joined
Mar 6, 2012
Messages
64
I see, thanks! I was using triggers (executing them) before to execute an "action" for my custom missiles and planned to use ExecuteFunc()/.execute(). Is it better to just stick with triggers?
 
Level 38
Joined
Feb 27, 2007
Messages
4,951
Both the . functions use triggers internally afaik. There’s no real functional difference between what you described and using them except they allow the triggers to run in a new thread. If you try to run too many triggers in a row using your method it’s possible to hit the op limit and threadcrash.

ExecuteFunc with an invalid function name will crash the game.
 
Level 7
Joined
Aug 11, 2010
Messages
269
This is an absolutely fantastic system, I'm very eager to use this for a project I'm working on... That being said; I'd love to know how to disable the UI (and function) of talent resets. I don't actually want my Heroes to be able to swap talents on the fly (or, really -- at all), I'd very much love to get rid of the UI so that it cannot be done. I toggled off the

"constant function TalentBoxUseUnlearnButton takes nothing returns boolean
return false"

bit... But there's a weird UI glitch with the UI where it's still trying to show up.
 
"constant function TalentBoxUseUnlearnButton takes nothing returns boolean
return false"

bit... But there's a weird UI glitch with the UI where it's still trying to show up.
Thanks for that Feedback. The glitch happens cause the Tooltip-Frame of that button was created even when the reset button is not created.

As a web developer I am rather annoyed by the fact that the body panel (the one beneath the title) kinda collides with the bottom border of the parent.
Might be better without the border and background for the description.
Not bordeed 1.jpg not bordered 2.jpg Not bordered 3.jpg

Edit: Might also be good to change the border and background of the Level Buttons to the same as other ones so the do not stand out so much.
Not bordered 4.jpg

Or another Idea is fusing the Borders.
Bordered 1.jpg Bordered 2.jpg
 
Last edited:

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,456
Sorry if this is too much to ask but I was wondering if anyone could help me out here.

So basically, I'm just trying to create simple Text Boxes. I saw this system and figured I could read it and learn how to do it myself. Unfortunately, I'm
struggling a bit. I managed to mess around with the System and hide the Talent Show button and create a Text Box using this:
Lua:
local fh = BlzCreateFrame("TalentBoxTextArea", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0)
BlzFrameSetSize(fh, 0.22, 0.22)
BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPRIGHT, 0.8, 0.5)
BlzFrameSetText(fh, "Text goes here")
BlzFrameSetEnable(fh, true)
But there's so much extra stuff going on that I don't need. Basically, I want to know what part of the Talent code do I need if I only wanted to make text boxes like in the code above.
In other words, I don't want all of the extra stuff that comes with the system (so nothing Talent related), I just want the above code^ to work so I can create simple Text Boxes.

Also, great system. I'll keep trying to wrap my head around it but I'm new to this stuff.
 
If you only want a TextArea, you don't really need anything from Talent. What you need is a loaded mainframe of Type "TEXTAREA". Such one exists in "ui\framedef\ui\escmenutemplates.fdf" which is not loaded on default. Hence you have to create a custom TOC loading it. That custom TOC you Import into your map and load it with BlzLoadTOCFile, can be done inside a Init_trig. After the loading was done, you can create mainframes mentioned in the fdfs of that TOC. Instead of writing an own TOC, you could Import the TOC inside the zip of this post. This TOC loads the not loaded standardtemplates:
ui\framedef\ui\escmenutemplates.fdf
ui\framedef\glue\standardtemplates.fdf
TOC-Files have to end with a empty new line.

Inside "ui\framedef\ui\escmenutemplates.fdf" there is a mainframe of type TEXTAREA beeing named "EscMenuTextAreaTemplate" that is the one you should create.

"Talentbox.fdf" has a mainframe named "TalentBoxTextArea" which inherits from "EscMenuTextAreaTemplate".
You could also check out "TalentBoxTextArea" in "Talentbox.fdf" and create your own in a similar way. That currently has to be done, if you want to change the font of the text shown inside the TEXTAREA.

I call frames mainframes when they have a definition outside of a framebody.
 

Attachments

  • Templates.zip
    181 bytes · Views: 199
Last edited:
Talent Jui, along with the rest of the bundles utilizing the new UI natives, is something that could only be described as a "wet dream" for mapmakers. Talent Jui could possibly spur a new generation of wc3 based AoS maps, along with providing additional possibilities in existing ones. Yet, it cannot be stated enough that this might have more useful applications not just within the scope of AoS maps but also outside of it (such as RPGs, minigames, etc.).

This is, as it is right now, quite useful for mapmaking. Yet, it could use some more polishing, which will improve this already-impressive resource.

Areas that could be polished:
  1. Once a unit or Hero has learned all of its' talents, the talent box should have the option to immediately close.

  2. When a unit "dies" (physically dead but has not yet fired the death event), the talent box should immediately close.

  3. When throwing events, try adding a line that sets Talent__Event to 0.00 before the desired value, in case recursions occur with the system.
This may very well be one of the best system resources for GUI, JASS/vJASS, Lua, or Wurst (if they decide to rewrite it) for mapmaking and can be definitive of the potential that wc3 modding can really be.
 
Updated to 1.33 should fullfile MyPads Points. Maybe also the overglowing was fixed.

Once a unit or Hero has learned all of its' talents, the talent box should have the option to immediately close.
Done, also happens when selecting an choice and not beeing able to do further choices. This is a Setting which can be disabled. In Lua it is a variable hence one could change it, probably also for only one Player using GetLocalPlayer(). In jass it is a constant function.

When a unit "dies" (physically dead but has not yet fired the death event), the talent box should immediately close.
An trigger was added that runs on any unit death when the current observed target us the dying unit TalentBox Closes.

When throwing events, try adding a line that sets Talent__Event to 0.00 before the desired value, in case recursions occur with the system.
Done
 
This was a question on my profile regarding this system but It is general to this system
Can Talent add Tiers on a later time?
Yes, Tiers and choices can be added and removed during the game, Removing breaks the unlearning and it is not recommented to add a tier between 2 already learned tiers.

Although Talent does not check for new Talents until a Levelup or when it was told to recheck.
An Lua example for the demo Map everytime Player Red writes add all Bloodmages gain an additional tier after the current last one basicly the same as his Tier Level 5.
Lua:
function BloodMageAdd()
  local heroTypeId =  FourCC('H005')
  local choice = nil

  TalentHeroCreateTier(heroTypeId, Talent[heroTypeId].MaxLevel + 1)

  choice = TalentChoiceCreateStats(6, 3, 3)
  choice.Head = "Magic Power: Str"
  choice.Icon = "ReplaceableTextures\\CommandButtons\\BTNHelmOfValor.blp"

  choice = TalentChoiceCreateStats(3, 6, 3)
  choice.Head = "Magic Power: AGI"
  choice.Icon = "ReplaceableTextures\\CommandButtons\\BTNHoodOfCunning.blp"

  choice = TalentChoiceCreateStats(3, 3, 6)
  choice.Head = "Magic Power: Int"
  choice.Icon = "ReplaceableTextures\\CommandButtons\\BTNPipeOfInsight.blp"
 
  ForForce(bj_FORCE_ALL_PLAYERS, function()
    local player = GetEnumPlayer()
    local target = TalentBox.Control[player].Target

    -- Uses the current players Talent Target of that Talent?
    if TalentGetUnitCode(GetUnitTypeId(target)) == heroTypeId then
      -- show & update the box
      TalentBoxShow(target, player)
      -- tell Talent to recheck for new Tiers
      TalentAddSelection(target)
    end
  end)
end

-- Create the chat command
TimerStart(CreateTimer(),0,false, function()
  local trigger = CreateTrigger()
  TriggerAddAction(trigger, BloodMageAdd)
  TriggerRegisterPlayerChatEvent(trigger, Player(0), "add", true)
 DestroyTimer(GetExpiredTimer())
end)

the same for the vjass
JASS:
function Trig_Talent_BloodMageAdd_Actions takes nothing returns nothing
    local integer choice
    local integer heroTypeId = 'H005'
    local integer playerIndex = 0
    call TalentHeroSetFinalTier(heroTypeId, TalentHeroGetFinalTier(heroTypeId) + 1)
    call TalentHeroTierCreate(heroTypeId, TalentHeroGetFinalTier(heroTypeId))
    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"

    loop
        if TalentGetUnitTypeId(udg_TalentControlTarget[playerIndex]) == heroTypeId then
            call TalentBoxShow(udg_TalentControlTarget[playerIndex], Player(playerIndex))
            call TalentAddSelection(udg_TalentControlTarget[playerIndex])
        endif
        set playerIndex = playerIndex + 1
        exitwhen playerIndex == bj_MAX_PLAYERS
    endloop

endfunction

//===========================================================================
function InitTrig_Talent_BloodMageAdd takes nothing returns nothing
    set gg_trg_Talent_BloodMageAdd = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent( gg_trg_Talent_BloodMageAdd, Player(0), "add", true )
    call TriggerAddAction( gg_trg_Talent_BloodMageAdd, function Trig_Talent_BloodMageAdd_Actions )
endfunction
 
Last edited:
Level 5
Joined
Nov 3, 2018
Messages
73
hey there! first than anything. thank you for making this GUI-FRIENDLY! How can i prevent a tier from being visible until someone reaches the requiered level? (GUI)
 
Last edited:
Level 7
Joined
Oct 20, 2010
Messages
182
Forgive me slightly for I am new to pulling others triggers to my own maps. But upon following the install instructions and porting these into a different map, and copying the mountain king and his same unit code (H006), entering the game I am able to open the talents menu but there are no talents listed.

Another curious thing I noticed is when on your test map when I'd delete or alter any trigger (the examples and Demo triggers), it completely shuts off talents for all units. I'm a novice and unsure why this is, but because of this I can't for the life of me set up custom talents.
 
Level 9
Joined
Aug 16, 2019
Messages
66
When a unit is selected, a different set of talents appears. Only after pressing buttons 1, 4, 7, 10 do the talents of this unit appear. Jass system, use via GUI

Immediately after clicking on Talents, the wrong level 1 talents appear:
WC3ScrnShot_081620_105752_001.png

After clicking on the level 1 talent button, the correct talents appear:
WC3ScrnShot_081620_105755_001.png

Version 1.33
 
Updated to 1.34b
Recreates all Talent custom UI, after Loading the game to counter Save&Load Bug (this excludes the demo map UI).
Recently someone told me that one of my UI systems broke when the game was saved and later loaded. I did some research about that and found out that custom created Frames and Frame modifications are not save nor loaded and that using references to the now broken custom Frames can crash the game. This applies to V1.31, V1.32.8 and V1.32.9 PTR.

I added a custom FrameLoader Trigger that redoes the whole system's Frame creation when the game is Loaded.
 
Level 35
Joined
Feb 5, 2009
Messages
4,552
I don't know if I'm missing something obvious with this or not, but I've been trying to find where it determines what unit you have selected to decide which Talent Tree to show and I haven't had any luck. I'm sort of hoping to be able to tweak it slightly so that instead of having it update the Talent Tree based on what unit you have selected, that instead it shows the same Talent Tree after connecting it to a specific unit. Is this doable with the system as it is?

So, what I mean more specifically is, say you pick a Hero option, then that Hero gets created. Rather than have it update the Talent Box to be whatever unit I have selected, I want it to be strictly based on that Hero alone, so once that Hero is selected the Box itself doesn't update to any new unit selections.
 
Last edited:
Such behaviour was not inteded. But it is Technicaly a downgrade, therefore it is doable with changing the source code.

In the Lua version
TalentBox.Control[player].Target is the current Talent Target, one would have to stop the system from changing it and select it manualy.

In the (v)jass version the currentSeleceted Unit is udg_TalentControlTarget[GetPlayerId(p)].

The simples way seems to be: reuse the current Seleceted Target as arg for the function that changes the selected Target onSelection: It is a bit ineffective (because now many unneeded updates are done) , but it is easy to do. You only have to change one Line in the Source Code.
The 1. arg is the new unit. Reuse the ControlTarget. In the old code it is GetTriggerUnit().
JASS:
function TalentShowUI takes nothing returns nothing
    call TalentBoxShow(udg_TalentControlTarget[GetPlayerId(GetTriggerPlayer())], GetTriggerPlayer())
endfunction
In case you use GUI. udg_TalentControlTarget[0] is expected to be Player red. [1] Player blue ...

in Lua it would be this block
Lua:
TalentBox.Trigger.Select = CreateTrigger()
TriggerRegisterAnyUnitEventBJ(TalentBox.Trigger.Select, EVENT_PLAYER_UNIT_SELECTED)
TriggerAddAction(TalentBox.Trigger.Select, function()
--  TalentBoxShow(GetTriggerUnit(), GetTriggerPlayer())
     TalentBoxShow(TalentBox.Control[GetTriggerPlayer()].Target, GetTriggerPlayer())
end)
In case you use GUI: In Lua this does not work based on PlayerNumbers but on the players directly.
 
Last edited:
Hey @Tasyen Wondering if there is a way to replace the "Show Talent" text with an icon? How would I do that with this system? (Using the LUA version btw)
This was not planed as feature. Therefore you need to do custom UI stuff regarding Frames. One could place a BACKDROP over the Default Button, replace the TextButton with an proper IconButton or for Reforged Modder one also can change the Displayed Textures in each Button-State.

In case you are modding V1.32.6+ (Reforged you could pick the Children at index 0, 1 and 2 of the Default Button and set the Texture of it.
Could look like that
BlzFrameSetTexture(BlzFrameGetChild(TalentBox.Frame.Show, 0), BlzGetAbilityIcon(FourCC("Hpal")), 0, true)
BlzFrameSetTexture(BlzFrameGetChild(TalentBox.Frame.Show, 1), BlzGetAbilityIcon(FourCC("Hpal")), 0, true)

It is important to set 0 and 1. 0 is idle State, 1 while clicked.
Index 2 is the disabled State
BlzFrameSetTexture(BlzFrameGetChild(TalentBox.Frame.Show, 2), texFile, 0, true)


In the Lua Code TalentBox.Frame.Show is the Show-Talent-Button which is created in function TalentBoxCreate()
 
Updated both Lui and Jui to 1.34d)
Talent uses GetLocalizedString onto a Choice's Head/Text/Icon for displaying purposes in it's UI.
Means you could write a StringList with the content than create a Choice and tell Talent the Keys
Added a new demo Human Priest to show the StringList Talent.​
(jass) Compiles&works without FrameLoader now.
(Lua) ObjectEditor ObjectCode functions now autoConverts rawCode Strings into numbers using FourCC. Means you don't write FourCC. It is recommented to let Talent do the FourCC because FourCC returns 2 numbers in Warcraft 3 V1.31.1 which can bring unwanted results if you put such into an function call directly.
(Lua) TalentHeroCopy, TalentChoiceAddAbility, TalentGetUnitCode, TalentHeroCreate, TalentHeroLevel2SelectionIndex, TalentHeroCreateChoiceAtLevel, TalentHeroCreateTier, TalentHeroCreateChoice
(Lua) and functions from TalentPreMadeChoice do the same: TalentChoiceCreateImproveSpell, TalentChoiceCreateAddSpell, TalentChoiceCreateAddSpells ^^
(Lua) OnLearn/OnReset callback functions now provide arguments (unit, unitCode, buttonNr, choice, tierLevel)
(Lua) OnLearn/OnReset callback functions now run in xpcall and print Out infos when an coding error happens.
 
Updated Lui to 1.35)
Improved error messages for UnitSheets callbacks.
new function TalentChoiceAddSpells(choice, "AHbz,AHwe,AHab,AHmt")
new feature Talent.TasStats
A set of choice keys adds base stats. This includes changing ability fields (for all levels or at wanted levels only).​
Talent.TasStats happens before the callbacks and does not use them unlike TalentPreMadeChoice.
Talent.TasStats can be used by GUI, you first Create a Choice than you set the TalentGUI_Tasxx variables then execute Trigger TalentGUIAddTasStats
Didn't find a way to let GUI use the SpellField feature (Had an idea but it didn' work, TriggerData.txt has wrong inherit Type for AbilityxxField making such variables not work in world editor).​

moved functions from TalentPreMadeChoice to Talent

function TalentChoiceCreateAddSpell(spellCode, useButtonInfos)
function TalentChoiceCreateReplaceSpell(oldSpell, newSpell )
function TalentChoiceCreateAddSpells(...)​
Removed TalentPreMadeChoice

Fixed a bug with TalentChoiceCreateAddSpells it ignored the last skill when not FourCC was used
moved TalentGUI out of the rootCode (mp safer).
moved some other code out of the rootCode in Talent (mp safer)

TalentGUIAddSpell resets the Spell to 0 after usage
, because without a reset the next choice would add the same Spell. (you need to update TalentGUI for that)​

Added the tooltip from TasButtonList to display choices in a big box when hovering them.

This can be disabled with Settings.BoxOptionHaveTooltip = false
The tooltip can either be placed relative or to a fixed position​
Added Settings.BoxOptionShowText to hide the description Text inside the TalentBox

uses TasButtonAction instead of own Triggers for ButtonEvents
 
Last edited:
updated Lui and Jui to 1.35a)
Added GroupMode
(the 1.35 fdf already contained the GroupMode frames so no new fdf)
during GroupMode all selected Units using the same Talent and with the same amount of selections done, will do picks/Unlearn/Relearn together.
The user can turn it off/on clicking a button.
more support for GetLocalizedString
Reset-Button now use the same Tooltip-Type.
 
Last edited:
I don't know runescape. Talent Jui/Lui only supports a row of choices (tiers), in each choice you can only pick one. While the tiers, their amount and at which level you get them can differe for unitTypes. If your want stuff that does not fit that than you need something else.

The whole concept was inspired by Heroes of the storm.
 
Update Talent Lui to 1.36)
Seperated Talent and it's UI.
Added a new additional UI which shows tiers in scrollable rows, better for having an long time overview.
There are now Talent, TalentBox and TalentGrid. To use Talent you need Talent and either TalentBox or TalentGrid you could take both.
The Show Talent Buttons now have a model to hint that the current unit can pick a choice.
Changed the Settings layout, each has now an own Settings section at top.

Edit: Update Talent Lui to 1.36a) small hotfix
TalentBox had a bug when selecting no Talent User
TalentGrid did not use udg_TalentControlPreventReset
Hence you only need to update this scripts, if you want to update.
 
Last edited:
Updated Talent Jui to 1.35b)
Added a version of TasTalentStat unlike the Lua version it can not set Ability Field values.
Added function TalentChoiceAddSpells & function TalentChoiceAddSpellsEx: add many skills in one string in one call TalentChoiceAddSpells(choice, "AHbz,AHwe,AHab,AHmt")
this function requires ascii from Nestharus/Bribe
Moved TalentChoiceCreateAddSpells into Talent from Premade; reworked it to behave like TalentChoiceAddSpellsEx.
Moved TalentChoiceCreateReplaceSpell into Talent from Premade
Added a Model over the show Button to hint a talent can be picked
 
Updated Talent Lui to 1.36b) TalentGrid improvements and Save&Load fix
TalentBoxTitle renamed to TalentGridTitle
TalentBoxOptionParent renamed to TalentGridOptionParent
Removed Settings.OptionMaxCount as it was not used
Added TalentGrid.Frame.ToolTipParent which is the parent of all Tooltips in TalentGrid
Added Settings.Parent = function() to more easly set the used parent.
Settings.OptionHaveTooltip (false) don't stop creating Tooltips instead it just hides them and prevents updating them
Added Settings.Scale & Settings.ToolTipScale
Runtime support for Settings.OptionSizeX, Settings.OptionSizeY, Settings.OptionIconSize, Settings.OptionTooltipSizeX, Settings.Pack, Settings.HaveResetButton

Reworked the included FrameLoader as it did not work as wanted in Warcraft 3 V1.31.1, Talent Lui still crashed since Lui V1.35a and Included Fix FourCC which overwrites FourCC with a version from Luashine (this is mostly for Save&Load)
 
So looking over the code/demo of this it seems any player can modify the talents of any unit, EVEN IF they do not own that unit. My question is how can I make this MUI such that users can only modify the talents of the units they own?

Is it as simple as modifying the Demo LastSelect to add more players and check if they are the owners?

Will changing LastSelected with multiple players disable MUI?

JASS:
function Trig_Demo_LastSelect_Conditions takes nothing returns boolean
    if ( not ( GetOwningPlayer(GetTriggerUnit()) == GetTriggerPlayer() ) ) then
        return false
    endif
    return true
endfunction

function Trig_Demo_LastSelect_Actions takes nothing returns nothing
    set udg_LastSelected = GetTriggerUnit()
endfunction

//===========================================================================
function InitTrig_Demo_LastSelect takes nothing returns nothing
    set gg_trg_Demo_LastSelect = CreateTrigger(  )
    call TriggerRegisterPlayerSelectionEventBJ( gg_trg_Demo_LastSelect, Player(0), true )
    call TriggerRegisterPlayerSelectionEventBJ( gg_trg_Demo_LastSelect, Player(1), true )
    call TriggerAddCondition( gg_trg_Demo_LastSelect, Condition( function Trig_Demo_LastSelect_Conditions ) )
    call TriggerAddAction( gg_trg_Demo_LastSelect, function Trig_Demo_LastSelect_Actions )
endfunction
 
So looking over the code/demo of this it seems any player can modify the talents of any unit, EVEN IF they do not own that unit
Shared Control allows to pick/reset talents, like shared Heroes can pick Hero skills.
The Demo Lacks an ally without shared control, in the north are enemies for which one can not pick talents. One could uncheck the shared Team control in world editor's force setup to make a test without shared control in which one will not be able to pick talents for the ally teal.

My question is how can I make this MUI such that users can only modify the talents of the units they own?
I haven't added an option to turn of the shared control Talent picking, One would have to change the UI's code inside Grid/Box.
One would have to search for GetPlayerAlliance and replace them with IsUnitOwnedByPlayer. I could make an update if you really want that feature, it would than be an additional setup in the UI Scripts.
 
I haven't added an option to turn of the shared control Talent picking, One would have to change the UI's code inside Grid/Box.
One would have to search for GetPlayerAlliance and replace them with IsUnitOwnedByPlayer. I could make an update if you really want that feature, it would than be an additional setup in the UI Scripts.
Well was hoping to use this as an actual HotS style talent system for a Hero Arena map. Which would mean just one talent tree per player set for only one hero, which looks like it's not quite able to do right now without some modification. So if you don't add it in, I will certainly try myself but I think it would be nice to have as an added feature for this system.
 
But It does that that: One TalentSet for each UnitClass and each unit can pick it's Talents from the TalentSet, if it's class has a Talentset. You can only pick Talents for units you can order and have selected. For unit's you can't order you can look what they have/can pick(ed).

One could change it to not change the Target of Talent by selection, but that is not part of the settings right now and it means you would have to set the current Target when your hero is picked. And it also means the player can't use the Talent UI to look what others have picked (which is in my opinion a downgrade but whatever).

So I guess you want this 2 features/settings:
Only own Unit Talent-picking
Fixed Talent Target
 
Updated Lui&Jui to 1.36c)
Added 2 new Settings OnlyOwnUnit & FixedTarget.
FixedTarget (true) Talent will not change TalentBox.Control[player].Target or udg_TalentControlTarget[playerId] (Lui/Jui)
OnlyOwnUnit (true) can not pick Talents for Shared Control of other player's Units.

The show Button Sprite does now check, if one has control over the unit.

Jui only updated TalentBox/TalentGrid
Lui updated Talent/TalentBox/TalentGrid, if you don't use TalentBox you only need to update TalentGrid.
 
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?

JASS:
 function TalentGridUpdate takes player p returns nothing
        local integer playerId = GetPlayerId(p)
      
        local integer rows = RowsAmount
        local integer cols = ColsAmount
        local unit u = udg_TalentControlTarget[playerId]
        local integer unitHandle = GetHandleId(u)
        local integer unitCode = TalentGetUnitTypeId(u)
      
        local integer offset = Offset[playerId]
        local integer y = -1
        local integer x
        local integer tierCount = 0
        local integer choice
        local integer tier
        local integer frameIndex
        local integer colsMax = 0
        local integer rowsMax = 0
        local integer level = 0
        local integer buttonUsed
        if GetLocalPlayer() != p then
            //set u = null   <- should set u = null here but is not
            return
        endif
        if not TalentHas(u) then
            //set u = null   <- should set u = null here but is not
            return
        endif
 
Last edited:
Top