Forums

Please or Register to create posts and topics.

Another add unit tutorial

How to create a "new" unit for Warcraft II, ver 1.33

So, you would like to create a new unit for Warcraft. Don't we all?

It's a rather difficult and lengthy process which can be screwed up rather easily, if you're not careful. Many people have asked me recently, after trying my Total Conversion, Funcraft III: Deride & Plunder, how I went about creating four new characters. I started out fully intending to make them brand new characters, but as time went on I discovered that only two unused readily editable slots exist in the Warcraft Exe.

So what I did was to replace four of the heroes of the human race, Khadgar, Turalyon, Uther Lightbringer, and Danath. This was the easiest solution, because it meant I only had to change one unit's gfx entries, and the fact that they could be added into any existing pud file without being trained first helped out a lot.

Replacing, or even adding new units is a very complicated and long process, one which I would not suggest undertaking unless you have lots of patience, and time. I elected not to include new gfx for my new units, as it would enlarge the size of an already large zip file, as well as the fact that I am definitely not an artist, except when it came time for hacking the title screen for my TC, which took me over a week to do.

alright, I suppose you are tired of hearing me toot my own horn. Here goes with the tutoria, which will allow you to train nine new units:

1. Download the following tools which are required to add/replace a unit:

Wardraft, War2hack & UDTAhack.

2. Once you've done that re-install Warcraft II with the expansion into two separate directories. This will insure that you will avoid altering any work that was added to your exe by downloading other patch files/Campaigns/Total Conversions.

One installation will be the source of the files you are going to edit, your Work directory, and the other one will serve as a Test directory for when you finish all of your editing.

3. I'm assuming that you've already decided what the units will be called, and which heroes will be replaced. So your first step is to open up Wardraft, load the knowledge bases, and open up the file Strdat.war in the Work directory you created in step 2.

Double click on the entry labeled "1". This is the strings entry which holds all the data for the unit and building names. Scroll down the list to the unit names you want to change. For example, let's say that you want to replace Uther Lightbringer.

You would scroll down to where you see his name and click on it. That will bring his name up in the box below the list. You can now edit the name to whatever you wish. Let's say you wanted to change it to read "Sir Lancelot". Simply type it in, it's as simple as that. When you're finished with that, don't click "OK", instead click on another name to apply the change.

4. Now we need to create a new string to train the unit. This is a little more complicated than replacing the name. First, find a blank string and click on it. Now type in something in the following format:

(a lowercase "hotkey")<C0>TRAIN <C3>(Uppercase hotkey)<C0>(the rest of the name of the unit)

It would appear as follows:

f<C0>TRAIN <C3>F<C0>OOTMAN

or

l<C0>TRAIN SIR<C3>L<C0>ANCELOT

so whatever key you pick for the hotkey, the shortcut key to be pressed to activate the training without the mouse, it must appear first in the string in lowercase, and then again between the <C3><C0> brackets. The latter part highlights the letter in a different color than the rest of the name.

5. For the sake of this example, let's say you picked string 327, which contains the Breed Faster Horses upgrade string, one that is unused in Warcraft, but is read by War2hack. I must warn you , however, that the text War2hack displays for string data is hard-coded into it. So you wouldn't see a Train Lancelot string, instead you'd see the old breed faster horses string, but at least you can tell you've got the right number.

6. Follow the same procedure for each unit you wish to add/replace. When you've finished that, then click on "OK". Wardraft will ask you if you wish to "Save as a separate file" or "Replace Selected Entry in War Archive". Choose the first one, "Save as a separate file", and call it "Names.dat", or something like that, and make sure you place it in your Work directory.

7. You're not finished with Wardraft yet, so don't close it. Instead click on in the menu bar "Tools", then "Campaign Builder".

Once it loads, click on the "+" button to add an entry replacement. It will bring up a dialog box.

8. See where it says "MAINDAT.WAR". Click there and scroll down until it says "STRDAT.WAR". In the "Entry" Box, there's a zero. Replace that with a one, and it'll replace the entry labeled 1 in STRDAT.WAR. Click "Browse" to find the "Names.dat" file that you created in step 6. Once that's done, click OK.

9. Okay, now I'm not finished with Wardraft.

I minimize it & I open up UDTAhack, make any necessary changes to the heroes I am replacing, and then save the Warcraft II Unit Data File in the work directory. I'm now finished with UDTAhack, and I switch back to Warcraft.

I now need to add another entry into my template. You'll notice that when you maximize WarDraft, the Campaign Builder has disappeared. Don't worry, it's still there. Click on "Tools", "Campaign Builder" again and it'll be restored to where you left it.

