|Sep 26, 2013, 02:15 AM||#1|
Join Date: Mar 2012
How to add Hero Units in Your MOD
This tutorial explains how to add Hero units in your MOD of new Civilizations or Wonders, by extending the Heroes of Might and Wisdom MOD. Heroes can be added by providing a simple XML file, text keys and portraits. New Ability or Hero Trait can also be added with more efforts. And by override LUA CallBack function, complex feature can be implemented.
You should be familiar with basic Modding tools : XML and ModBuddy.
More complex feature requires the knowledge of LUA.
About the Heroes of Might and Wisdom MOD
This MOD add Heroes units to Civilization V, they can learn Talents instead of promotions, discover Artifacts, use Skills/Spells/Auras/Adventures Abilities. Find the details here:
Besides these features, this MOD is designed to be able to work with other MODs. With well defined XML tables, other MOD of new Civilizations or Wonders can add Heroes in their MOD with litter efforts. Add a dependency or reference to this MOD, write simple XML files and provide text string and art, your new Hero will be ready. You can also add new Hero Traits or even new Abilities without writting LUA code.
Download the MOD and play it for a while to get yourself familiar with it.
Example MOD - Heroes of Starcraft
I create an exmpale MOD to show hwo to add your Heroes. download it here:
This mod add 3 civilizations and 1 wonder, totally 10 Heroes Units.
Terran : Jim Raynor, Ariel Hanson, Horace Warfield
Zerg : Sarah Kerrigan, Izsha, Abathur
Protoss : Zeratul, Selendis, Tassadar
Korhal Palace ( Wonder ) : Nova
Start with the first Hero
Now let's start with Kerrigan.
First, copy XML\Heroes\HeroTemplate.xml from Heroes of Starcraft MOD folder to your MOD folder, and rename the file with your Hero's name.
The <Type> tag is used as a string key to index the table.
The <Description>, <Civilopedia> and <Help> as you may expect, are the text keys for your Hero. <Description> is the name key, <Civilopedia> is the history info of this Hero, you need to provide these text keys. <Help> is the help info, your can provide your own, or use the default ones for each Hero Class.
The <PortraitIndex> and <IconAtlas> are the portrait picture for the Heroes, provide your altas in the following sizes:
256, 128, 80, 64, 45, 32
The <Civilization> and <Wonder> are how to unlock the Hero. For a national Hero, use the <Civilization> tag, for wonder Hero, use <Wonder> tag.
<TalentClass> define the start talent pillar of the Hero, the Hero's Class can be also infered from the start pillar.
Set <Female> to true for female Hero, otherwise, you can delete the line for the dafault value is false.
<HeroTraitType> is a special Hero Trait for your Hero, you may delete this line, then your Hero will get a random trait in every game. Or you can sepcify one yourself.
Take a look at the comments, there are 7 steps to create your hero.
1. First, give a name tag and replace the %HERONAME% tag. Notice the <Type> entry of Heroes table is an Unique key, so your Hero's name should not be the same as existing ones defined in:
Heroes of Might and Wisdom (v i)\XML\Heroes\Civ5Heores.xml
So, use a longer name tag, a prefix of your MOD name is preferred. For Kerrigan, we use "STARCRAFT_SARAH_KERRIGAN" to replace "%HERONAME%", the result should look like this:
2. Give her a start talent. The start talent will determine the class of Hero. Here we use "AGILITY", so she will be a Ranger. Relace "%START_TALENT%" with "AGILITY", the result is:
3. Kerrigan is female, so do nothing here.
4. We use random trait for now, and delete the line, it looks like this:
5. We delete the <Wonder> line, and change the %CIV% to "CIVILIZATION_ZERG":
6. We change "%PORTRAITINDEX%" to "1" and "%ICONATLAS%" to "STARCRAFT_COLOR_ATLAS", which we defined in resource file Art\StarcraftAtlas.xml:
7. All done for the xml file, then add an entry to OnModActivted/UpdateDatabase of your new Hero xml file. And add a dependency or reference to this MOD:
The difference between a dependency and a reference is, for dependency, the Heroes mod is required and must be actived; for reference, user can choose to active the heroes mod or not, if not, they can play normal game without the heroes; or they can active the Heroes mod and play a game with Heroes. You can decide to use a dependency or reference yourself.
Start the game to test your Hero.
Last edited by epicss; Nov 14, 2013 at 06:30 PM.
|Sep 26, 2013, 02:17 AM||#2|
Join Date: Mar 2012
How to add new Hero Trait and Ability
You can take a look at these file:
I'll write the guide later.