Please or Register to create posts and topics.

tile help

Please note: If you decide to use this tutorial, or the technology described
within, please give me some credit for discovering it, and/or describing how
to use it. Thanks!

Okay, here goes. I suppose you all want to know how to add tilesets to your
Campaigns/TC's. Well, if you follow these steps exactly, you will be able to
do just that. This tutorial will allow one to add 3 tilesets to Warcraft (for a
total of 7), which is normally only capable of the 4 basic ones we've all been
used to. Many people just replaced tilesets, but what happened if you
wanted to keep the existing tilesets? Or, what if you wanted to have
campaigns have access to 7 tilesets? Now you can, thanks to Cameron
Buschardt's UDTAhack and Warhack (DOS), and Alex Cech's Wardraft
and Warcraft Campaign Maker. These utilities will enable you to add the
tilesets of your choice to any campaign/TC that you want. Well, let's get on
with the tutorial, shall we?

First of all, you'll need to obtain Wardraft & Warhack (DOS).
UDTAhack is completely optional, it depends on if the tilesets you're
using contain new critter gfx, and if they do, this whole process gets
more complicated, but don't worry.
From here on out, I'm assuming you're at least familiar with the basic
operations of WarDraft (like extracting, importing, and creating
Campaign distribution files (W/the campaign builder). If not, I suggest
you get someone who knows about this stuff to edit things for you.
This tutorial is not meant to teach you the basics of the editors, that
should be easy enough for you to figure out on your own. If not, write
me, and I might work on a basic tutorial.)
I'm also going to separate this tutorial into 3-4 parts (I'm not sure yet,
and may forget to update this text). The first will deal with WarDraft
Stuff. The second will deal with UDTAhack stuff. The third part will
deal with War2hack stuff. The fourth, if there is one, will deal with
finally distributing your tilesets, but it might not be there)

Part one - WarDraft Stuff:

