• 🏆 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 1.30

Status
Not open for further replies.
This is a new alternate version of my ressource Talent, it only would need some last final touches but it overall works as intended.

The new version has a total different philosophy, then the previous version which is possible cause of the new ability natives.

Short Explanition of both Versions


Old:
Each Unit has a SpellBook and if the unit could choose a talent other Spellbooks (tiers) are hiddenly added.
After the unit casted a skill from the tier, it loses the tier again.
This resulted into a lot of object Editor Data and few Trigger/Jass Data.
New:
There are 8 choice Buttons which are inside a Spell-book, this buttons are changed shown/hidden based on the currents unit's need. This results into a fixed amount of object Editor Data, but a big amount of Trigger data.​


What would be the benefits and drawbacks of usings such a dynamic Button version?


Pros:
  • Reduces needed talent managment abilities to a fixed amount, plus upto 1 a hero.
  • One can make Talents immune to silence/doom quite easy
  • Talents are more easy to transfer between maps
  • The Choice data has to be saved in Trigger Editor, which allows more easy data attachment and automatic code execution.

Cons:
  • The Hero Talent Init Triggers/Codes become much bigger
    • one needs to define icons, maintext, and headText for each choice inside Triggers/Code
  • One loses the simple uniqueness of choices, beeing an ability with an fixed id.
    • which makes event handling more complex.

Example to show the amount of Objects needed in the old Talent:


if one would give a hero 5 tiers and each tier having 3 choices that would result into 20 hero specific talent managing abilities.

5 * 3 (choices) = 15 choices
15 choices + 5 (tiers) = 20 abilities

Also one could assume that 1/3 to 1/2 of that choices also need an abilitiy to produce its wanted action.

15 / 3 = 5
or 15/2 = 7 to 8
20 + 5 or 8 = 25 to 28 (for one hero).

10 Talent using Heroes would requier 200 to 280 talent managing abilities. You had to take care of the OrderId and sticking them into tiers and other stuff. This alone can be kinda troublesome, but 200+ abilties alone are well many.

In the new Talent:

One needs 8 Dynamic Buttons beeing used for all choices and a hero specific / default talent Spellbook containing the buttons. That's it for object Editor.
Now one would have to create the choices and tiers in a talent Hero Init. Shown below.
One would still need 15 choices and 5 Tiers but each of the 20 would be part of an integer array.