Add a new entry, using the same procedure as before, only this time it has to go into MAINDAT.WAR, entry 470 (not that this replaces only the Unit data for the expansion set, so if you want to replace that of the original Unit data, you'll need to add another entry just like the previous one, only it should replace entry 0).

10. alright, now it's up to you to add any more data files to this template that will be included in your Total Conversion/Campaign file. I won't cover how to do that, but it's pretty self explanatory. After that, save your template file ( the text in the main screen). Once you're done with that, you'll need to complied/build the data file to be distributed. Click on this button in the tool bar: and choose to save it in your Work directory.

11. Okay, now that does it for Wardraft. If you've saved everything, close it out, and then switch to Windows Explorer/File Manager/Dos Prompt and make a copy of the War2.exe file. Call it the name of your TC/Campaign, I don't care. I'm calling mine Funcraft.exe

12. Open up War2hack, type in the full path of your newly created/copied exe file, and wait for it to identify it.

13. Highlight the Unit Editor and press Enter. This will bring up a five paned window. One vertical pane on the left contains the number and name of every unit and building.

The right pane is divided into four horizontal panes. The topmost contains basic properties such as icons, string names, etc. The next down contains the Command Data entry and number of commands, the third contains the after death animation, and the fourth contains the sound information.

I'm only going to cover how to train your unit here, and not how to change sfx, after death animation, etc. This also assumes that you have replaced or decided to use the heroes' icons.

14. What you do next depends on the number of new units you wish to train. I wanted to train four units extra in my TC, but it is possible to train up to nine extra units (fairly easily). Of course, you can't train more than an extra three in the barracks without serious hacking, which I'm not going to cover here in this tutorial.

Let's assume worst case that you want to add training spots for ten hero replacements. If not, just ignore the extra hero steps (obviously). So, in order to train six units, you'll have to train three at the barracks, and six at another building, like the church.

I really wouldn't suggest adding so many new units, as it might cause instability, and it would be difficult if the game did crash, where the problem lies.

15. The next steps all refer to human units, and their icons/strings, etc. To change Orc units, follow the same procedure, just substituting the data by writing down details from the orc barracks and altar of storms.

16. First, scroll down to the knight.

His command data number should read: "2280*" Change it to read: "288*". This change will give the knights the command data of the Footman and Ballista, however, no performance differences will result due to this change.

Now, scroll down to the Barracks.

Change the number of commands from "6" to "9", and the command data from "5512*" to "2280*" This will link the Command data of the barracks to the knight, who has more commands to manipulate, as well as allowing it to have more commands than before.

17. Repeat the same procedure for adding commands to the Church.

Scroll to the Gnomish Submarine, and change its command data from "3512*" to "3840*". This will give the Gnomish Submarine the command data of the destroyer and the battleship, and no performance differences will result.

Scroll down to the Church. Change its command data from "6016*" to "3840*". That changes the Church's command data from that of the church to that of the Sub's which has 9 commands, rather than the 3 that the Church has.

To access the 9 commands, you'll have to type "F" followed by "9". You will also need to change the (E) Fn B data of the Church, not the sub, from "187744" to "188036", the Fn B of the Mage Tower, which can research and train. If you don't change it the church won't properly train units.

18. Okay, now you're finished with the Unit Editor. Press "Esc" and scroll down to the Command Editor. Scroll down in that menu until you reach the barracks.

For each of the six commands listed for the barracks (scroll sideways to view them all), you need to write down everything with the letters A-H beside it, keeping in mind that the F is out of order, last. Once that is finished, repeat the same process for the church for each of it's three commands.

Now scroll up to the knight. Replace each of his first six commands with the six commands you wrote down from the barracks. Repeat with the Destroyer's first three commands.

19. Now here comes the tricky part. I'll explain it as best as I can, using existing hero units.

20. Scroll back up to the knight in the command editor. Scroll sideways until you get to the 7th command.

Now, let's say we wanted to train Sir Lancelot (formerly Uther Lightbringer) in this spot.

Copy all the data from the 6th command (the train paladin command) to the 7th command. Now, Lancelot's (Uther's) icon number is 34, so you'll have to replace the "10" in the icon spot with "34".

You'll also have to change the position of the icon. Move it one over so that it isn't on top of another icon. So change it from "3" to "4".

You'll also have to change the string from "277" (Train Paladin) to "327" (The train Lancelot string you created earlier, way back in step 4).

If you're getting another unit to be trained, and switched its string number to another number besides 327, you'll have to switch it to the corresponding number you replaced.

You need to finally change the act var from "12" to "52". This specifies the unit number you want trained. So instead of a paladin (12), you're training Lancelot (Uther, 52)

21.The following is just for example purposes only:

String 328 is to train Lothar
String 159 is to train Alleria
String 243 is to train Turalyon
String 386 is to train Danath
String 390 is to train Khadgar
String 364 is to train Kurdran and Sky'ree
String 368 is to train a Daemon
String 337 is to train a Critter

(If you decide to train all of these units, you should probably give them a decay rate of 50-100, and add a cost in gold and/or lumber to each unit in UDTAhack).

All of the above strings are either blank or unused by Warcraft, and I'm only specifying them so that you will know what string numbers to use and what I'm referring to. I also had to use both Orc and Human heroes because, well I ran out.

If you do follow the steps to replace the last two units, the daemon and critter, keep in mind they'll be changes involved in the unit data for these units. The changes are in the next step.

22. These following changes in this step are only necessary if you wish to train a Daemon and Critter.

