In this small guide we will get to make a Hero unit that behaves as similar to WC3's as it is possible.

What we will learn

Create a new Unit[/*:m:wvsnr8am]

An overview on Actors[/*:m:wvsnr8am]

Understand some of the stats and attributes behind units[/*:m:wvsnr8am]

How Abilities/Weapons work and how some of them are they bound to Effects and Behaviors[/*:m:wvsnr8am]

What are Validators[/*:m:wvsnr8am]

What we need

The Galaxy Editor[/*:m:wvsnr8am]

Lots of patience[/*:m:wvsnr8am]

That said, let's begin:

Who is our Hero
For starters, let's define who our Hero will be and what he will be capable of. This Hero is the one and only Captain Zealotron, a veteran Protoss Zealot that was capable of defending the sacred temple of Forgottenor against never ending swarms of Zerg commanded by the now defunct Cerebrate Evildoerth.

He is capable of learning the following abilities:

Blind Devotion: Zealotron can go in a state where his attack are far more brutal and his endurance unsurpassed, at the cost of temporarily having his sight range dimished.[/*:m:wvsnr8am]

Ancestors Call: Zealotron is capable of calling the help of the spirits of his ancient comrades in the form of spectral Archons that support Zealotron.[/*:m:wvsnr8am]

Air Render: Zealotron's strength and discipline are such that he is capable of controlling the air with his bare fists and hit an enemy from a small distance.[/*:m:wvsnr8am]

Power Geyser: Zealotron conecntrates so much power into his fist, slamming the ground and erupting psionic lux damaging everything in an area.[/*:m:wvsnr8am]

His primary Attribute is Strength and will start with the following stats:

Strength: 22 (+3 every level)[/*:m:wvsnr8am]

Intelligence: 16 (+2 every level)[/*:m:wvsnr8am]

Agility: 19 (+2 every level)[/*:m:wvsnr8am]

So where do we start?

Let's go to the Data Editor and select Units in the Data Type dropdown box.

We right click in the list/tree view where all Units are displayed and pick Add Object.

It will shows us a small dialog where we will proceed to assign a Name and Id to our new Unit. We will name him "Captain Zealotron" (how else?) and use the suggest button to automatically generate an ID for our new Unit. For convenience we will make it so the Field values are copied from the Zealot, saving us some initial work on laying out every single field.

Now, having this base info set, we shall proceed to modify it a bit. First, let's pump his stats a bit, by changing his Life, Energy and Shields to 500, 250 and 650 respectively. We have to modify the Stats - Life Maximum, Stats - Energy Maximum and Stats - Shield Maximum amounts to those mentioned already. Clearly we want them to start already with those same values, so we modify the Stats - Life Starting Amount, Stats - Energy Starting Amount and Stats - Shield Starting Amount to those values too.

But also, quite importantly, we must set append values to two additional fields. One is (None) - Attributes, on which we will check the "Heroic" attribute, and the other is Stats - Flags, where we will check the "Hero" Flag. The first is purely an Attribute that works in a similar fashion to other Attributes like Light, Armored, Biological and others - they display it in the Unit status card and are used for both Targeting and Bonus Damage in abilites and weapons. The second makes it display a button in the lower right of the playfield viewport.

How about we place a starting Zealotron and Test our map to see how is progress going?

OH WAIT! Our unit doesn't show up when we place it! What the hell?

Well, let me welcome you to the beautiful world of Actors. What are Actors? Actors, in Starcraft 2, are pretty much the "audio-visual" link to the underlying data of nearly every object in the game. What does this mean? It means they handle what to display and what sounds to emit when certain object events occur. For example, in the case for most Units, an Actor checks when said unit has been created, and binds a model, a selection circle, a health bar among other things, to such created unit. But it also issues, when certain actions are performed, to play animations, create visual overlays, tint models, play sounds, etc.

This is one of the most complex Data Types in the game, and you will either love them or hate them. They are incredibly powerful (in the words of SC1 mod veteran, IskatuMesk, it resembles a lot of what iscript.bin was for SC1, but that might not be very relevant if you didnt havve an Sc1 modding background), but they are also inmensely complex and even complicated. But have patience with them, and your effors will be rewarded inmensely.

Thankfully, for our current purposes so far, we will work very little with them. What we will proceed to do now is create a new Actor. So let's head to Actors in the data types dropdown box, and in the same fashion to unit, we shall create a new one, copying the values of the Zealot actor.

Now, we will have to change every reference to the Zealot unit within the Actor to Captain Zealotron. Thankfully Blizzard was sane enough to add some components known as Tokens, that work like a predefined constant and that will help propagate such constant values to anything within the object that refers to it. In the case of most actor units, you will see an additional property at the top called unitName, which we can change to Captain Zealotron so all the events and other properties now refer to it rather than Zealot. Very easy!

Yes! Now everything will be done!

....

DAMMIT IT NOW SHOWS A RED BALL RATHER THAN A ZEALOT, WHAT THE HELL MAN!

Whoops! I guess I forgot to mention that, by default, the Actor references as his base model a Model entity that hsares his own ID. But worry now, this can be fixed in two ways. The easy way is to look for the Model field in our Actor and change it to a Zealot; the draw back is that in no way it will differ from the normal Zealot. But how about we explain the not-so-hard-yet-a-bit-tedious way? Well, We will now create a Model object, in the same way we have done our Unit and our Actor - new object that copies data from the Zealot Model.

And now, just to spice it up, we will rescale it to 1.5 its base proportions.

And we place it again on the map.

AT LAST IT SHOWS UP, DUDE! WAY TO GO COMPLICATED!

Indeed, it is quite complictaed to get a working unit from the ground up. There are easier ways to have done this, but part of the purpose of this tutorial is to illustrate you how everything works togheter and provide your a reasonably solid foundation for you to further customize.

Welcome to the second part of our tutorial. Last time we had already created our dear Captain Zealotron, worked a bit on the stats and gave him a model.

You might have noticed something was missing. In case you didn't, well turns out he is speechless. Sure, the trauma of losing all his dear friends during that glorious campaign might have turned him into a mutie, but we really know that is no the case - it just happens that we haven't added him a voice. Well, we sort of did. See, the CaptainZealotron actor automaticallly linked to Sounds Objects in the form of ##id##_Ready, ##id##_What (which transtales as CaptainZealotron_Ready and CaptainZealotron_What) and so on. But we haven't defined those so it is refering to the void of the abyss.

How do we do this? We have two options. First, it would be go to the actor and chnage the sound set in the Sounds field. We could link all of them to the zealot's equivalent. But we all know Captain Zealotron is far more epic than just your everyday Zealot.

So what do we do? First, go to Sounds in the Data Type dropdown box you have already falled in love with. Now, I'll be showing another feature of interest of the data editor, and that is Object Duplication.

This time we will use the search function and write HighTemplar. That will naturally filter to any objects that start with said search text. Now, assuming you are not using tree display and use the superior table display instead, we select everything whos parent is not spell; then we right click and pick Duplicate Object.

The next dialog will show us what specific objects we want to duplicate, and for each object, a nested list of other objects that link/are linked to the selected objects to duplicate. For our needs, we just want the voices and nothing else, so keep the related objects unchecked and just press OK

Now you will see both the predefined voice sets and our duplicated ones displayed. In the Data Source dropdown box we can just filter by either of the depending mods or our map/mod itself. We proceed then to filter it by our map/mod name.

Now, the slightly tedious part, is to double click each and rename it so the ID matches with what the Actor data has defined (something along the lines of CaptainZealotron_What and others).

Once you are done, you can congratulate yourself! Zealotron speaks like... a High Templar. Okay, that kinda sucks. But fear not! We can make Zealotron's voice mightier by modifying the pitch of each soundset.

For this example, we will lower the pitch to -4.5, so its voice is a bit deeper without making him sound as if he had a speech disorder. Dont forget to copy paste it to all the other sound sets.

By the way, you can preview the way they will sound by editing the Sound Assets field and using the In Game Preview Button (you can further tweak there in case you want to fiddle with values before applying them to the Sound object)

Yay! But now he is al talk and no action. He doesn't even have any special hero like attributes nor does he level up!

Fear not. We are now going to aboard this.

First! We shall start by giving him levels. We will do this through Behaviors. What are they you might ask? Well, they are passive unit alterations that can be applied permanently or only during a limited time. Some of them are stats buff/debuffs, some others are states like detection capabilities, cloaking, mobility modifiers, custom attributes, etc.

For our case, there happens to be a Behaviour type called Veterancy, that gives the unit a mechanism for gaining experience points through damage dealt/taken and kills. You can set a given amount of levels, what do each of said levels change in the unit, how much experience you require for each level, and so on.

So let's beging by visiting the ever infamous Data Type dropdown box and pick behaviours. Now let's right click and pick Add Object. We will set Behavior Type to Veterancy, and just for kicks, set Race as Neutral (as maybe in the future, we will create more heroes for different races, all of them sharing the same levelup mechanism - please note this is just for organization purposes, the race has no gameplay effect, except for validators and such, but those are used defined anyway).

Once created, we will proceed to set the Experience Fraction field. He we will set the multiplier bonus we gain for each of these. Please note, that most units have experience reward fields, and that the Experience Fraction field, as we mentioned before, is a multiplier, so let's say a Zergling gives 100 XP on death, and our Behaviour has an Experience Fraction on kill of 2, the unit will earn 200 XP.

For the sake of our purposes, we shall set that Zealotron gains 15% of XP on each attack, and 100% of the reward on a full kill.

We can also set that our Hero can give a Fraction of the XP to other units with a Veterancy Behavior, the Shared Fracion Amount. In this case, we will give him a 15% on Kill. If we are setting Shared Fraction, we must also set Shared Radius, that tells us how close the other units have to be to get their share of the XP. We will set it to 4

And last and most importantly we will set Veterancy Levels. Here will set what we mentioned before: required XP, bonus on level up, etc. For our case, we will set the same amount of level and required XP for each than Warcraft 3 did.

Note that all units start by default at level 1. Veterancy Level Index 0 refers to Level 2 actually, index 1 to Level 3 and so on. It makes sense since you specify the XP required to reach it, and we would start at Level 0 otherwise :P.

NOTE: As of current version, there is a notorious "bug" where most Movement and Acceleration multipliers are set to 0 or 0.01 in the Modifications+ field, thus making our unit immobile once he leveled up. Current workaround is to set all multipliers to 1, and Maximum Speed to 160; or that you use XML, defeating the whole point of this tutorial, thoough I admit it is a hundred times faster. It blows dick, alas, but I haven't found a proper solution. Make certain most of these fields read like that for each of your veterancy levels.

Having our levels set, we shall proceed to add Attributes! There is a Behavior Type called Attribute too. So we shall use it to create our Warcraft 3 styled attributes, Strength, Intelligence and Agility.

Alright, let's start by adding a new Object, picking the behavior Type as Attribute and calling it Strength.

Once we have them all, we will proceed to give them some relevant purpose. Keeping with the Warcraft 3's trend, we will make it so that each point in Strength increases life by 25 and regeneration by .05; Intelligence will increases energy by 15 and regeneration by .05; and last Agility gives an armor bonus of 0.3 and a 2% increase in attack rate.

So let's head to the Modifications field for the strength Attribute. We will locate Vital Max Bonus and set Life to 25, Vital Regenation Bonus for Life to 0.05. We will do the same for Intelligence, only picking Energy this time rather than life and Max Bonus to 15. For Agility we will go and set Life Armor Bonus to 0.3 and Attack Speed Multiplier* to 1.02

Once we are done, we will create an additional Behavior of type Buff. This one we will abuse to set Zealotron's starting Attribute points.

So we head onto the Modification field and look for Attributes. There we will add entries or each of our Attributes. Copying a little the Demon Hunter (and tweaking for our needs) we will set the Strength to 22, Agility to 19 and Intelligence to 16.

And now we will return back to our Veterancy Behavior, where we will have to modify each level index to do the same process we did for our Buff Behavior - adding Attributes and setting them what will be the points added per level. Please note that the points specified dont add up from previous levels, you have to specify manually how many total extra points will our Hero have per level. For example, based on our specifications for Zealotron's bonus points, for Level 2 (index 0) we would set the attributes bonus to Strength to 3, Agility to 2 and Intelligence to 2; for Level 3 (index 1), it would be Strength to 6, Agility to 4 and Intelligence to 4; and so on for every level.

Once we have it done, we will head back to our Hero, and add all the Behaviors we created to him by heading to (None) - Behaviors+ and adding all of them there.

Having done all of this, we can now test it back! This time without any glaring mistake! Just make certain to add enough foes to test and you are all set!

I am having a minor issue to deal with what seems to be a small bug with Veterancy Levels (which doesnt occur on straight XML >_>) and I would be either forced to explain what fields to fix (horribly painful) or just explain how to hack their way and edit the XML files, which I truly feel doesn't belong in the scope of this tutorial. I will see of fixing that since Core.

I sincerely apologize for the huge delay on it and I hope to have part 2 finished tomorrow at last. Enjoy the WIP here :P

I don't see why you would think that you will never learn this. If the tutorial is not helping you understand this stuff ebtter, then it is not accomplishing its goal, so I would rather ask you where are you stuck.

I don't see why you would think that you will never learn this. If the tutorial is not helping you understand this stuff ebtter, then it is not accomplishing its goal, so I would rather ask you where are you stuck.

Oh I did complete it. Well the part that is added and it worked out ok, thanks a lot! But, when I tried to make an ability it was damn hard to find the errors. Like: Ok, there is no missile, but where should I add it? Actor, model, ability, behaviour, effect and so on. If I code a spell in .galaxy I know where I should add it.