[Alpha] Talent Manager

edited June 17 in Projects

enter image description here

Talent Manager

Note: This resource is currently in alpha stages. Be prepared to encounter bugs and support development if you plan on using this program in its current state

What is it?

Talent Manager is a resource to allow custom game developers to create their own talents for custom heroes as well as modifying the abilities

Example code @ Usages

The following talent code produces the talent tree in the header image


"npc_dota_hero_antimage" { "override_hero" "npc_dota_hero_antimage" "TalentLevels" "10 20 30 40" "Talents" { "1" { "left" { "name" "ms" "MODIFIER_PROPERTY_MOVESPEED_BONUS_CONSTANT" "20" } "right" { "name" "dmg" "MODIFIER_PROPERTY_PREATTACK_BONUS_DAMAGE" "15" } } "2" { "left" { "name" "as" "MODIFIER_PROPERTY_ATTACKSPEED_BONUS_CONSTANT" "30" } "right" { "name" "blink_cd_reduce" "Ability" "special_bonus_blink" "v" "2" } } "3" { "left" { "name" "armor" "MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS" "5" } "right" { "name" "mana" "MODIFIER_PROPERTY_MANA_BONUS" "300" } } "4" { "left" { "name" "dummy_for_lua_use" } "right" { "name" "mana_regen" "MODIFIER_PROPERTY_MANA_REGEN_CONSTANT" "25" } } } }