old: one has unique choices and can use that to execute the wanted behaviour with alot of ifs.
  • Demo Event Choose Skill
    • Events
      • Game - Talent__Event becomes Equal to 1.00
    • Conditions
    • Actions
      • Game - Display to (All players) the text: ((Proper name of Talent__Event_Hero) + ( picked + (Name of Talent__Event_Choice)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Talent__Event_Choice Equal to Choice - 6 Str (Paladin, Level 1)
        • Then - Actions
          • Hero - Modify Strength of Talent__Event_Hero: Hinzufügen 6
          • Special Effect - Create a special effect attached to the origin of Talent__Event_Hero using Abilities\Spells\Items\AIsm\AIsmTarget.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Talent__Event_Choice Equal to Choice - 6 Int (Paladin, Level 1)
            • Then - Actions
              • Hero - Modify Intelligence of Talent__Event_Hero: Hinzufügen 6
              • Special Effect - Create a special effect attached to the origin of Talent__Event_Hero using Abilities\Spells\Items\AIim\AIimTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Talent__Event_Choice Equal to Choice - 6 Agi (Paladin, Level 1)
                • Then - Actions
                  • Hero - Modify Agility of Talent__Event_Hero: Hinzufügen 6
                  • Special Effect - Create a special effect attached to the origin of Talent__Event_Hero using Abilities\Spells\Items\AIam\AIamTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
new version, Does not the same, this only shows the different usage of the Event based coding.

Choices are not unique anymore and in an Event the Choice ArrayIndex is not really helpful if one wants to do if based stuff, so I though one could archieve a correct but still kinda "simple" mapping by using HeroType + TalentLevel and Button (Button is the Dynmic Button used goes from 1 to 8).
  • Talent MK Event
    • Events
      • Game - Talent__Event becomes Equal to 1.00
    • Conditions
      • (Unit-type of Talent__Unit) Equal to Bergkönig
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Talent__Level Equal to 1
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Talent__Button Equal to 1
            • Then - Actions
              • Unit - Set Base Damage of Talent__Unit to ((Base Damage of Talent__Unit for weapon index 1) + 20) for weapon index: 1
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Talent__Level Equal to 4
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Talent__Button Equal to 1
            • Then - Actions
              • Hero - Modify Strength of Talent__Unit: Hinzufügen 6
              • Hero - Modify Agility of Talent__Unit: Hinzufügen 6
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Talent__Level Equal to 7
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Talent__Button Equal to 1
            • Then - Actions
              • Unit - Set Max HP of Talent__Unit to ((Max HP of Talent__Unit) + 500)
              • Unit - Set life of Talent__Unit to ((Life of Talent__Unit) + 500.00)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Talent__Button Equal to 2
            • Then - Actions
              • Unit - Set Max Mana of Talent__Unit to ((Max Mana of Talent__Unit) + 250)
              • Unit - Set mana of Talent__Unit to ((Mana of Talent__Unit) + 250.00)
            • Else - Actions
        • Else - Actions


also the GUI Creation was changed:

That way it looked in 1.24a
  • Talen GUI Bloodmage
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Which HeroType uses this --------
      • Set Talent_GUI_HeroType = Blutmagier
      • -------- ---- --------
      • -------- Define at which levels an talent choice can be done for this hero. Index 0 is not supported --------
      • Set Talent_GUI_Levels[1] = 1
      • Set Talent_GUI_Levels[2] = 5
      • Set Talent_GUI_Levels[3] = 10
      • -------- Save the last index --------
      • Set Talent_GUI_Levels_Last = 3
      • -------- ---- --------
      • -------- Define the Choice Container added on each Talent_GUI_Level --------
      • Set Talent_GUI_Tiers[1] = Container - Choice (Bloodmage, Level 1)
      • Set Talent_GUI_Tiers[2] = Container - Choice (Bloodmage, Level 1)
      • Set Talent_GUI_Tiers[3] = Container - Choice (Paladin, Level 1)
      • -------- ---- --------
      • -------- Custom UI is optional, but might be good, if you want an special icon or use different Levels. --------
      • -------- beaware that your hero has to have the custom UI or the default UI, ability to be autoregistered by this System. --------
      • Set Talent_GUI_CustomUI = UI Choice (Bloodmage)
      • -------- ---- --------
      • -------- Register this Hero --------
      • Auslöser - Run TalentGUI <gen> (ignoring conditions)
      • -------- ---- --------
      • -------- ---- --------
      • -------- Optional: define autoadded skills for choices, a choice can add multiple Skills. --------
      • -------- ---- --------
      • Set Talent_GUI_Choice = Choice - Flamestrike + Banish (Bloodmage, Level 1)
      • Set Talent_GUI_Choice_SkillGained = Flammenschlag
      • Auslöser - Run Talent_GUI_AddSkill2Choice (ignoring conditions)
      • Set Talent_GUI_Choice_SkillGained = Verbannen
      • Auslöser - Run Talent_GUI_AddSkill2Choice (ignoring conditions)
      • -------- ---- --------
      • -------- ---- --------
      • Set Talent_GUI_Choice = Choice - Manadrain + Warstomp (Bloodmage, Level 1)
      • Set Talent_GUI_Choice_SkillGained = Drain Mana
      • Auslöser - Run Talent_GUI_AddSkill2Choice (ignoring conditions)
      • Set Talent_GUI_Choice_SkillGained = Kriegsdonner
      • Auslöser - Run Talent_GUI_AddSkill2Choice (ignoring conditions)
vs new version:
  • Talent MountainKing Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TalentGUI_UnitType = Bergkönig
      • -------- Create for MountainKing a Tier at Level 1 --------
      • Set TalentGUI_Level = 1
      • Auslöser - Run TalentGUICreateTier (ignoring conditions)
      • -------- Add 1 Choice to the last created Tier --------
      • Auslöser - Run TalentGUICreateChoice (ignoring conditions)
      • -------- Write data to TalentChoiceLast --------
      • Set TalentChoiceHead[TalentChoiceLast] = Axe
      • Set TalentChoiceIcon[TalentChoiceLast] = ReplaceableTextures\CommandButtons\BTNOrcMeleeUpOne.blp
      • Set TalentChoiceText[TalentChoiceLast] = Gain 20 Base-ATK
      • -------- Add 1 further Choice to the last created Tier --------
      • Auslöser - Run TalentGUICreateChoice (ignoring conditions)
      • -------- Make this Choice Add the ability Bash --------
      • Set TalentGUI_Spell = Pulverisieren (Neutral Hostile)
      • Auslöser - Run TalentGUIAddSpell (ignoring conditions)
      • Set TalentChoiceHead[TalentChoiceLast] = Pulversieren
      • Set TalentChoiceIcon[TalentChoiceLast] = (Icon of TalentGUI_Spell)
      • Set TalentChoiceText[TalentChoiceLast] = (Extended Tooltip of TalentGUI_Spell for level 1)
      • -------- Create for MountainKing a Tier at Level 4 --------
      • Set TalentGUI_Level = 4
      • Auslöser - Run TalentGUICreateTier (ignoring conditions)
      • Auslöser - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentChoiceHead[TalentChoiceLast] = Helm
      • Set TalentChoiceIcon[TalentChoiceLast] = ReplaceableTextures\CommandButtons\BTNHelmOfValor.blp
      • Set TalentChoiceText[TalentChoiceLast] = +6 STR|n+6 AGI
      • Auslöser - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentGUI_Spell = Heiltrank (Geringer)
      • Auslöser - Run TalentGUIAddSpell (ignoring conditions)
      • Set TalentChoiceHead[TalentChoiceLast] = Healing Poition
      • Set TalentChoiceIcon[TalentChoiceLast] = (Icon of TalentGUI_Spell)
      • Set TalentChoiceText[TalentChoiceLast] = (Extended Tooltip of TalentGUI_Spell for level 1)
      • -------- Create for MountainKing a Tier at Level 7 --------
      • Set TalentGUI_Level = 7
      • Auslöser - Run TalentGUICreateTier (ignoring conditions)
      • Auslöser - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentChoiceHead[TalentChoiceLast] = Helm
      • Set TalentChoiceIcon[TalentChoiceLast] = ReplaceableTextures\CommandButtons\BTNArmorGolem.blp
      • Set TalentChoiceText[TalentChoiceLast] = +500 Max Life
      • Auslöser - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentChoiceHead[TalentChoiceLast] = ManaStone
      • Set TalentChoiceIcon[TalentChoiceLast] = ReplaceableTextures\CommandButtons\BTNPendantOfMana.blp
      • Set TalentChoiceText[TalentChoiceLast] = +250 Max Mana
      • Auslöser - Run TalentGUICreateChoice (ignoring conditions)
      • Set TalentGUI_Spell = Flammenschlag
      • Set TalentChoiceHead[TalentChoiceLast] = Flamestrike Level 3
      • Set TalentChoiceIcon[TalentChoiceLast] = (Icon of TalentGUI_Spell)
      • Set TalentChoiceText[TalentChoiceLast] = (Extended Tooltip of TalentGUI_Spell for level 3)
      • Auslöser - Run TalentGUIAddSpell (ignoring conditions)
      • -------- AddSpell Again; More Level :) only works when "function TalentIncreaseByDoubleLearning" returns true, default --------
      • Auslöser - Run TalentGUIAddSpell (ignoring conditions)
      • Auslöser - Run TalentGUIAddSpell (ignoring conditions)
      • -------- Talent init for this HeroType is complete --------
      • Auslöser - Run TalentGUI <gen> (ignoring conditions)


Also the jass Hero Talent init functions needs to be adjusted.


old version
JASS:
//Example for using Talent by Tasyen.
function Trig_Talent_Uther_Actions takes nothing returns nothing
   //Which HeroType is this; Custom Uther
   local integer heroTypeId = 'H002'
 
   //hero specific learn Book.
   call SaveInteger( udg_TalentHash, heroTypeId, -1, 'A00J')

   //this are hidden Spellbooks gained, when reaching that level.
   call SaveInteger( udg_TalentHash, heroTypeId, 0, 'A00G')
   call SaveInteger( udg_TalentHash, heroTypeId, 1, 'A00B')
   call SaveInteger( udg_TalentHash, heroTypeId, 2, 'A00C')
   call SaveInteger( udg_TalentHash, heroTypeId, 3, 'A00D')
   call SaveInteger( udg_TalentHash, heroTypeId, 4, 'A00E')
 
   //Mark Level 4 as last choice, after the heroe picks it, the selection skills are removed.
   call SaveBoolean(udg_TalentHash, heroTypeId, 4, true)

   //Optional, you can now define automatic added skills (only use positive numbers starting with 0, no gaps), when picking a choice.
   // In this demo it's quite silly to set the choice skillgained connection twice (uther and paladin have the same afterall, but differ in Level)
   call SaveInteger( udg_TalentHash, 'A002', 0, 'Anhe')
   call SaveInteger( udg_TalentHash, 'A001', 0, 'ACfb')
   call SaveInteger( udg_TalentHash, 'A003', 0, 'ACfs')
   call SaveInteger( udg_TalentHash, 'A004', 0, 'ACfn')
   call SaveInteger( udg_TalentHash, 'A005', 0, 'AChx')
   call SaveInteger( udg_TalentHash, 'A006', 0, 'ACif')
   call SaveInteger( udg_TalentHash, 'A007', 0, 'ACmi')
   call SaveInteger( udg_TalentHash, 'A008', 0, 'Awrs')
endfunction

//===========================================================================
function InitTrig_Talent_Uther takes nothing returns nothing
    set gg_trg_Talent_Uther = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Talent_Paladin, function Trig_Talent_Uther_Actions )