Switch out to the Unit editor. Scroll down to the Daemon. Change his Fn B (E) to "180876" This will allow him to be multi selectable.

Change his command data from "468*" to "288*". This changes his icons to human ones, since you're training him at an orc barracks. (and actually, it frees up his commands (468*), so if you have to have one more unit trained, choose to modify his commands rather than the sub's.)

Now you'll need to scroll down to the critter. Copy down all his data, and I mean all of it, death animations and sounds included. You'll be replacing the orc hero Zuljin (he's rather useless, anyway, but if you want, you can replace one of the other orc heroes.)

So, replace each of the entries in the Zuljin box with the critter's. You'll then need to add the command data "288*", which it doesn't have, and change the Fn B (E) to "180876".

Don't forget to change the death animations and sounds.

You'll then need to open up UDTAhack and change the gfx entry for Zuljin to those of the critter's. And note that the critter has four different gfx's for each season, so modify that accordingly.

You'll also need to remove his missile data, and change the range to 1, so that he doesn't fire an axe at a distance of 5 or 6 tiles.

That should do it for UDTAhack, so save it and you'll need to use Wardraft again to update the data file. Change back to War2hack and the Command Editor.

23. Make sure you're in the knight command data. Scroll over to the 8th command, and copy the data you wrote down for the paladin (6th command).

You'll need to make the same changes you had to make to train Lancelot (Uther) with Lothar. Change the icon from "10" to "32", Lothar's icon, move the position from "3" to "5" to make room for Lancelot & the paladin. Change the string from "277" to "328", the string for Lothar, and the act ver from "12" to "50".

24. Scroll over one more to the last command, 9. Copy the data from the ranger's build command(the 3rd) to the 9th. You will then replace the icon # "6" with "187", Alleria's icon. Move the position from "1" to "6", right next to Lothar's. Change the string from "273" to "159", and the act ver from "18" to "20"

25. Now you'll need to switch to the Sub's commands, and scroll over to the 4th one. Copy the data again from the paladin (the 6th command of the barracks) to the 4th command of the destroyer. Change the icon from "10" to "195", the position from "3" to "2", the string from "277" to "243", and the act var from "12" to "44".

26. Scroll over one to the 5th command of the Sub, copy over the data from the footman's training command at the barracks (1st command), and replace the following items: Icon "2" > "188", Pos "0" > "3", Str "283" > "386", Act var "0" > "46"

27. Change to the 6th command, copy the data taken from the train Mage command in the Mage Tower (first command), and modify these values: Icon "14" > "193", Pos "0" > "4", Str "281" > "390", Act var "10" > "24".

28. Move to the 7th command, copy the data taken from the Gryphon Aviary to train the gryphon (first command), and modify these values: Icon "30" > "191", Pos "0" > "5", Str "295" > "364", Act var "42" > "22".

29. Move to the 8th command, copy the data taken from the Gryphon Aviary to train the gryphon (first command), and modify these values: Icon "30" > "37", Pos "0" > "6", Str "295" > "368", Act var "42" > "56".

30. Move to the 9th command, copy the data taken from the first command of the Human barracks (train footman), and modify these values: Icon "2" > "115", Pos "0" > "7", Str "283" > "337", Act var "0" > "53".

31. And that's it for War2hack. Save the changes, and exit to a Dos prompt in your Work directory. Type the following: genpatch war2.exe (name of modified exe) (name of patch file to be created).

32. Now you need to create a batch file for your Total Conversion/Campaign. Copy this text into a text editor (ms-dos' edit utility works the best): exepatch war2.exe (name of modified exe) (name of patch file). Save it as the name of your TC/Campaign, with a .bat extension. Follow the same format for your wcd file patch. it should look like this: wcm (name of wcd file).

33.Create a text file explaining the changes you have made to Warcraft, and whatever else they need to know when they download your files. Make sure you call it the name of your TC/Campaign, and not Readme.txt, etc., because we all have that file in our War II directory already. The zipped up version of this file includes a template from which you can work.

34. Just a tip here, really, but if you are including new sounds for your units, don't have the campaign builder compress them. Instead, just leave them at their normal size, as putting the data file in a zip file decreases the size of the data file more than Blizzard's compression techniques. (and no, it doesn't work better if you compress and zip, it actually makes the files larger, for some strange reason.)

35. That's all really, except make sure you put everything into a zip file that your patches need to run, this includes wcm.exe and exepatch.exe. Copy the zip file to your Test directory, the second installation you did in the first step, and run the batch file. Load Warcraft and make sure everything loads correctly, and that all the units function the way they are supposed to.

36. As always, let me know if this just confuses you more, or what needs to be fixed if something doesn't work correctly, although it should. I hope this helps you out.

Contact me here (samuel_l_jackson@hotmail.com).

For any other tutorials, see
Mordraug's page (http://www.geocities.com/TimesSquare/Castle/4096/warcraft.html),
or Cameron's page (http://www.geocities.com/SiliconValley/Park/1385/).

Thanks! Tupac Administrator