Changing the default values: edit the file game/scripts/npc/npc_talents.txt

  1. Changing the default talent levels: Change the value of "DefaultTalentLevels" "10 20 30 40" to whatever you want the 4 levels to be (space seperated). Note: This will apply for ALL heroes. If you want to do this for only a hero use the example above (hero specific takes precedence over global
  2. Changing the default talents: Change the value of DefaultTalentSet in the file posted to reflect a talent set as shown above. Note that this will override ALL default talents but will not override custom assigned talents. Default talents and custom talent sets can combine (custom talents will take precedence)
  3. Making a talent set- I don't think I've actually implemented this yet

Note

Localization-

Talent names can be localized as "talent_" .. (the talent name)
If you insert a {} in your localization, it will be replaced by the value of any modifier property OR the "v" key

Installation Instructions

  1. Copy all of the content and gamefiles from here and place them into the same corresponding directories into your mod
  2. Add "require('talents/talents')" wherever your other requires are
  3. Add <CustomUIElement type="Hud" layoutfile="file://{resources}/layout/custom_game/talent_manager/talent_manager.xml" /> to your custom_ui_manifest.xml
  4. Add "Talents.OnUnitCreate(hero)" in your OnHeroInGame event listener
  5. Add "talent_manager" to your nettables

Known Bugs

  1. The "progression bar" (vertical exp bar) still correlates to level 25
  2. The roar sounds still play at 10/15/20/25
  3. The old talents aren't actually removed yet
  4. Illusions don't benefit from the talents in any way
  5. Sometimes the hotkey for bringing up the talent tree becomes unresponsive

Future Plans

  1. Allow talents below level 10
  2. Allow more/less than four talents
  3. Create a LUA API for managing talents (currently the only LUA api function is unit:HasTalent(talentName)
  4. Allow "Talent Sets" for custom heroes

Request Support / Report a bug / give feedback

All of the above is appreciated in this thread or in the discord.

Update log

Changelog version A

  1. Fixed unit:HasTalent
  2. Added "Default Talent Set": every hero without an assigned talent tree will be given this (if left null than heroes will keep dota-defined)
  3. Added "Default talent levels" to apply to all heroes if they don't have a defined talent level list
  4. All heroes passed into OnUnitCreate are automatically given a custom talent tree even if it's derived from the DotA talent tree
  5. The system now allows multiple copies of the same hero
  6. Abilities added will automatically be leveled
  7. Default talents can now be replaced- simply define only the talents in the talent set that u want to replace and it will fill the holes with the default tree

Files Affected

talent_manager.js talent.lua

Changelog version B

  1. Fixed a bug where a nil first() would crash the system

Files Affected:

talent.lua

Changelog version C

  1. The system now overrides your talent open hotkey and the 1/2 hotkeys of the talent menu
  2. Fixed some bugs where the last talent would level properly but wouldn't get reflected in the UI
  3. Fixed a bug where selecting an illusion or other unit with no talent table would break the system

Files affected: talent_manager.js

Changelog version C.2

  1. Fixed the issues with Slitbreake

Files affected: talent_manager.js

MAKE CUSTOM GAMES GREAT AGAIN

Finished-
kv checker - https://arhowk.github.io
panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

My pet project This Cursed World/Crestfallen (name pending)
https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

Comments

  • Posts: 835

    Since I see no evidence of this actually being used anywhere I'm delaying further updates to prioritize other things.

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • Posts: 290

    any possibility to import the default talents but just rescale the levels?

  • edited January 9 Posts: 24

    I think you need add in Installation walkthrough like that: "Add this "talent_manager" in file custom_net_tables.txt".

    P.S. Please dont stop working on this project, i like it!

    And last thing, you can pull this talents in hero pick menu?

  • Posts: 835

    Changelog version A

    1. Fixed unit:HasTalent
    2. Added "Talent Sets" : multiple heroes can share the same set of talents
    3. Added "Default Talent Set": every hero without an assigned talent tree will be given this (if left null than heroes will keep dota-defined)
    4. Added "Default talent levels" to apply to all heroes if they don't have a defined talent level list
    5. All heroes passed into OnUnitCreate are automatically given a custom talent tree even if it's derived from the DotA talent tree
    6. The system now allows multiple copies of the same hero
    7. Abilities added will automatically be leveled
    8. Default talents can now be replaced- simply define only the talents in the talent set that u want to replace and it will fill the holes with the default tree

    Files Affected

    1. talent_manager.js
    2. talent.lua

    @ShadowMiner good call on the nettable. added that

    If I can find some way to get panorama into the hero selection than yeah. I'll look into it. May be a project for the future though.

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • Posts: 290

    you can inject panorama into the heroselection root quite easily, check the bugtracker if you decide to work on that

  • edited January 10 Posts: 24

    Very thanks for default tree, but you can fix bug with same modifiers in talent tree, its do not become upgraded, make like this: "if same modifier then remove prev modifier and add new modifier"? and it not permitted after death. (sorry my eng, im from rus)

    And this, its bug or my game problem?

    [   Developer              ]: scripts/vscripts/talents/talents.lua:157: attempt to perform arithmetic on local 'first' (a nil value)
    [   Developer              ]: stack traceback:
    [   Developer              ]:   scripts/vscripts/talents/talents.lua:157: in function 'OnUnitCreate'
    [   Developer              ]:   scripts/vscripts/events.lua:338: in function <scripts/vscripts/events.lua:322>
    [ W VScript                ]: Script Runtime Error: scripts/vscripts/talents/talents.lua:157: attempt to perform arithmetic on local 'first' (a nil value)
    [ W VScript                ]: stack traceback:
    [ W VScript                ]:   scripts/vscripts/talents/talents.lua:157: in function 'OnUnitCreate'
    [ W VScript                ]:   scripts/vscripts/events.lua:338: in function <scripts/vscripts/events.lua:322>
    

    On pick hero event i add "Talents.OnUnitCreate(hero) --Add a talents to hero". This bug will come after i install upd.

  • edited January 10 Posts: 835

    : "if same modifier then remove prev modifier and add new modifier"?

    To understand this I would like to rephrase it- You are saying that your heroes already have modifiers named similar to what the talents are using as modifier names and you want the system to remove the old modifiers that you have assigned to replace them with it's modifiers?

    it not permitted after death. (

    I'm sorry? Modifiers are declared with IsPermanent. I can check real fast if they expire on death but they should.

    EDIT: Again I'm sorry but modifiers both persist through death and can be skilled after a death, I do not know what you are trying to say here. (I'm sure you have a legitimate issue I just can't fully understand what you are trying to say. If you come on the IRC DoctorGester speaks russian and english fluently so he may be able to help)

    And this, its bug or my game problem?

    Right. I just looked at this and it seems that this will occur if your hero had no talents to begin with or you removed them previously. Is this correct?

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • edited January 11 Posts: 24

    Right. I just looked at this and it seems that this will occur if your hero had no talents to begin with or you removed them previously. Is this correct?

    Hm, in first update all talents still work good, idk but it works without setted talents in skills. In second version it dont work. You can see it in my gm (first version installed).

    To understand this I would like to rephrase it- You are saying that your heroes already have modifiers named similar to what the talents are using as modifier names and you want the system to remove the old modifiers that you have assigned to replace them with it's modifiers?

    Yes.

  • Posts: 835

    Yes.

    So, I'll add in a patch for this but I don't know how well this is going to work because I don't know if I can create a new modifier with the same name as an old one. Alternate solution- In the next patch (couple hours) I'll make some sort of OnTalentLearned event that you can listen to if that helps (if you're intentionally naming the modifiers so that they can be removed when you apply the talent)

    Hm, in first update all talents still work good, idk but it works without setted talents in skills. In second version it dont work. You can see it in my gm (first version installed).

    Yeah I'm aware I just wanted to confirm that that was the issue so I'm resolving the correct issue. It will be fixed in next update.

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • So, I'll add in a patch for this but I don't know how well this is going to work because I don't know if I can create a new modifier with the same name as an old one.

    I think you can make modifier with same name with number, if caster already has modifier with this name without "_2" you can set this name "modifier_health_2", yes?

  • Posts: 835

    I updated a bug to fix the script error you were having.

    Note that the talent modifiers are actually named

    unit:GetUnitName() .. "talent" .. talentName

    If you're modifier name is matching this than your code is mega messed up.

    If you want functionality like the talent learning removes something on the unit than you can accomplish that with a listener that I'll add shortly.

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • Now it cannot find local talentSet. on 169 line.

  • edited January 16 Posts: 835

    https://github.com/Arhowk/TalentManager/commit/850e4ebd20a0788c50e7b03cc3acd0bf299cbf9b

    I'm sorry I'm away so I just had to update it in the git client

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • Posts: 835

    B.2

    Default talent SET and default talents now merge properly (default talent set takes priority)

    added some more usage documentation to the main post

    files affected: the talents.lua file

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • Posts: 835

    disclaimer: i need to see if it still works with the ui update

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • I can't use it without standard talents bound on hero.

  • Posts: 835

    right, atm it doesn't work at all because of the hotkeys. i need to do alot of work to get it working again

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • Wow, its work. sorry my prev comment.

  • Posts: 835

    I think update C should make this system functional again. Let me know if there are any pressing issues other than the ones I listed

    @Shadowminer

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • Posts: 95

    Such a nice work, @Arhowk !

  • Posts: 835

    There are some weird bugs when interacting with talent manager-heroes and non-talent manager heroes that I discovered when testing this, but for now I pushed out a patch to fix the issues with the slitbreaker patch

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • So, as i think, now talents names it's impossible to see and unclickable, but hotkeys works good and give talents bonuses. If you work on it yet pls fix it.

  • Talents work as passive (hidden) abilities that apply an appropriate modifier. Eg choosing a +10str talent unlocks an ability that applies a permanent hidden +10str modifier (I just tested it, you can easily get the names with FindAllModifiers and GetName). Now, couldn´t you make your own talents by giving each hero a passive hidden ability that periodically checks the modifiers on the hero and if it finds a "talent modifier" it simply applies a talent modifier of your choice and removes the old ability? That would not change the talent descriptions. Can you access them via the "addon_english" file (the one that´s responsible for all other descriptions)?

  • edited September 16 Posts: 15

    Ok, I played a bit with this. Checking for Talents by looking for their modifiers is not good, because special (ability upgrading) talents don´t seem to use modifiers. So you have to check, if the talent ability has been leveled up. Then simply set it´s level back to zero (DONT REMOVE THE ABILITY, it screws up the talent tree), remove it´s modifier if it applied any and add a talent modifier of your choice. Seems to work just fine. I don´t know how special talents work, but I suppose it´s easiest to add an empty modifier and make the ability it modifies change it´s behavior if the modifier is present. Talent descriptions are simply the names of the abilities responsible for them, so they can be accessed via "addon_english" (or whatever language). Eg. for changing the description for svens +6str talent you would use

    "DOTA_Tooltip_ability_special_bonus_strength_6" "description of your talent"

    The naming conventions are pretty simple, otherwise it ain´t too hard to find the names manually.

  • Posts: 835

    So, as i think, now talents names it's impossible to see and unclickable, but hotkeys works good and give talents bonuses. If you work on it yet pls fix it.

    I'd just recommend using the normal talent changing system at this point, I don't think this system is maintainable (plus all the rumours that new patch will add another talent)

    Talents work as passive (hidden) abilities that apply an appropriate modifier. Eg choosing a +10str talent unlocks an ability that applies a permanent hidden +10str modifier (I just tested it, you can easily get the names with FindAllModifiers and GetName). Now, couldn´t you make your own talents by giving each hero a passive hidden ability that periodically checks the modifiers on the hero and if it finds a "talent modifier" it simply applies a talent modifier of your choice and removes the old ability? That would not change the talent descriptions. Can you access them via the "addon_english" file (the one that´s responsible for all other descriptions)?

    You just add an ability to the Abilityx slot as it is a normal ability, check how ebf does ti

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest