The title is currently a little misleading since we wont be making a new Dota 2 custom map/addon, but simply changing around in the Frostivus files to begin with. When and if Valve adds actual custom map support the name will hopefully be more correct.
I first wrote a guide on r/dota2 called "How to make Dota 2 addons", but since I plan to make a couple of different tutorials it will be easier to write it on TL. I also think that more people here are interested in programming and what we might be able to do with custom maps for Dota 2.
I will update this thread when I release more guides, so that when people who are interested in making custom maps have a good place to start. I am no pro in how Dota 2 is built or how to write in Lua, but what I write here is what I have learnt just playing around. So this will not be a place where you can learn how to make a new Dota inside Dota 2, but rather how to get started.
If anyone have something they want to add or change please just write it in the comments and we can create the best thread for making Dota 2 custom maps together.
Other resources
+ Show Spoiler +
https://developer.valvesoftware.com/wiki/Dota_2_Addon_Portal, a portal with a lot of useful information.
https://gist.github.com/RoyAwesome/8019417
http://www.twitch.tv/koreansgrind/c/3493251 Video of `z-machine's pudge wars map (WIP).
http://i.imgur.com/P9pX3MN.jpg Ash47's work with custom UI and spell picking.
Getting Started
+ Show Spoiler +
For now, we will get started by modifying the Frostivus files. If it seems familiar, it is because it is a repost from my r/dota2 guide, i hope this is okay. This guide is just a very breif introduction to where the files are located, and some examples on how we can modify the code.
Language
Frostivus is scripted in language called Lua. Lua can be modified in any test editor, but I have been using a Eclipse IDE called Koneki.
Location
The Frostivus files are located in [Path\To\Steam\steamapps\common\dota 2 beta\dota\addons\frostivus], usually [C:\Program Files (x86)\Steam\steamapps\common\dota 2 beta\dota\addons\frostivus].
Lets get started
Under [\frostivus\scripts\vscripts] you will find a bunch of Lua scripts. We will play around in the file called "frostivus.lua". This is where the main logic resides for the addon.
You will find a bunch of initializing in the beginning of the script, but we will jump past that for now.
We will change something very small, however it will help us a lot when trying to solo the hold out mode.
In the function called "FrostivusGameMode:OnNPCSpawned( keys )", located on the line ~499 there is a if statement that goes:
if spawnedUnit:IsCreature() then
spawnedUnit:SetHPGain( spawnedUnit:GetMaxHealth() * 0.3 )
spawnedUnit:SetHPGain( spawnedUnit:GetMaxHealth() * 0.3 )
What we will do to survive more easily is to change every unit that spawns health to 1. This is done by calling the function "SetMaxHealth( 1 )" for a spawned unit. We will do this just after the if statement so that it now reads:
if spawnedUnit:IsCreature() then
spawnedUnit:SetMaxHealth( 1 )
spawnedUnit:SetHPGain( spawnedUnit:GetMaxHealth() * 0.3 )
spawnedUnit:SetMaxHealth( 1 )
spawnedUnit:SetHPGain( spawnedUnit:GetMaxHealth() * 0.3 )
And thats it! Congratulations, you have now changed your very first Dota 2 addon. Lets make another change so that we dont have to wait so long for the creeps to start spawning.
In the function called "FrostivusGameMode:InitGameMode()" on line ~93 there is a bunch of initialization, but we will scroll down to the line ~158 that reads:
GameRules:SetPreGameTime( 60.0 )
and then simply change the argument to 10.0:
GameRules:SetPreGameTime( 10.0 )
Loading the map in the Dota 2 client
Now to load this awesome personal addon we will simply open up the console in the Dota 2 client and write:
sv_cheats 1;update_addon_paths;dota_local_custom_difficulty 1;dota_local_custom_enable 1;dota_local_custom_game frostivus;dota_local_custom_map frostivus;dota_force_gamemode 15;map frostivus.bsp
you can copy and paste it directly into the console as one line. This will load the map and start your own custom map.
Changing hero abilities
+ Show Spoiler +
This guide will go over how to change the abilities for a hero by changing the files that are associated with a custom map.
The files that we are gonna changes now is under [\frostivus\scripts\npc]. We are gonna change "herolist","npc_abilities_custom", and "npc_heroes_custom". What we are gonna do is to change Pudges meat hook ability. If you have ever played Frostivus you know that Pudge cant be played in that mode, so to begin we will have to add him to the herolist. To do this, just open "herolist" and add
"npc_dota_hero_pudge" "1"
anywhere inside the brackets for "CustomHeroList", preferably on its own row below the last hero name.
Once this is done we can begin to change his abilities. First we will open up "npc_hero_custom" and point pudges meat hook ability to our own custom one (that we will create right after this). Right after the bracket for "DOTAHeroes" write the following:
//=================================================================================================================
// HERO: Pudge
//=================================================================================================================
"npc_dota_hero_pudge_holdout"
{
"override_hero" "npc_dota_hero_pudge"
"Ability1" "pudge_meat_hook_holdout" // Ability 1
"VisionNighttimeRange" "1800" // Range of vision at night time.
}
// HERO: Pudge
//=================================================================================================================
"npc_dota_hero_pudge_holdout"
{
"override_hero" "npc_dota_hero_pudge"
"Ability1" "pudge_meat_hook_holdout" // Ability 1
"VisionNighttimeRange" "1800" // Range of vision at night time.
}
This will let the game know that we want to override pudge's first ability with our custom one "pudge_meat_hook_holdout". The "VisionNighttimeRange" is set on every hero in frostivus so we will just also add that.
Now lets create the custom ability. Open up "npc_abilities_custom", and anywhere inside the brackets below the "Version" "1" write the following:
//=================================================================================================================
// Holdout: Hook
//=================================================================================================================
"pudge_meat_hook_holdout"
{
// General
//-------------------------------------------------------------------------------------------------------------
"BaseClass" "pudge_meat_hook"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_POINT"
"AbilityUnitDamageType" "DAMAGE_TYPE_PURE"
// Casting
//-------------------------------------------------------------------------------------------------------------
"AbilityCastRange" "1300 1300 1300 1300"
"AbilityCastPoint" "0.3 0.3 0.3 0.3"
// Time
//-------------------------------------------------------------------------------------------------------------
"AbilityCooldown" "2.0 2.0 2.0 2.0"
// Damage.
//-------------------------------------------------------------------------------------------------------------
"AbilityDamage" "500 500 500 500"
// Cost
//-------------------------------------------------------------------------------------------------------------
"AbilityManaCost" "20 20 20 20"
// Special
//-------------------------------------------------------------------------------------------------------------
"AbilitySpecial"
{
"01"
{
"var_type" "FIELD_FLOAT"
"hook_speed" "2500.0"
}
"02"
{
"var_type" "FIELD_INTEGER"
"hook_width" "500"
}
"03"
{
"var_type" "FIELD_INTEGER"
"hook_distance" "1300 1300 1300 1300"
}
"04"
{
"var_type" "FIELD_INTEGER"
"vision_radius" "500 500 500 500"
}
"05"
{
"var_type" "FIELD_FLOAT"
"vision_duration" "4.0 4.0 4.0 4.0"
}
}
}
It is important that the name above the bracket, "pudge_meat_hook_holdout", is the same as the name we wrote in "npc_heroes_custom". A lot of stuff is going on here, but most names are self explanatory so i will not go through them all. But to summarize this will give meat hook some of the following attributes:
- The cast range will always be 13000
- The cool down will always be 2 seconds
- It will always to 500 pure damage
- It will always cost 20 mana
- The vision raduis will always be 500
- etc
I found out what to write for this ability by downloading the files listed here (by IceFrog himself), so that I could find the template for pudge's abilities (in "npc_abilities"). In that file we can also find out that "DOTA_ABILITY_BEHAVIOR_POINT" means that "Ability can be cast anywhere the mouse cursor is (If a unit is clicked it will just be cast where the unit was standing)"
When all this is done, you can load the map thorugh the console (see "Getting started" for the commands), and you will now be able to pick Pudge with your very own custom ability.
Now if you have loaded the game and picked pudge you will notice that the hook ability lacks any description. So lets create our own customized description also. Under [frostivus\resource] there is a bunch of files name "frostivus_languageX". Open the file with the language that your Dota is using. Add the following inside the "tokens" brackets:
"DOTA_Tooltip_ability_pudge_meat_hook_holdout" "Meat Hook"
"DOTA_Tooltip_ability_pudge_meat_hook_holdout_Description" "Throws a hook greater than the frog himself."
"DOTA_Tooltip_ability_pudge_meat_hook_holdout_Lore" "Some say he first started throwing his hook when the Queen of Pain first blinked away."
"DOTA_Tooltip_ability_pudge_meat_hook_holdout_damage" "Damage:"
"DOTA_Tooltip_ability_pudge_meat_hook_holdout_Description" "Throws a hook greater than the frog himself."
"DOTA_Tooltip_ability_pudge_meat_hook_holdout_Lore" "Some say he first started throwing his hook when the Queen of Pain first blinked away."
"DOTA_Tooltip_ability_pudge_meat_hook_holdout_damage" "Damage:"
this will make the description look like this in game:
![[image loading]](http://i.imgur.com/lRsl0HX.png)