[Tutorials] Custom Units - Bases | Dota 2 Workshop Tool

*Create your own customized NPC *Change the model of your NPC *Add wearables to your NPC *Add passive spells to your NPC *Make your NPC cast spells *Add him into your own map!
First, let's make take the basic script : http://pastebin.com/0ydxv4xy

Now, let's analyze the lines one by one :

  • "npc_dota_npc_base" This can be changed by whatever you want. Just make sure that you don't add spaces.
  • "Model" This is the model your NPC will be using. You can retreive a full list of the models in the Assets Browser of the Dota 2 Workshop Tools Asset Browser.
  • "BaseClass" This tells how the NPC should work, by linking it to a base entity. If it's a "npc_dota_creature", he will be able to track down the players until they die. If it's a "npc_dota_tower", it will not move, but will still shoot. If it's a "npc_dota_building", it will do nothing.
Here's a full list of the BaseClass's : npc_dota_fort, npc_dota_creep_siege, ent_dota_fountain, npc_dota_base_additive, npc_dota_tusk_frozen_sigil,npc_dota_elder_titan_ancestral_spirit npc_dota_creep_neutral, npc_dota_creep, npc_dota_ward_base, npc_dota_ward_base_truesight, npc_dota_courier, npc_dota_flying_courier, npc_dota_witch_doctor_death_ward, npc_dota_shadowshaman_serpentward, npc_dota_venomancer_plagueward, npc_dota_invoker_forged_spirit, npc_dota_broodmother_spiderling, npc_dota_roshan, npc_dota_roshan_halloween, ent_dota_radiant_candybucket, npc_dota_warlock_golem, npc_dota_beastmaster_hawk, npc_dota_beastmaster_boar, npc_dota_brewmaster_earth, npc_dota_brewmaster_storm, npc_dota_brewmaster_fire, npc_dota_unit_undying_tombstone, npc_dota_unit_undying_zombie, npc_dota_rattletrap_cog, npc_dota_broodmother_web, npc_dota_earth_spirit_stone, npc_dota_base,
  • "SoundSet" The sounds the NPC will be using for attacking, walking... It can be for example, "n_creep_Ranged" or "n_creep_Melee".
  • "GameSoundsFile" The overall sounds the NPC will be using. I did not experience with that yet.
  • "Level" Sets the level of your NPC. Can be a value over 25.
  • "ModelScale" The size of your NPC. You can make him incredibly big, or just really tiny.
  • "Ability1" , "Ability2" ... Gives to your NPC the abilites you want. Here's a full list of the abilities : http://pastebin.com/D6C1mji6
  • "ArmorPhysical" Gives to your NPC the specified armor, to make him more resistant.
  • "AttackCapabilities" Tells if your NPC is a ranged or melee creature. "DOTA_UNIT_CAP_RANGED_ATTACK" or "DOTA_UNIT_CAP_MELEE_ATTACK" are used in that case. Or, you can use "DOTA_UNIT_CAP_NO_ATTACK", if you don't want your NPC to fight.
  • "AttackDamageMin" , "AttackDamageMax" The minimum and maximum damage your NPC can deal.
  • "AttackRate" The basic attack speed of your NPC. The lesser it is, the faster he hits.
  • "AttackAnimationPoint" According to official documentation : "Normalized time in animation cycle to attack."
  • "AttackAcquisitionRange" From where your NPC can spot a hero, or a potential target.
  • "AttackRange" The range of your NPC. It will be able to shoot you from a great distance if you increase the value. But it is recommended, if you are making a melee NPC, to put this value to "100".
  • "ProjectileModel" Gives to the projectile, if it's a ranged NPC, a custom particle. I don't have the list here, but if you're making a Melee NPC, you should leave that blank.
  • "ProjectileSpeed" How fast must the projectile hit the target ?
  • "RingRadius" No clue what this does.
  • "HealthBarOffset" Tells how far from the NPC his health bar should be. Useful for really big NPCs.
  • "BountyXP" The ammount of experience the Killer of the NPC earns on his death.
  • "BountyGoldMin" , "BountyGoldMax" The minimum and maximum ammount of gold the Killer should receive on the NPC's death.
  • "MovementCapabilities" This is used if you're NPC is a running, flying unit. It's running, keep the DOTA_UNIT_CAP_MOVE_GROUND. Otherwise, here's a short list of the others MovementCapabilities :
    • DOTA_UNIT_CAP_MOVE_NONE
    • DOTA_UNIT_CAP_MOVE_FLY
  • "MovementSpeed" How fast or how slow the NPC should go.
  • "StatusHealth" The base health of the NPC.
  • "StatusHealthRegen" How much should the NPC regenerate per second ?
  • "StatusMana" Base mana of the NPC.
  • "StatusManaRegen" How much mana should the NPC get per second?
  • "Creature" Here's where you should stock info, like how much your NPC should gain strenght, HP, or Movement speed at each level. This is also where we will put the script if we want our NPC to have wearables and/or fired spells.

Wearables !

To add a wearable to your NPC, go under the "Creature" tab, at the end of NPC script. There, add this bit of code : http://pastebin.com/GzmXKBpG

"ItemDef" Which item should we apply to the NPC ? A full list of the ItemDef's, can be found in your items_game.txt. To get this file, download GCFScape, then go to your Dota folder, and open pak01_dir.vpk with GCFScape. Go to your scripts > items folder then, extract the items_games.txt.

Casting Spells !

If you want your NPC to fire a special spell, you must first add the name of the ability in the "Ability1", "Ability2" part. We'll be using Lion Impale here, whose name is lion_impale. Then, add, still under "Creature", this chunk : http://pastebin.com/avXRPFv0 . Here's the full code for my NPC : http://pastebin.com/R7EzWimP

Adding your NPC to your map

For that, place a npc_dota_base in your map. Go into his properties, then change the Entity spawned! If you added wearables, and you don't seem them in the editor, it's normal. They'll be here in-game.

My NPC doesn't appear on the list !

Rebooting the Dota 2 Workshop Tools should fix that.

Tutorials by Mrmitoo at Reddit

Post a Comment

Powered by Blogger.