Forums

Please or Register to create posts and topics.

Detailed adding unit tutorial

Main

 

Warcraft II *Brand New* Unit Tutorial

written by Ribbon
(Begun 7/17/1998)
(This section written 7/21/1998)
(Last revised 8/25/1998)[Ribbon's Realm]


Prerequisites:

    • Warcraft IIX v1.33

 

    • A paint program (like Paint Shop Pro 4.0)

 

    • A ZIP managing program (like WinZip or PKZip for Windows)

 

    LOTS of patience!

 

Disclaimer:

I, and any other party referenced in or related to this document, cannot be held responsible for any damage resulting from what you do to your equipment. You make modifications to your game and use these tools and tutorials at your own risk. This tutorial is intended to be a tool for you to use to enhance your knowledge on the issues presented, and to be a starting point for your own experiments in Warcraft II editing. Always remember to make backups of your files (especially the ones you will be editing). All of this effort has been expended for the advanced enjoyment of a great game, so just enjoy it for what it is.

If you can't accept this disclaimer, don't use this tutorial!


Contents:

* Background *
Step 1: Download & virus-check editing programs
Step 2: Read King Arthur's Technical FAQ - Basic Editing - Using WarDraft

Novice Part * (Adding two units)
Step 3: Use VTM's War2CMDS program (in anticipation of the future)
Step 4: Change unit names (WarDraft string editor)
Step 5: Change default unit stats & details (UDTAHack)
Step 6: Change unit commands & data (WarHack 4.0)

Intermediate Part * (Adding a custom hero)
Step 7: Change unit name (WarDraft string editor)
Step 8: Change unit commands & data (WarHack 4.0)
Step 10: Add new GFX to Maindat.WAR (WarDraft)
Step 11: Change default unit stats & details (UDTAHack)
Step 12: 278 Editing (278Tools)

Advanced Part *(Creating a custom hero)
Step 13: Change unit name (WarDraft string editor)
Step 14: Change unit commands & data (WarHack 4.0)
Step 15: Create custom GFX (Paint Shop Pro 4)
Step 16: Add custom GFX to Maindat.WAR (WarDraft)
Step 17: Change default unit stats & details (UDTAHack)
Step 18: 278 Editing (278Tools)

Icons Part * (Creating custom icons)
Step 19: Extract and convert icon files to BMP (WarDraft & graphics converter)
Step 20: Create and add your icons (Paint Shop Pro 4)
Step 21: Edit Icon TXT layout file (using Notepad)
Step 22: Import the new icon file (WarDraft)
Step 23: Change unit's icon number (WarHack 4.0)


* Background *

This tutorial was written to help people who are new to Warcraft II editing on the Web. I personally got started in November of 1997, and I figured out most of the tools and functions without asking for any help from others. I just got in there, experimented, read the forum messages, and experimented some more. Lately, some folks have been clamoring for information on how to add BRAND NEW units to Warcraft II, so this tutorial will guide you through the process of adding new units. There are four sections to the tutorial, Novice, Intermediate, Advanced, and Icons (also an Advanced topic).

I ask that you exhaustively try to work out any problems you have by yourself, referencing the various discussion forums on the Web for similar problems and solutions. If you still have a problem specifically related to this tutorial, then I will be happy to help you if I can. If something doesn't work the first time, try again, or try something else. Remember that fiddling around with these things is about the best way to really learn how to do them.

Please don't send me e-mail asking questions that aren't covered in this tutorial. I have included almost everything I know about these procedures in the tutorial, and there are many things that you just can't do with the game. Check out the discussion forums and read all you can stand, since I'm pretty sure any questions you'll come up with have already been asked. You'll learn so much more that way, you may never have to ask a question (like me)!

+ Why do you need version 1.33?

In order to use this tutorial, you will NEED to have Warcraft II v1.33, which means you have to have the Beyond the Dark Portal expansion set. The reason for this is that most of the editors used require v1.33, and v1.33 is more fun anyway (in my opinion, of course < grin >), since you get the Orc Swamp tileset and all the new heroes. The expansion set isn't that expensive anymore (as far as I know), and I think the additions are worth the cost. Also, please don't try to edit Warcraft II v1.5 -- Blizzard changed some things to eliminate Internet cheating, so just use v1.33 for your Total Conversion projects.

Recently, Blizzard announced the new Warcraft II Platinum package (Win95 only), which includes the original Tides of Darkness, the Beyond the Dark Portal expansion, and a new set of campaigns (said to be eight levels for each side). It remains to be seen whether we'll be able to use the available editors on the game, but since v1.5 doesn't allow it, I doubt if Platinum will.

+ How many NEW units can you make?

There are a total of five (5) slots available for new units to be fit into War2 v1.33. These are referred to as Unit #34, Unit #36, Unit #37, Unit #48, and Unit #54. These unused units have some special characteristics that will have to be remedied before we can use them in the game, and I'll explain the problems as we get to them.

Step 1: Download & virus-check these programs:

    • WarDraft

 

    • 278Tools

 

    • PUDDraft

 

    • UDTAHack

 

    • WarHack 4.0 (DOS only)

 

    War2CMDS

 

These are the programs you'll need to do all of the editing presented in this tutorial. After you get them, you'll need to extract the files in some logical manner. I suggest that you make a "Utils" directory under your Warcraft II directory, and put WarDraft and 278Tools in a "WarDraft" directory, put PUDDraft in a "PUDDraft" directory, UDTAHack in a "UDTAHack" directory, and War2CMDS in your main Warcraft II directory. In addition to these tools, you'll need a paint program, which can't really be downloaded. I use Paint Shop Pro 4.0 (retail), and JASC Software used to have a demo on their site (they're on 5.0 right now). I don't know, however, which features are specific to Paint Shop Pro, so I'll only use basic features that any program should have.

Step 2: Read King Arthur's Technical FAQ - Basic Editing - Using WarDraft

King Arthur started a War2 editing Technical FAQ a while ago, but it isn't finished yet. The section on using WarDraft is very detailed, though, and WarDraft is a vital part of editing Warcraft II. Please take the link to this useful page and familiarize yourself with WarDraft before going on to the next step.


[Continue to the Novice part]

Thanks! Tupac Administrator

Novice

 

Warcraft II *Brand New* Unit Tutorial

written by Ribbon
(Begun 7/17/1998)
(This section written 7/21/1998)
(Last revised 8/25/1998)[Ribbon's Realm]


* Novice Part * (2 objectives)

    • A. Change Unit #36 to a Super Footman

 

    B. Change Unit #37 to a Super Grunt

In this section, we will begin our editing experience with the most simple new unit that I could come up with. We will change Unit #36 to a Super Footman, and Unit #37 to a Super Grunt. I know it sounds really corny at this point, but the experience you'll gain is invaluable. The quirk about Unit #36 and Unit #37 is the fact that they're actually unit slots, not hero slots. When you make your two units in this section and place them on the map, they'll change into each other depending on the race of the team they're assigned to. Even though PUDDraft will let you start with both units on the same team, you'll only get one kind when you play the map. With this in mind, I've selected the Super Footman and Super Grunt to keep that difference before us. Let's start now!

Step 3: Use VTM's War2CMDS program (in anticipation of the future)

VTM's War2CMDS program will simply run through an operation to change the structure of your War2.EXE file, allowing any unit to have commands, since some can't right now. We won't notice a change in this section, but executing this operation is the only way we can use Unit #48 and Unit #54 later on.

Before you run the program, make a copy of your War2.EXE file. Just go to your Warcraft II directory in Explorer, copy War2.EXE, paste it, and then rename the copied file to "NewWar2.EXE", since we want to have the same name in the tutorial and on your hard disk. Now make sure that War2CMDS.EXE is in your main Warcraft II directory, and then run it. When the program runs, a disclaimer and confirmation request appear. If you agree with the information, just type a "y" and press enter. You'll then be prompted for the name of the file you want to edit, so type in "NewWar2" (the .EXE extension will be added automatically). Press enter to start the conversion, and just hit a key when you're prompted to do so. If you have v1.33, the program will go through and update everything it should. We'll change the NewWar2.EXE file later on with WarHack 4.0.

Step 4: Change unit names (WarDraft string editor)

With the knowledge of WarDraft from King Arthur's FAQ, we can now get started changing the game. First, run WarDraft, and open [File-Open] the Strdat.WAR archive (it's located in the DATA directory). Next, load the War131.KNW knowledge base from your WarDraft directory [File-(Re)load knowledge base]. Now you can scroll down through the archive and look at the contents.

Right now, we want to change the names of our two new units, double-click entry #1 ("Strings: Unit names etc."). This brings up the String Editor window. Now just scroll on down to string slot #38. You'll notice that there are a few slots left blank around here. This is where we enter the names of our new units. Don't let the numbers fool you, though! Slot #38 is for Unit #36, and slot #39 is for Unit #37. Just select slot #38 and then type "Super Footman" into the large input box below the name list. Then select slot #39 and type "Super Grunt" in its input box. Now click "Ok", and allow WarDraft to replace the entry in the archive, and just save over the archive file (Strdat.WAR). Now your new unit names will show up in the other editors!

Step 5: Change default unit stats & details (UDTAHack)
* WARNING * - Don't Direct Save while WarDraft is open!

Now that we've changed the names, let's make the units' stats. First, though, a note about UDTAHack. There is a conflict between UDTAHack's ability to Direct Save the unit data to the Maindat.WAR file and WarDraft's holding the Maindat.WAR file open at the same time. In order to keep your files from being corrupted, always close WarDraft before using UDTAHack, and always close UDTAHack before using WarDraft. It took me two separate corruptions to figure that out, so heed my warning! 🙂

Also, there is a problem with the Direct Save function in UDTAHack 4.0 (as opposed to the 3.0 version). I use UDTAHack 3.0, so I'll explain the steps to use this version first. I'll also show you how to make the changes work with UDTAHack 4.0, though it is a bit more round-about. To check which version you have, go to the Help menu and select About.

This part should work fine for both versions, so run UDTAHack now. From the File menu, select Direct Open, and choose Default Expansion UDTA. This will load the War2 v1.33 default unit data file from the Maindat.WAR archive. Click on the tabs to see the different parts of the unit data. Now you can scroll down the list and find the Super Footman and Super Grunt entries. When you find them, go back up and select the Footman. Now select Copy Unit Data from the Edit menu to copy the Footman's data. This is where UDTAHack's other big bug lies, since it fails to copy some flags in the unit data. Click the Flags tab, and watch the check boxes. Then select the Super Footman and paste the unit data there. You'll notice that the "Organic Unit" box stays unchecked. Just check the box, and compare it to the Footman again, until you're sure the flags are the same.

Now go to the Super Footman's GFX tab. Since you copied the Footman, the "Repeat" box on this screen is unchecked. This box NEEDS to be unchecked if it's for the first unit in the file using the selected GFX, since checking the Repeat box tells the game that the GFX has already been loaded. If all units with that GFX have the Repeat box checked, the unit will appear in the game with NO graphics. Go ahead and check the box, since the Footman's entry will ensure that the GFX is loaded. Sometimes, you may have to type the GFX entry number in after checking the box in order to make it stay checked (another bug). Now we have a regular Footman!

To make him a Super Footman, let's give him some wild stats. Click the General tab and give him 10 Armor, 100 Hit Points, 6 Piercing Damage, and 9 Standard Damage (Standard Damage isn't marked, but the number is right between "Attack Range" and "Piercing Damage"). Since the Super Footman is so good, let's make him cost more, too, just in case you want to make them buildable later on. Set the Gold cost to 800, the Lumber cost to 50, and the Oil cost to 10. Now our Super Footman is done, so we can make the Super Grunt. Just do exactly what you did to get the Super Footman, but copy the Grunt instead of the Footman.

When you've got those two units done, you need to save your work as the default data for the game. If you're using UDTAHack 3.0, just select Direct Save from the file menu. Select Default Expansion UDTA from the selection box, make sure the "Compress" box is checked, and click "Import".

If you're using UDTAHack 4.0, just save your new UDTA as a separate file. Select Save As from the File menu and save the file in your WarDraft directory as "NewXUDTA" (the .UDT extension WILL be added, even if you put it yourself -- it would come out as "NewXUDTA.udt.udt"). Now you have to import the file, so open Maindat.WAR with WarDraft and scroll down to entry #472 ("Default UDTA for Expansion PUDs"). Select entry #472 and select "Import file..." from the Edit menu. Select NewXUDTA.udt as the file to import, elect to "Replace selected entry", and check the "Compress" box. Click Import to replace the entry, and save the new archive over the old Maindat.WAR when prompted.

Now close UDTAHack (ignore the requester that asks if you want to save changes -- it just wants to make sure you know what you're doing).

Step 6: Change unit commands & data (WarHack 4.0)

This is the last step to getting our units into the game. To set up WarHack 4.0, I recommend that you make a shortcut to the program on your desktop or in a program group. This way, you can just drag your NewWar2.EXE file from Explorer onto the shortcut, and you won't have to mess with any manual file entry. Just make sure that the shortcut's working directory points to your main Warcraft II directory.

Now, run WarHack and load your NewWar2.EXE file. Go into the Unit Editor section and look at the Footman's entry. Since the Super Footman won't be any different to control than the Footman, jot down all of the stats you see on the right side of the screen. One easy way to get this information is to mark the text with the DOS prompt's marking tool, copy it, and paste it onto Notepad. Make sure WarHack is running in a window, so you can see Notepad and WarHack at the same time.

Next, move on down to the Super Footman's entry. Now you have to copy the Footman's data from Notepad into the individual entries for the Super Footman. Just select the entry to be changed, and enter the value you got from the Footman. The only change we need to make after entering the Footman's data is to change the unit's in-game name, by changing the "Name" entry. Since this unit's string name was in slot #38 in the Strdat.WAR archive, change the value of the "Name" entry to 38. Just for fun, let's also change the unit's "Icon" entry to 180, which is the humans' Stand Guard icon.

Now do exactly what you did for the Super Footman for the Super Grunt, but copy down the Grunt's data instead of the Footman's. Then change the "Name" entry's value to 39, and the "Icon" entry's value to 181. You'll probably notice immediately that a lot of the data is identical to the Footman's data.

If you want to make the new units buildable, follow King Arthur's tutorial on making the heroes buildable, but make your units buildable instead of the heroes.

Now, test it!

Now you have to make a map with PUDDraft. I'd suggest that you first put down three start locations for three teams, then change one team to Orcs, on Rescue (Passive). Isolate the third team and give them one unit, trapped by a wall, so he won't attack you and so you can stay around as long as you want to look at your new units. To place your two new units, go to [Tools - NPC's - Unused/Special Units], and select your unit. Remember that the Super Footman will turn into a Super Grunt when you run the game if you put one on an orcish team, and the opposite is also true. Put down a few of each, along with some resources and Peasants, and try them out. Just run NewWar2.EXE instead of War2.EXE. You can change your race before you start the level to test the sound effects properly.

One small note about changing the default UDTA: the map has to use it before you'll see the changes. Since individual PUD files can use their own UDTA definitions, you need to make sure that the option to use the default UDTA is checked before you save the map. If the option is unchecked, your changes will be ignored. This shouldn't be a problem this time, since the map was created with your new default UDTA. When loading old maps, however, you may have to check out the default option if you have problems.

Congratulations!!! You've just made your first brand new units!! Now you can try out some of your own ideas. Go on to the Intermediate part when you're ready.


[Back to the Main Page] - [Continue to the Intermediate part]

Thanks! Tupac Administrator

Intermed

 

 

Warcraft II *Brand New* Unit Tutorial

written by Ribbon
(Begun 7/17/1998)
(This section written 7/26/1998)
(Last revised 8/25/1998)[Ribbon's Realm]


* Intermediate Part * (1 objective)

    Change Unit #48 to a Camo Ranger (new GFX)

In this section, we'll go a couple of steps further in making your own units. Many people have seen custom unit graphics files on the Web, but don't know how to use them. This section will guide you through the process if changing Unit #48 into Robin the Ranger, a special hero with a new battlefield look.

Step 7: Change unit name (WarDraft string editor)

Just like in Step 4, change the default unit name for Unit #48 in Strdat.WAR with the WarDraft string editor. This time, though, put "Robin the Ranger" into slot #50. This will let the other editors show the name correctly.

Step 8: Change unit commands & data (WarHack 4.0)

Run WarHack, and copy the Elven Archer's properties and enter them in Robin's place. Now you can change the Name value to 50, and the Icon value to 133 (the Ranger Sight icon), so Robin will have his correct name and a different icon. Just to make Robin more than an Elf, let's get the Knight's "Ready", "Ack Fn" (Acknowledgment), and "Sel.FN" (Selected) sound data, and put them in Robin's sounds. Now Robin will have the Knight's voice.

Step 10: Add Camo Ranger GFX to Maindat.WAR (then update knowledge base)

The first thing to do in this step is to download and virus-scan Archer.ZIP from beanslayer's page (his main page is here). Special thanks goes to beanslayer for making this cool GFX. The funny thing is, I found it AFTER I had thought of doing it myself. 🙂

Now you can use your ZIP management tool to extract Tracker_53.GFX from Archer.ZIP. Next, run WarDraft, load Maindat.WAR, then highlight entry #67 (described as an empty line). This is an empty slot in the Maindat.WAR archive, and we can put anything we want to right here. Select the "Import file..." option in the Edit menu (or press the Import smarticon), browse your directory, and select Tracker_53.GFX to import. Make sure that "Replace selected entry" and "Compress" are both active, and then click Import. When prompted, go ahead and replace Maindat.WAR with the newly archived file.

Notice that line 67 is blank now, since something occupies the slot, but isn't described in the knowledge base. Let's put a description in the knowledge base file, so we can see our changes in the archive. Make a copy of War131.KNW and call it "NewWar2.KNW". Now, load NewWar2.KNW into Notepad. See the line with "[maindat.war]"? That marks where the contents of Maindat.WAR are described in this file. Scroll down until you find these two lines:

    • 66=GFX,2,Unit Gfx: Critter (winter)

 

    69=GFX,2,Unit Gfx: Skeleton

This line contains the entry number, the entry type, the entry number for the palette to be used when viewing this GFX file, and the comment describing the contents of the entry. Now insert this line between them:

    67=GFX,2,Unit Gfx: beanslayer's Camo Archer

Now save the file, and load NewWar2.KNW as your new knowledge base in WarDraft. When you scroll down to entry #67, you'll be able to see your entry described.

Step 11: Change default unit stats & details (UDTAHack)

Now make sure WarDraft is closed, and run UDTAHack, so we can edit Robin's stats. Just like we did in Step 5, Direct Open the Default Expansion UDTA from the File menu. Now, select the Elven Archer, and click the Flags tab. Copy the data and paste it at Robin's place, and check the flags against the Archer's. Most likely, the Organic Unit flag is unchecked, so go ahead and check it now. Let's also give robin a little extra bonus by checking the Armor Upgrade box. That way, he'll get to have the armor bonus when you upgrade armor with the blacksmith.

Now, go to Robin's GFX tab, and change the GFX Entry number from 53 (the regular Archer GFX) to 67 (the Camo Archer's GFX). Make absolutely sure that the "Repeat" option is NOT checked, or the game won't load the GFX when you play, since it will think it has already loaded it.

Now, change Robin's stats on the General tab. He's a hero, so just give him 9 Sight Range, 8 Armor, 100 Hit Points, 7 Attack Range, 16 Standard Damage, and 18 Piercing Damage. Since he's a hero, we don't need to change the price (unless you want to build him).

Now save your changes. If you're using UDTAHack 3.0, Direct Save your changes to the Default Expansion UDTA (compressed). If you're using UDTAHack 4.0, save over your "NewXUDT" file and import it into Maindat.WAR with WarDraft. When you're done, quit UDTAHack.

Step 12: 278 Editing (278Tools)

This is where things get one step deeper. Entry #278 in the Maindat.WAR archive holds the animation routines for all of the units in the game. These individual routines are referred to as "programs", and animation, speed, and sound timing are all controlled within this file. Unit #48 actually uses the Footman's animation scheme, but we need to use the Archer's animation scheme, so we'll use 278Tools to make our changes.

First, extract Entry #278 from Maindat.WAR as 278.ORG to your WarDraft directory (be sure to decompress it before saving). Now go to a DOS prompt and go to your WarDraft directory. At the command prompt, type "D278 278.ORG > 278.TXT" and press Enter. This will execute the 278 disassembler utility and create a text file with all of the animation program data laid out so that we can edit it. Go back to Windows and open 278.TXT with Notepad. Don't be afraid to explore the file, but at this point, we only want to change a single number right near the beginning. (We'll do some fancier stuff later.) Scroll down to where you see this line:

    U48 Prog_0990 ; Unit48

This line shows the unit number (U48), the animation "program" number, and a comment with the default unit name (it doesn't change with Strdat.WAR, unfortunately). Prog_0990 is the Footman/Grunt animation program, and we want to change Unit #48 to have the Archer's program. Look back up at the Archer's line, and you'll see that the Archer uses Prog_079C. All we have do now is change the line for Unit #48 (Robin) to look just like this:

    U48 Prog_079C ; Unit48

Now, just save 278.TXT as it is, and close Notepad. Go back to the DOS prompt and type "A278 278.TXT 278.NEW" and press Enter. This makes a new 278 file called 278.NEW, which we now have to insert into Maindat.WAR. Go back to WarDraft, select entry 278, and import 278.NEW, replacing the entry, with compression. Replace the old Maindat.WAR with the new file when prompted.

Now test it!

To test your work, just do what you did with the Super Footman and Super Grunt, using PUDDraft to add a few Robins to a map.

Notice that Robin is always the same color, and has no identifying marks, no mater which team you put him on. It can get confusing if you put more than one on a map or if you make him buildable, so I recommend that you just use him as a single hero.

Great!!! You made it past the Intermediate part! Now you have three new units! What? You want ANOTHER one?! How selfish are you?! 🙂

Why not try the Advanced part now?


[Back to the Main Page] - [Back to the Novice part] - [Continue to the Advanced part]

Thanks! Tupac Administrator

Warcraft II *Brand New* Unit Tutorial

written by Ribbon
(Begun 7/17/1998)
(This section written 8/21/1998)
(Last revised 8/25/1998)[Ribbon's Realm]


* Icons Part * (1 objective)

    Add 2 icons

To make your new units more personal, you should give them new portraits that reflect their individuality. Adding new icons to Warcraft II isn't really that hard, but it still takes a firm understanding of the processes we've used already. I think you'll be able to add icons without a problem.

As mentioned before, I'm using JASC's Paint Shop Pro 4.0, so your paint program may not have the same usage requirements and functions. Most likely, though, your program can do whatever I'm going to do.

Step 19: Get the icon files

The icons are stored by terrain type in the Maindat.WAR file. Each of the tilesets has a corresponding set of icons, so we have to change all four icon sets in order to successfully add one icon. Using WarDraft, extract entries 356, 357, 358, and 471 into your WarDraft directory. Name them Summer.GFX, Winter.GFX, Wasteland.GFX, and Swamp.GFX respectively.

In order to be able to view the icons with the correct palettes, let's also extract the palette files. Extract entries 2, 10, 18, and 438 to your WarDraft directory as Summer.RGB, Wasteland.RGB, Winter.RGB, and Swamp.RGB respectively. (Note the slightly different order of appearance.)

Now that you've extracted the files, use the WarDraft GFX converter to change them into BMP files. Set the graphics type to standard, and use the palette file of the appropriate icon set.

Step 20: Add your icons

Now you have to use your paint program to make an icon. Let's just make a simple addition for our Super Footman and Super Grunt units. Open Summer.BMP and scroll down through the icons until you reach the end. You'll notice a few icons that were left over from Warcraft: Orcs and Humans. Although it is perfectly acceptable to overwrite these unused icons, we'll go ahead and add new ones, in keeping with the theme of this tutorial. To make room for the two icons we're going to add, use the Add Borders command (Image menu) to extend the bottom of the picture by 78 pixels, since each icon is 38 pixels tall and is separated by one pixel of background color. The new size of your picture should be 47 x 7772, with two icons' worth of empty space at the bottom.

Now, find the Stand Guard icons (near the bottom of the picture, just above the expansion heroes). Now select the two icons (Human and Orc) with the selection tool and make a copy of it. Scroll to the bottom of the picture where the blank spaces are, and paste a copy of the two icons to the picture, but don't release the selection. To make the icons slightly different, mirror the image horizontally (Image menu), so that the faces will be looking toward the right instead of the left. Now position the two icons to be offset from Turalyon exactly like any other icons and let go of the selection. Now you can save the BMP file and do the same things for each of the other icon sets. For reference, save the altered files as Summer2.BMP, etc.

Since the palettes differ depending on the terrain, you may have some problems pasting into different pictures. It won't necessarily look wrong in the paint program, but when you get into the game you may see a problem. To correct this, you may want to make a palette file with none of the terrain-specific colors (make them all purple or something), and load the palette replacing register values instead of matching colors (Colors menu). I have also had trouble with the fixed red colors conflicting with the team red colors, but this method can also fix that problem.

Step 21: Edit Icon TXT layout file

Now that you've added the icons to the picture, you need to let WarDraft know that there are two more icons to convert back to GFX format. Open Summer.TXT (or any other -- they're identical) with Notepad. We just added two icons, so change the line with NUMICONS=196 to be 198.

To tell WarDraft where the icon is in the picture we need to know the pixel locations of its upper-left (beginning) and lower-right (ending) pixels. According to Paint Shop Pro, my Super Footman icon starts at (0,7644) and ends at (46,7681). Now just copy Turalyon's line (the one that starts with 195), and paste it once below. Change the line to read like this:

196 46 38 (0,7644) - (45,7681); 0 0

The first number is the number of the icon in the list (starting with 0). Now do the same thing for the Super Grunt icon. My line looks like this:

197 46 38 (0,7683) - (45,7720); 0 0

Save your new layout file as NewIcons.TXT.

Step 22: Import the new icon file

Now we have to put the icons into the Maindat.WAR archive. Using the GFX converter, select Summer2.BMP as your BMP file to convert, and select NewIcons.TXT as your layout file. Using color 255 as transparent, reconvert the file and save it as Summer2.GFX. Do the same for the other files.

Now you have to replace the entries in Maindat.WAR with the corresponding new GFX files.

Step 23: Change unit's icon number (WarHack 4.0)

The final step in adding your new icons is to assign them to the units with WarHack. Open NewWar2.EXE with WarHack, and go to the Unit Editor. Find the Super Footman and change his icon to 196. Change the Super Grunt's icon to 197. Save the changes and test it.

WA-HOOOOOO!!! You've made it to the end of the tutorial! Congratulations on your astounding feat! Now you can get out there and have fun with your own customizations. Easy, wasn't it? 😉

Seriously, though, I'm sure you have learned an incredible amount about Warcraft II editing by going through this tutorial, and I had a lot of fun writing it. I hope all of your editing exploits are prosperous and bring you the enjoyment that games and game editors are supposed to provide. If you'd like, please take this opportunity to drop by my site and e-mail me about your success. Feel free to tell me about your opinion of the tutorial and what improvements/clarifications you think it needs.

Again, congratulations! And thanks for reading the tutorial!

- Ribbon 🙂


[Go to the Main page] - [Go back to the Advanced part]

[Go to Ribbon's Realm]

Thanks! Tupac Administrator

Adv

Warcraft II *Brand New* Unit Tutorial

written by Ribbon
(Begun 7/17/1998)
(This section written 8/8/1998)
(Last revised 8/25/1998)[Ribbon's Realm]


* Advanced Part * (1 objective)

    Change Unit #54 to an Eyeball-Troll (custom GFX)

In this part, we'll be doing a TON of complex editing. If you get lost at any point, stop and think about what you're doing. Don't be afraid to start over if it gets too confusing. The object of this part of the tutorial is to create a new Orcish hero, Kilrogg, who looks like a Troll with a huge eyeball for a head. He will have the powers of an Ogre-Mage, a special battlefield GFX that you'll have to create, and a slightly different animation scheme than a Troll, which you will also have to create.

Step 13: Change unit name (WarDraft string editor)

Just as you've done before, use WarDraft's string editor to give Unit #54 a name. Go to slot #56 and enter "Kilrogg" in the string contents box.

Step 14: Change unit commands & data (WarHack 4.0)

Kilrogg will be a cross between a Troll and an Ogre-Mage, so let's give him the Ogre-Mage parts right now. Using WarHack, copy the Ogre-Mage's unit properties to Notepad, and then enter them for Kilrogg. Give Kilrogg an "Icon" value of 136 (the Berzerker Sight icon), a "Name" value of 56, a "Unk" value of 1, and "Ready" and "Attack" values of 0. Now you should give Kilrogg the Death Knight's "Ack Fn" and "Sel.FN" values, to make him talk like a Death Knight.

In the game, Kilrogg will be able to use the Ogre-Mage magics after you research them. You will get the Eye of Kilrogg magic when you upgrade Ogres to Ogre-Mages (or Knights to Paladins).

Step 15: Create Eyeball-Troll GFX

A. Extract the files

In this step, we have to extract three files from Maindat.WAR, so we can convert the GFX files to BMP files. First, extract entry #2 (the Summer palette file) from Maindat.WAR, and make sure that "just save like it is" and "decompress" are checked when the extraction dialog box comes up. Save this file as "Summer.RGB" in your WarDraft directory.

Now we need to get the two GFX files that we'll be joining with our paint program. Extract the Axethrower GFX (entry #54) with decompression, and save it as "Troll.GFX" in your WarDraft directory. Now you can extract the Eye of Kilrogg GFX (entry #37) with decompression, and save it as "Eye.GFX" in your WarDraft directory.

B. Convert the GFX files to BMP files

Now that we've extracted our GFX files, we can use WarDraft's GFX converter to change them to BMP files that we can edit. Activate the utility with the Tools menu [Tools - Graphics Converter]. Since we want to convert from GFX to BMP, click on the tab labeled "Gfx -> BMP". Our two files use the standard War2 GFX format, so select "Standard" for the Graphics Type. Next, click the "Graphics file..." button and select Troll.GFX as the file to convert. Now, select Summer.RGB as your conversion palette. Leave the other settings alone for now, and just start the conversion. When prompted, save the BMP file as Troll.BMP, and the layout file as Troll.TXT, both in your WarDraft directory. Don't save a mask file.

When the conversion is complete, the layout file will be displayed for you to look at. Just close the window, and your new BMP file will be previewed in the Graphics Converter window.

To convert the Eye of Kilrogg, just do the same thing, but select Eye.GFX as your file to convert, and save the BMP file as Eye.BMP and the layout file as Eye.TXT.

As a helpful hint, be very careful when converting graphics files with this utility. The converter will check the file for its defined size depending on which Graphics Type you specify. If you choose the wrong setting, you may end up with an unreasonably enormous BMP file, and it won't even be correct. I accidentally converted a War2 Alpha graphics file incorrectly and ended up with a 65 Megabyte BMP file! (I found it when I was cleaning up my hard disk and I noticed it sitting in one of my three War2 directories.)

C. Put the Eye of Kilrogg over the Troll's head in all of his frames

This is where the paint program comes in. I use JASC's Paint Shop Pro 4.0, but you can probably do most simple editing with almost any other program.

Just load the two BMP files (Troll.BMP and Eye.BMP) into the program, and use the Selection tool to select the Eye's downward-looking frame. Now, copy the selection with the background color as the transparent color, go to Troll.BMP, and paste the eyeball with transparency. You can move the eyeball to fit over the Troll's head, and then paste another eyeball. Do this for all of the Troll's downward-facing frames. Now you can pick up another frame from the Eye of Kilrogg, and paste it over the Troll's respective frames. When you're finished, save your new eyeball-troll as "Kilrogg.BMP".

If you haven't used the paint program before, stop here and just get to know the program. Play around with it, explore the menus and functions, and experiment with all of the tools. I can't write a tutorial on paint programs, so it's up to you to learn it for yourself.

D. Convert Eyeball-Troll BMP to GFX (use the Troll's TXT file)

Now that you've made your Kilrogg.BMP file, we have to convert it to a GFX file. Run the Graphics Converter in WarDraft, and this time, click on the "BMP -> Gfx" tab. Select Kilrogg.BMP as your file to convert, and select Troll.TXT as your layout file. Set the transparent area to be instead of color 255 (select "instead of color" and fill in 255 in the blank). Now you can start the reconversion and save the result as Kilrogg.GFX in your WarDraft directory.

Step 16: Add Eyeball-Troll GFX to Maindat.WAR (then update knowledge base)

To add Kilrogg.GFX to your Maindat.WAR archive, select entry #68 and import Kilrogg.GFX with compression. Replace the archive when prompted. Now open up NewWar2.KNW with Notepad, and add the following line (just like you did in Step 10):

    68=GFX,2,Unit Gfx: Kilrogg (Eyeball-Troll)

Now you can save the file and reload your knowledge base in WarDraft to view the entry properly.

Notice that when you view the entry, some of the frames are missing part of the Eye of Kilrogg, as if it were just cut off. It's not because of something you did, but something you didn't do. When the Graphics Converter changes a BMP to a GFX, it uses a layout file (a TXT file) to tell it what to do to make the frames. On each line in the layout file, there is a frame number (starting with 0), along with its location in the BMP file. If you want to make the converter not clip parts from your frames, you can re-define the dimensions and the starting and ending locations of each frame in the layout file.

Changing the layout file is a bit of a chore, but for Total Conversion authors, quality is important, so it's worth the extra time and effort. Some of the GFX files I've downloaded from the Web aren't fixed like this, so they're missing a LOT from each frame. It really doesn't reflect well on the designers, even if they didn't know you could fix the problem. For our purposes, though, we don't need to worry about the clipping. Kilrogg isn't going to be in a TC anyway. 🙂

Step 17: Change default unit stats & details (UDTAHack)

Close WarDraft, run UDTAHack, and Direct Open the Default Expansion UDTA. Select the Berzerker and copy his data, then click the Flags tab. Paste the Berzerker's data on Kilrogg's entry, and check the Organic Unit box (as usual). Now Kilrogg is like a Berzerker, but we want him to be able to use magic, like an Ogre-Mage, so check the Can Cast Spells box (near the middle of the window). Also, check the Armor Upgrade box and uncheck the Weapon Upgrade box, so Kilrogg will only get the armor boost, and not the sword/axe upgrade.

Give Kilrogg his correct battlefield GFX by clicking on the GFX tab. Uncheck the Repeat box, and then type 68 in the Entry # space. Now click the General tab and change Kilrogg's stats. Give Kilrogg 9 Sight Range, 2 Armor, 100 Hit Points, 7 Attack Range, 10 Standard Damage, and 14 Piercing Damage. Next, change the Missile Type to Gryphon Hammer, so Kilrogg will throw magical hammers instead of regular axes. Since he's a hero, don't bother to change Kilrogg's resource costs. Now you can save your work. With UDTAHack 3.0, Direct Save the Default Expansion UDTA with compression. With UDTAHack 4.0, save over your "NewUDTA" file and import it into Maindat.WAR with WarDraft. Close UDTAHack when you're finished.

At this point, you can test Kilrogg by putting him in your PUDDraft map, even though we really aren't quite finished with him yet. Just test him out now to make sure all of your changes are working properly. The final touch for Kilrogg will be to slow him down a little bit and make his movement a little bit smoother. For that, we'll have to actually alter an animation program in entry 278.

Step 18: 278 Editing

The first thing we need to do in this step is prepare the 278 structure to handle a brand new animation scheme. Open WarDraft and run the Speed Editor [Tools - Speed Editor (Ed278)]. Unfortunately, WarDraft's Speed Editor doesn't seem to like externally-altered 278 files, so we'll have to load the 278.ORG file and start over again. Fortunately, our changes were very simple, so we won't have a problem fixing them up again. Since we already have the 278 entry extracted, click the Load button and load 278.ORG. Click the Grouping tab, and use the selection bar to select any unit you're interested in, and the yellow window beneath will show what units use the same animation scheme as the selected unit.

Unit #48 (Robin the Ranger) needs to be moved to the Archer's group so he'll animate properly again, so select Unit #48 in the selection bar, and click the button marked "Set source group". Next, select the Archer in the selection box, and click the button marked "Select destination group". Now the groups are set up for the transfer, so click on Unit #48 in the Source box, and then click the button marked "Move unit from source to destination group". If all goes well, Unit #48 will pop over to the Archer's group.

Notice that Unit #54 is also in the same group as the Footman, which means that Kilrogg is currently being animated as if his graphics were laid out like a Footman's are. Let's make a brand new program group that uses the Troll's animation, since we want to make him a bit slower than a regular Axethrower. Select the Axethrower with the selection bar, and then click on the button marked "Set source group". The members of this group are now displayed in the source box beneath the button. To make a brand new group with this animation scheme click the "Clear" button to clear the destination group, select the Berzerker from the Source box, and then click the button marked "Move unit from source to destination group" (make sure the checkbox for retaining file size is unchecked, since it will have to change the size).

Now that we've established the animation scheme for the group, we can move Kilrogg (Unit #54) in. Select the Footman in the selection bar and set that group as the source group. The Berzerker's new group should be your destination group, so click on Unit #54 in the Source box and click the Move button to put him in the new group. Now you can move the Berzerker back to the Axethrower's group by setting the Berzerker's group as the source and the Axethrower's group as the destination, then moving the Berzerker. Save the changed file as 278.NEW.

When making a Total Conversion with lots of changes to the 278, I recommend that you plan out everything exactly as you want it before creating the final 278 file. Figure out how many new groups you need and which group each unit will belong to. After you do that, you can create all of the groups and assign the units to them in one swoop. This should keep you from running into problems since you won't be trying to load a 278 file that's been recompiled with 278Tools.

Now, we need to make the animation changes to the 278 file. From a DOS prompt, enter your WarDraft directory, where your 278 files are. Convert the 278 file to a text file with this command:

    D278 278.NEW > 278.TXT

If you're asked about it, go ahead and overwrite the old 278.TXT file.

Now you can open 278.TXT with Notepad, so we can make our changes. Find the line for Unit #54, and note the program number (mine is Prog_133A). Search for that number with Notepad's Find command. You should come across something like this:

Prog_133A:

    • ; Unit54

 

    • E0 Global_13BA ; Event0

 

    • E1 Event_1348 ; Die

 

    • E2 Event_1357 ; Event2

 

    • E3 Event_135C ; Move

 

    • E4 Event_1395 ; Attack

 

    • E5 Global_13B0 ; Event5

 

    E6 Global_13B0 ; Event6

I'm not sure whether you will have the same numbers, but the program should look the same otherwise. These events are the individual program groups that animate the unit in different circumstances. Since we just want to make Kilrogg walk a little bit slower, search for the number of the Move event (mine is 135C). Please click here to see an excerpt from my Move program.

The individual commands are described in the WarDraft Speed Editor online help file. Since we are trying to make this unit slower, we need to move the unit the same number of pixels in a longer amount of time. To do this, let's just add some WAIT commands and some animation. First, though, analyze the flow of the Move program. When the program says "SHOW" or "WALK_F", it's displaying the specified frame of Kilrogg's animation GFX. Notice that the program will display the frames in the order of 0 (standing), 5 (long step, one leg), 10 (short step, one leg), 0 (standing again), 15 (long step, other leg), 20 (short step, other leg), and then wraps back to 0 and starts over. This makes the unit's walking a bit jerky. Let's modify the animation to display a short step before going to the long steps. Since we need to keep the same number of pixels moved, we have to reduce the number of pixels that are used in the current animation to make room for two more frames to be displayed. Run through the program and change the eight WALK or WALK_F entries that move the frame 3 pixels to move only 2 pixels (there shouldn't be any 3's left when you're done). Now, insert this block just before the line that reads "WALK_F 2,5":

    • WALK_F 2,10

 

    • WAIT3 1

 

    • WALK 2

 

    WAIT3 1

This block displays the short step, and moves the frame for a total of four pixels. It also slows the unit down by adding a total of two WAIT3 commands. Now add this block just before the line that reads "WALK_F 2,15":

    • WALK_F 2,20

 

    • WAIT3 1

 

    • WALK 2

 

    WAIT3 1

This adds the short step frame for the other leg, moving four pixels and adding two more wait commands. It's very important to keep track of how many pixels you're moving the unit, since a square is defined as a certain number of pixels. If you move the unit too many pixels, its graphic will float off of the unit's actual map location. Click here to see what the event should look like when you're finished editing. Save your work when you're finished.

Lastly, we have to reassemble the 278.TXT file and import it into Maindat.WAR. From your DOS prompt in the WarDraft directory, enter this command:

    A278 278.TXT 278.NEW

Now run WarDraft and import 278.NEW (with compression) into entry #278.

Now test it!

Use PUDDraft to add some Kilroggs to your map, and then run NewWar2.EXE. If all went well, you should have a cool new unit to play with.

Hooray!!!! You're getting good at this!

In this section, you did a TON of advanced editing, and errors can occur at any point. If you've run into a problem somewhere, try to figure out where the problem lies so you can fix it. If the animation is wrong, the 278 is probably the cause. If the unit's colors are wrong, the BMP editing may have caused a problem. If your game quits with a blue error message, an error might have been made in the EXE file with WarHack. If your game gets totally wasted, and the Maindat.WAR file is corrupt, UDTAHack may have had a conflict with WarDraft. In many cases, you can just start over with your backup copy of the files. If the problems are too much, though, you may have to delete the Warcraft II installation and start over from scratch. Whatever the case, keep trying until it works. I know that all of the instructions in the tutorial are correct, because I followed it exactly and everything worked fine. Just keep trying and experimenting on your own and you'll figure it out. As I've said before, I learned all of this stuff from reading discussion forum posts and experimenting for myself, and I haven't yet posted a single question on any discussion forum.

For a final touch, your new units should have brand new portraits, so go on to the Icons part when you're ready.


[Back to the Main Page] - [Back to the Intermediate part] - [Continue to the Icons part]

Thanks! Tupac Administrator

278a

Event_135C:
SHOW 0
RESET
WALK 3
WAIT2 2
WALK_F 3,5
WAIT3 1
WALK 3
WAIT2 2
WALK_F 2,10
WAIT3 1
WALK 3
WAIT3 1
WALK_F 2,0
WAIT3 1
WALK 3
WAIT2 2
WALK_F 3,15
WAIT3 1
WALK 3
WAIT2 2
WALK_F 2,20
WAIT3 1
WALK 3
WAIT3 1
WALK 2
GOTO Event_135C

 

278b

Event_135C:
SHOW 0
RESET
WALK 2
WAIT2 2
WALK_F 2,10
WAIT3 1
WALK 2
WAIT3 1
WALK_F 2,5
WAIT3 1
WALK 2
WAIT2 2
WALK_F 2,10
WAIT3 1
WALK 2
WAIT3 1
WALK_F 2,0
WAIT3 1
WALK 2
WAIT2 2
WALK_F 2,20
WAIT3 1
WALK 2
WAIT3 1
WALK_F 2,15
WAIT3 1
WALK 2
WAIT2 2
WALK_F 2,20
WAIT3 1
WALK 2
WAIT3 1
WALK 2
GOTO Event_135C

 

Thanks! Tupac Administrator

* Ribbon's Brand New Units Tutorial for Warcraft II *

Thanks for downloading my tutorial! This tutorial contains detailed
instructions on how to add new units to Warcraft II: Beyond the Dark
Portal. The tutorial is in HTML format, so you'll need a Web browser
to view it properly. It took me about two months to write the tutorial,
and it's NOT easy to explain these things as detailed a manner as I
have. It's a long document, but I think it's got about all you'll need
to get a firm hold on the procedures of Warcraft II editing.

I guess it's okay to distribute this tutorial, but only if you give out
the unmodified archive as found on my web page. Don't add anything to
or take anything out of the archive, and don't change any of the files.
If you'd like to let others know about this tutorial, but don't want to
give them the archive yourself, just give them this URL:

http://www.geocities.com/TimesSquare/Chasm/8645/

Since this tutorial is relatively new (as of this writing), please
come by the site to see if there is a further revised version available.
If there is a newer version, please delete this version of the tutorial
and get the new one. Also, please tell whoever you got this version
from that there is a new version out.

For reference, this ZIP contains Ribbon's Brand New Units Tutorial
current as of 8/25/1998.

Please unzip all of the files included into a single directory, like
[C:\Games\War2\Tutorial]. To view the tutorial, use your Web browser
to open the "main.htm" file.

This tutorial is my hard work, with God's direction, so please respect
my authorship. Enjoy!

- Ribbon 🙂

Thanks! Tupac Administrator