[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



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:


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


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)