endfunction

new, does not the same as the old
JASS:
function TalentMagicStats takes nothing returns nothing
   call ModifyHeroStat( bj_HEROSTAT_STR, udg_Talent__Unit, bj_MODIFYMETHOD_ADD, 3)
   call ModifyHeroStat( bj_HEROSTAT_AGI, udg_Talent__Unit, bj_MODIFYMETHOD_ADD, 3)
   call ModifyHeroStat( bj_HEROSTAT_INT, udg_Talent__Unit, bj_MODIFYMETHOD_ADD, 3)
   call ModifyHeroStat( udg_StatType[udg_Talent__Choice], udg_Talent__Unit, bj_MODIFYMETHOD_ADD, udg_StatPower[udg_Talent__Choice] )
endfunction
function TalentMagicStatsReset takes nothing returns nothing
   call ModifyHeroStat( bj_HEROSTAT_STR, udg_Talent__Unit, bj_MODIFYMETHOD_ADD, -3)
   call ModifyHeroStat( bj_HEROSTAT_AGI, udg_Talent__Unit, bj_MODIFYMETHOD_ADD, -3)
   call ModifyHeroStat( bj_HEROSTAT_INT, udg_Talent__Unit, bj_MODIFYMETHOD_ADD, -3)
   call ModifyHeroStat( udg_StatType[udg_Talent__Choice], udg_Talent__Unit, bj_MODIFYMETHOD_ADD, -udg_StatPower[udg_Talent__Choice] )
endfunction


//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 SaveInteger( udg_TalentHash, heroTypeId, -1, 'A00N')   //BloodMage Talent-Book

   call SaveInteger(udg_TalentHash, heroTypeId, 0, TalentTierCreate())   //Create a Tier for Level 0 for BloodMage


   set choice = TalentChoiceCreateEx(null, null)   // Create a Choice and add it to the last Created Tier
   set udg_TalentChoiceText[choice] = "Learn Firebolt, Breath of Fire and Flamestrike"
   set udg_TalentChoiceHead[choice] = "Fire Magic"
   set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNFire.blp"
   call TalentChoiceAddAbility(choice, 'AHfs')   //Add an ability to this Choice, it will be added/Improved
   call TalentChoiceAddAbility(choice, 'ANbf')   //2.Ability
   call TalentChoiceAddAbility(choice, 'ANfb')   //3.Ability
 
   set choice = TalentChoiceCreateEx(null , null)
   set udg_TalentChoiceText[choice] = "Learn Chaing Lighnting, Moonsoun and Foked Lightning"
   set udg_TalentChoiceHead[choice] = "Lightning Magic"
   set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNMonsoon.blp"
   call TalentChoiceAddAbility(choice, 'ANfl')
   call TalentChoiceAddAbility(choice, 'AOcl')
   call TalentChoiceAddAbility(choice, 'ANmo')

   //LEVEL 5
   call SaveInteger(udg_TalentHash, heroTypeId, 5, TalentTierCreate())
   set choice = TalentChoiceCreateEx(function TalentMagicStats, function TalentMagicStatsReset)   //This Choice will execute TalentMagicStats onLearn and execute TalentMagicStatsReset onReset
   set udg_TalentChoiceText[choice] = "Str +6\nAgi +3\nInt+3"
   set udg_TalentChoiceHead[choice] = "Magic Power: Str"
   set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNHelmOfValor.blp"
   set udg_StatType[choice] = bj_HEROSTAT_STR   //Save Custom Data onto ArrayIndex choice
   set udg_StatPower[choice] = 3           //Save Custom Data onto ArrayIndex choice

   set choice = TalentChoiceCreateEx(function TalentMagicStats, function TalentMagicStatsReset)
   set udg_TalentChoiceText[choice] = "Str +3\nAgi +6\nInt+3"
   set udg_TalentChoiceHead[choice] = "Magic Power: AGI"
   set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNHoodOfCunning.blp"
   set udg_StatType[choice] = bj_HEROSTAT_AGI
   set udg_StatPower[choice] = 3

   set choice = TalentChoiceCreateEx(function TalentMagicStats, function TalentMagicStatsReset)
   set udg_TalentChoiceText[choice] = "Str +3\nAgi +3\nInt+6"
   set udg_TalentChoiceHead[choice] = "Magic Power: Int"
   set udg_TalentChoiceIcon[choice] = "ReplaceableTextures\\CommandButtons\\BTNPipeOfInsight.blp"
   set udg_StatType[choice] = bj_HEROSTAT_INT
   set udg_StatPower[choice] = 3
 
   //Level 10
   call SaveInteger(udg_TalentHash, heroTypeId, 10, TalentTierCreate())

   set choice = TalentChoiceCreateEx(null, null)
   set abilityId = 'AHpx'
   call TalentChoiceAddAbility(choice, abilityId)
   set udg_TalentChoiceText[choice] = BlzGetAbilityExtendedTooltip(abilityId,1)
   set udg_TalentChoiceHead[choice] = BlzGetAbilityTooltip(abilityId,1)
   set udg_TalentChoiceIcon[choice] = BlzGetAbilityIcon(abilityId)

   set choice = TalentChoiceCreateEx(null, null)
   set abilityId = 'AUin'
   call TalentChoiceAddAbility(choice, abilityId)
   set udg_TalentChoiceText[choice] = BlzGetAbilityExtendedTooltip(abilityId,1)
   set udg_TalentChoiceHead[choice] = BlzGetAbilityTooltip(abilityId,1)
   set udg_TalentChoiceIcon[choice] = BlzGetAbilityIcon(abilityId)

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

//===========================================================================
function InitTrig_Talent_BloodMag takes nothing returns nothing
    set gg_trg_Talent_BloodMag = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Talent_BloodMag, function TalentBloodMage )
endfunction


For some reasons talent 1.30 crashes on map Load, this was fixed by renaming/moving the file. No joke.


Does Talentv1.30 miss some feature what is your opinion?

Can it replace the old Talent or keep the old on hive?

Changelog:
1.30.07:
One can now replace an ability by an new one when doing an choices.
Added some premade Choice Generation functions, locatated in "TalentPreMadeChoice".​
1.30.06: TalentControl uses no dialog anymore.
1.30.05 tiers are now inside the hash. Added 2 imported TextFiles to make generate custom GUI Actions simple: "Talent.ini" = Guisator, "Talent GUI.txt" copy paste for TriggerData/Strings
Uploaded 1.30.03 with more documentation, more definitions and added Talent Control code to this post (it already was inside the map but it is more of an optional addon).​
 

Attachments

  • Talent V1.30.07.w3x
    82.1 KB · Views: 56
Last edited:
Status
Not open for further replies.
Top