Okay, now you'll have to select your tilesets, and if you're not the
author, I'd strongly reccomend contacting the author for permission to
use their files. Who knows, maybe if you're nice, they'll include a
template file that they used for their tilesets, and that would make your
whole life a lot easier (cause then you'd know what files were replaced
Alright, now we're done with the idiot stuff. On to the real tough stuff!
Okay, now you'll need to open up each of the "wcd" files that is
included with each tileset. You can view them in WarDraft, but to do
so, you'll have to type in "*.wcd" into the "filename" box when the
"open file" dialog box opens up. Now, depending on what the author
decided to do with the tilesets, there may or may not be a file that
contains a description that says what their "wcd" file does. If so, it'll be
the first entry, 0, that WarDraft lists. If you want, you can double click
on it, and WarDraft will show a hex dump of the entry's contents. On
the left, you should see a whole bunch of gibberish, and numbers,
about 8 rows of it, I think. On the right, if it's the campaign data info
file, you should see bunches of text that are wrapped around
ackwardly. You'll know what I'm talking about if it's the info file. If
there's nothing there but more gibberish, you've either got the wrong
entry, or there's no campagin info (description) file included. It doesn't
really matter either way, I'm just letting you know what that file could
be, so you're not confused later on.
Now, depending on what replacements the author has decided to
make with this tileset, there could be any number of entries after the
description file (if there is one). At least three of those files contain info
that's related to the tilesets directly. There could be a fourth palette file
in there, which should be automatically identified by WarDraft, but if
there's not one, don't panic. That just means that the author decided to
use an existing palette file for some weird reason. It also makes your
life more difficult.
If there's a palette file, skip this step. If not, you'll have to do some
careful searching, and find out which of the tilesets this new tileset was
designed to replace. If you can't find out which one it is, try contacting
the author, they should be able to supply you with this info. If all else
fails, though, you'll have to back up your data files before you proceed
to do the next thing. Now that the data files have all been renamed,
you will now install the tileset into your copy of Warcraft, using
whatever batch file that the author provided to do so. Once that's
done, open up the modified data file in WarDraft, then search through
each of the tileset entries identified by the knowledge bases. There
should be a group of four entries for each tileset, with the first three
towards the top; Forest, Wasteland, and Winter, and the Swamp
tileset entries towards the bottom. Now, when you find whichever
tileset was replaced or modified, extract the palette entry for that
tileset, and choose decompress and "Save it like it is". Now you've got
your pallete and you can proceed to the next step.
Repeat the above step(s) for each tileset you're adding (or replacing if
you really must have all 7!), and then you'll have to identify each of the
three other files that are required for the tilesets within the "wcd" file.
To do that, you'll probably have to open up two copies of Wardraft,
one with Maindat (note: this assumes that you've restored your
maindat to it's original version, if it's been modified, like in the above
step), and the other with the "wcd" file that you're working with for the
particular tileset. Comparing entry sizes is the easiest way I know of
determining which entries are which in the "wcd" file. Otherwise, you
may end up extracting the wrong files, and that could be as disastrous
as my first version of the new tilesets thing. (I'll explain that if you want
- I didn't realize that the small (around 770 bytes) 0 entry was the
description entry. I thought since it was the same size as the palette
file, that that was probably what it was. Turns out I was wrong, and so
I got two description files put into the data directory rather than two
new palette files for each of the new tilesets. Oops.)
Alright, now since this can be tricky, you may end up going through
that process several times until you get to the right one. Once you
have, you'll need to extract each of the three other files, so you'll have
a total of four. One's the palette file, the second is the Minitile mapping
info, the third is the Map Minitiles, and the fourth is the Tile mapping
info. I have no idea what the difference is between them. You should
name all the extracted files in the order you extracted them, this really
simplifies things later on.
Alright, now that you've got all the files extracted, you'll have to look
for sets of four blank entries in "Maindat.war". I was only able to find
three sets of four consecutive blank entries (hence the 7 tileset
limitation) which are denoted by a blank line across their length, flag
and description. They are located here: (28-31), (71-74), (75-78).
There are a number of blank individual entries, but you can't use them
because WarCraft always reads tilesets as a group of four entries, all
in consecutive order. It's a limitation in the exe file, one which cannot
be overridden, since the only entry that's identified for the group is the
first one, the palette file, and so it just adds 1, 2, & 3 to get the
numbers for the rest. Otherwise, you could have more tilesets. I
suppose you could also try adding entries to "Maindat.war", but to do
that, you'd have to have a very advanced editor indeed, and I don't
know where to even look for such a beast.
Alright. Now that you've decided on where each of them is going,
you'll have to match up the filenames of the extracted tileset entries
with the blank entries. To do this, you'll need to open up Campaign
Builder in WarDraft. Click on the "+" button. It brings up a little dialog
box. One part says "Maindat.war". That's a scroll down list of the data
file you want your entry inserted into. The little box beside it labels the
entry number to be replaced. Underneath that, there's another text
box, with a browse button beside it. Now that I've described it as best
as I'm able, the rest should be easy. Alright, now the entries that you
want to add for the tilesets are all going into blank entries in
"Maindat.war" So, for now, you can leave the box that says
"Maindat.war" alone. So, let's replace a blank entry with a palette file
that you extracted from the new tilesets. You'll have to type into the
little box beside "Maindat.war" the number of the blank entry you want
replaced. Since this will be for your first tileset, I'd suggest replacing
28-31 first, then 71-78. Alright, now type in 28 into that box, and
click on the browse button to locate the palette file for the first tileset.
Once that's done, click open, then ok, and that's it. Repeat the above
process for each of the files required for each tileset, and you're almost
done with WarDraft.
Now here's where I warned you that things could get compicated,
depending on how many additional entries were in the new tileset's
"wcd" file. If there were more than 3 or 4, you're going to have to
follow the next step. If not, skip this one and the next.
Now, here's where installing the tileset the way the author intended it
comes in handy. If the author replaced any critters, icons, or buildings,
you'll have to find out which of those was replaced, and which entry in
the "wcd" file it's contained in. The absolute easiest way to do this is to
write to the author. I didn't and had to do it the hard way. See, here's
where the Template file could come in handy. But, let's say you're lazy,
or the author's ignoring you. (Neither of which is probably the case).
You'll have to install the tileset and then compare file sizes again! Fun,
right? Not really, unless you are weird, or wired, whichever suits you.
For instance, Cameron Vine's Desert Tileset replaces the wasteland
critter with a scorpion. You'll have to hunt it down in the "wcd" file, if
you want to use it, and I'd suggest it.
Alright, so I lied, if you've only got 3-4 entries, you could skip this
step, too, but I'd advise against it, there's important info here. Now,
here's where those extra single blank entries come in handy. You'll
have to pick one, (I don't care which, they're all over the place, your
choice), and then extract the new critter gfx, open back up the
Campagin builder, and add that new critter gfx file to it, pointing to one
of those blank entries. Now, since you've decided to include the
critter, you're going to have to use UDTAhack (2.0) to replace the gfx
entry. Before I go any further, I suppose I should point out that in none
of your editors will you have access to the three new tilesets. At least
not directly. That's why I'd suggest setting up a pattern here. (you
don't have to follow this one, it's just an example). For every pud file
that you want to access, say Cameron's Desert Tileset, just tell it to
use the Forest tileset (you'll understand why later on). Well, okay, you
win. It's because you're going to be creating another exe file for your
users to utilize the 3 new tilesets with. This new exe will edit the file
indexes so that the old tileset groups will be pointing to the new ones.
This will ensure that your users don't have to worry about something
crashing and not working. If it doesn't work, they simply don't have to
use the other exe file, they can just ignore the changes it made, since
you're adding tilesets, not replacing. Anyway, this paragraph's getting
too long, and I lost my point, so let's end it, shall we?
The tileset author may have also elected to replace the icons to reflect
the look of the new tileset. If they did, it'll be a big entry in the "wcd"
file, about 220k, and not compressed much. It should be easy to pick
out. You won't be able to get your new tilesets to access the new
icons, but who cares, they're icons, right?

Part Two - UDTAhack Stuff (Optional - depends on your

Okay, you'll now (i've gotta find a different word... Now this, now
that... It's driving me up the wall! STOP IT!) have to open up
UDTAhack and replace the gfx entries for the critters of whichever
tilesets you decided to "model" after the other ones. So, if you're
installing Cam Vine's Desert tileset, and you decided to call it the
Forest one in all puds, just so it can be accessed, you'll have to change
the GFX entry number for the critter in the Forest entry of the critter.
So, you'd have to type in the number of the blank entry in Maindat that
you imported the new critter gfx to. You'll have to do that for each
new critter and tileset.
Once you've finished that, save the "udt" file, and open back up
WarDraft. Look for another blank entry in Maindat. (Not the one that
your icons or critters is now inhabiting). Once you've found it, the
you'll have to open back up the Campaign Builder and then add
another replacement for the UDTA, only don't get it to replace the
normal UDTA, just type into the small box beside the "Maindat.war"
thing the blank entry number that you will import the new UDTA into.
Now your new tilesets will be able to access their new critters. You
could also make any necessary changes to the UDTA that you wanted
here, too.
Now, at this point, depending on what you're doing, you may or may
not be finished with UDTAhack and/or WarDraft. I don't care, I'm
finished with them (I think), and in any case, it's a good place to save
your work and create your own "wcd" file with the new tilesets.

Part Three - War2hack Stuff:

First thing you must do is to make a copy of the original war2.exe file.
I repeat, this is not optional, I'm ordering you to do it. You won't gain
anything at all by messing with the original, except a big headache.
Now, open up the file in War2hack (the dos version is the only one
that will do the necessary changes so far, so that's why I'm having you
use it, archaic though it may appear).
Once it finishes loading, and you press a key, you should see a menu
which lists the editors. For this tutorial, I'm only going to be dealing
with the File Indexes module. I'll not be held responsible for any other
modifications you make to the exe with the other modules based on
this tutorial and your own intution. I'd suggest Mordraug's adding a
unit tutorial, and my Training a new unit tutorial (a supplement to
Mordraug's) if you want to mess with that kind of stuff.
Alrighty then. Arrow down to "File Indexes" and press return. You
should get a two paned screen. On the left is a listing of all the indexes
contained in the exe. The inexes point to stuff in the Data files that the
Exe accesses. On the right is a box which lists the offset, and a
description of how to decipher the offset. The only editing you can do
with this editor is with the Offset number (accessed by pressing "A").
So, let's say you wanted to change the location of the Default UDTA
(Don't actually do this). You'd press "A" and then a little box would
pop up. Let's say that you wanted to change this to reflect a new
UDTA that you'd imported to blank entry #991 (it doesn't actually
exist, but that's to make sure you don't put it in anyway.) in
"Maindat.war". Right now it says "Offset: 1000" for the location of the
default UDTA. Now, here's where things can get tricky if you're a
normal household pet like my dog Ralph (Note: ralph doesn't actually
exist, which is fortunate because I still haven't fed him. Also ignore any
references made to my habitual beating of ralph, that's just hogwash.
Oh, and just so you don't take any offense by that phrase, I use my cat
Cecilia to wash my pigs 🙂 (It's humor like that that caused me to
create my TC in the first place. If you've never seen Monty Python,
just ignore me).
Alright, back to beating Ralph. (Writing Tutorials for over 2 hours
straight gets to you after a while :). (And no, that's not a picture of me
drooling back there. It's simply a smily face that I felt needed a period
after it. (never mind)).
So, what you have to understand is that when it says "Offset: 1000" in
War2hack, it's not actually pointing to entry #1000 in Maindat.war
Each of the data files has it's own number. Maindat happens to be
1000. Any entry in Maindat is identified by inserting its number behind
the 1000, or something like that. Anyway, since the Default UDTA is
normally located in entry number "O" of Maindat, it reads "1000". So,
if we wanted to change it to read the new UDTA, which is not really at
entry 991, we'd change the offset to read: "1991". Get it? If not, you'd
be a good playmate for my dog Ralph.
Okay, so you're going to vant to replace the Default UDTA and
Expansion UDTA with the entry number that you will be inserting the
new UDTA you created into. Then, you'll need to scroll down to the
end to find the group entries for each of the tilesets. You'll have to
change the offsets to reflect the number of the entry you're going to
insert the new palette into. You'll have to make sure that the palette is
the first of the four entries for this to work, though.

Part Four - Miscellaneous Stuff:

That should just about do it. Again, make any other changes you want
to the exe, but I'd suggest saving it first.
Now that the exe's done, you can build your "wcd" file, if you haven't
done so, and then generate your exe patch file. You should also create
batch files that your users can run to automatically run the tileset stuff.
You could base them on my batch file, for instance. You also should
include a text file explaining for which pud files the user should use the
default four tilesets, (and the original exe file), and the pud files which
the user should use the new three tilesets for (and the new exe file that
you've just created). There's no way to access all 7 at once.. sorry.
You may also wish to modify the strings to reflect the names of the
new Tilesets. To do this, you'll have to open back up WarDraft, open
Strdat.war, and then double click on string 46 I think, It should be
called Multiplayer selections, or something similar. In it, somewhere,
are the names of the tilesets. By editing this, you'll be able to allow the
user to select the proper tileset with custom and possibly multiplayer
games. It also looks cool and professional. You'd then have to add
this to your campaign builder template, and insert it into the blank entry
in strdat (I don't know the number, but there should only be one).
You'll then have to recompile the "wcd" file to reflect the changes.
You'll also have to change the file indexes in the new exe to change the
location of the new multiplayer strings to the new one.
In any case, don't forget to recompile everything & make new patches
after you make changes. That should do it for the Tutorial (this one, at
least). Don't hesitate to contact me if you're still totally lost or need a
clarification. Better yet, let me know of any mistakes. Hey, it's possible
after two-three hours of typing a tutorial that your brain turns to mush
and you create imaginary pets. Warn me if you see any signs of this in
the tutorial. As always, happy hacking!

I can be reached in any one of the following formats:

Home Page (W/forms submitted by email)
Page me on ICQ. My UIN # is: 3070076. (If you don't have ICQ,
you can also page me from my feedback page).
Leave a message at my new Funcraft Discussion Forum, also
accessable from my webpage.
Leave a message at the WarDraft Discussion Forum. (Just say
something like: Attention King Arthur!, and I'll get the picture).

This tutorial was written by King Arthur on 9/21/97. Do not modify it w/o his
(my) permission. Thanks!

Thanks! Tupac Administrator