
             **** HOW TO CREATE YOUR OWN WORLD TUTORIAL ****

Ok, so you want to make your own cool adventure staring Mr T?  Not
a problem, you can do so right now.

There is a LOT you can change.. but being so configurable/powerful comes
at a price, being overly complex.  Oh well.

Step 1:

Create a dir off your root Dink dir that will store the addon.  (we'll use
ATEAM in this case)

Next, copy the DINK.INI and HARD.DAT from the dink/dink dir into the ATEAM
dir.

You are now ready to work on it!

To fireup the editor to edit in ATEAM, do this:

dinkedit -game ATEAM

-= the map selection screen =-

After a really cool title screen, you will see 768 purple blocks.  What
are all these?  Screens you can edit.  Choose a screen and press ENTER.

-= the map edit screen =-

You now see what looks like a Dink screen, but it is all grass.

Press ESCAPE.  You are now back to the map selection screen, and low and
behold, there is ONE red tile where you created your screen!  Awesome!

Let's press SPACE.  That little red tile turns green - why?  It's a tiny
view of it, it's green because it's all grass!

Ok - very nice, but this adventure will need more than grass.

Go back into map edit mode by hitting enter on the one little red
block.

-= Tile selection modes =-

Hit 1.  Woah, a bunch of tiles.  Hit 2.  Woah, more.  This goes on until
9 - Is that all?  Nope, do the same thing with Shift, Ctrl or Alt held
down - there are 41 tile screens in all.

(note, Alt-` (tilde) brings up the 'road path' tileset, I was running out
of keys..)

Ok, so pick a rock.  Wait.. it's too big for one tile, and it's going
to take all day to do it one at a time... not a problem!  Hold down
Shift and press the arrow keys - you can change the selection size!

Press ENTER.  You are now back to your map.  Press S.  You just stamped
some stuff to your screen.  You can press C to 'copy' (point the upper left
tile of the selection box to that tile) - if your selector is bigger than
the tileset, it will stamp black in those areas.

Ok, so you get the hang of stamping tiles, but wait - this map is pretty
dull.  We need to add a tree that you can walk behind.  Is this hard?

Not really.

-= sprite placement mode =-

From Map edit mode, hit TAB.  Your 'box' changes into a blue arrow.

(note: you can use your mouse to move the arrow, or the keyboard, hold
down SHIFT to move faster)

We are now ready to place some sprites.

-= sprite pick screens =-

Press E.  You will see a message saying "Wait, loading sprites".  This
can be pretty slow.. it loads the first 96 used sequences.

(this is the sequence select screen)

Eventually, you'll see a screen with a bunch of little pictures.  These
are the first frame from that 'sequence'.  Some sequences are animations,
some contain a lot of simular sprites.

Let's look for a tree.  

You'll probably see two - you click on the first, and you'll see 20 some
frames a tree catching on fire and burning.. Nope, not what we want.  Hit
ESCAPE to return to the sequence selector and press ENTER on the other
tree.

Now that you have picked a sequence, we can pick an individual sprite
from that sequence.

(this is the sprite selection screen)

There are a couple of nice trees here, and some stumps too.  Let's pick
a big tree and press ENTER.

Woah, we're back to the sprite placement screen, but instead of a little
blue arrow, we are now moving a tree!  Neat.

Click the left mouse button, and the tree is 'stuck' to the screen and
you get your blue arrow back.

Now left click on the tree, woah, you can pick it up and move it again!

Now, this time, while you are 'holding' the tree, press S - you just
stamped a tree down.  You can create a forest really fast this way.

To delete a tree, click on it, then press DEL.  Do Alt-DEL to delete
ALL sprites on the screen.

Anyway, just paste one tree for now.

Hit escape or TAB to exit back to the map edit mode, then ESCAPE again
to get to the map selection mode.  Look at the MAP # listed
below (make sure your selection box is over the red tile,  the one
you editted) and write it DOWN!!!  This is the map we will want the
game to start on.

Now hit Q to quit and save.

*** TRYING OUT YOUR WORK ***

Ok, you'll notice that the file MAP.DAT has been created in the ATEAM
dir.  This will get bigger as more maps are added.  A file called DINK.DAT
has been created too, this is related to the MAP (holds the index of what
maps have been used and who is connected to what) and this won't get
bigger.

Now, we could just type DINK -game ATEAM and Dink.exe would fire up
and try to play our addon, but we would run into a problem.  Dink's
starting map is PROBABLY not the same as ours, therby dink would start
on a map that doesn't exist.  (it would probably just appear as all
grass)

Why would this happen?  Because Dink would be running all the Dinkc
files from the DINK dir when it didn't find the in the ATEAM dir, so we'll
need to copy a few.

Copy MAIN.C from the dink\story dir to the ATEAM\story dir.  (oh, did I
mention you need to make a sub dir called STORY off your ATEAM dir?)

Next copy START*.* from the dink\story dir to ATEAM\story dir.

We can now customize them to our liking.

Edit the ATEAM\story\start-1.c file.

A bunch of junk you don't understand you say?  Don't worry about that
for now.  Search for sp_x.  Right under that, add:

sp_map(1, your_map_#);

Instead of actually writing your_map_#, replace
that with the map # I had you write down earlier.  (example, 340)

*NOW* you can run the game.

You should see your screen and be able to walk in front of and behind
your tree.  How fun.  Only one problem.. your guy can walk THROUGH
the tree!!! What is going on here?!?!?

Ok, let's fix that.

Back to the editor.

dinkedit -game ATEAM

again.

Go edit your screen - Hit TAB to get into sprite edit mode.  Click on
the tree.  Guess what, we can change a TON of attributes for this
tree!  This is pretty overwhelming with it's crappy interface, but here
is how.  Press 9.  A box will come up that says "Hard is 1".  One means
Dink can walk through it.  We don't want that.

Change HARD to 0.

Set the tree down.  (left mouse click)

Now press SPACE.  You should see a little box around the base of the
tree, this is the trees HARDBOX.  This lets you know what will be hard
or not at a glance.

Now go play dink with your ATEAM addon - you cannot walk through the
tree.  If you push against it long enough, this will activate the 'push'
sprites.  Nifty.


*** EDITTING THE HARDBOX & DEPTH DOT OF A SPRITE *****

Ok, back to the editor.  Let's say you don't like the hardbox on the
tree and want to change it.  You COULD edit the DINK.INI file with a text
editor, find the SEQUENCE and SPRITE # of that tree and change it's hardbox,
but there is an easier way.

Go into sprite edit mode - click on the tree.  Press E.  (it will go directly
to that sprites frame, instead of having to manually select it like
normal) Now, press E again.

The screen will go blank except for the tree graphic - this is where you
can set it's depth dot (the exact point that Dink walks behind this
graphic, usually about where the shadow starts) and it's hard box.

Hit TAB a few times, this is how you cycle through the different
things.  Use the arrow keys to change it.  Hold down SHIFT to move in
larger increments as usual.

Ok, you probably really don't need to change the trees hardbox, it's fine,
but I wanted to show you how to do it, because you would want to do this
with any new sequences you added.  (your own graphics)

Oh, if you want to actually save your changes, hit S.  You should hear
a dorky boing sound.  (a line has just been added to your DINK.INI to
set those attributes)


******* ATTACHING A SCRIPT TO A SPRITE ********

Ok, let's say we want to get a little more creative, and have the tree
say "ouch" if we punch it.  This is too easy.

Get into sprite edit mode and click on the tree - Now, 1 through 9
changes attributes, but there are more.  Hold down shift and press 1
through 9 to access those.  (Then go to alt when those run out...)

Press Shift-5.  It will prompt you for a DinkC script file to attach
to this object.  Type in TREE (the .C or .D will be appended!!!)

Set the sprite back down and exit the program.

Now we next to get out our handy-dandy text editor to make this script.

All scripts must reside in the STORY dir.

Go inside and create a file called "TREE.C" and edit it.

Put this in:

void hit(void)
{
 say("`4Ouch!", current_sprite);
}

Save it.  Now play the game.   The tree will say "Ouch!" when you hit it.  In
red even!  (The `4 is a color code)

What about if Dink hits the look/talk button while looking at the
tree?  Ok, add this to your tree.c file:

void talk(void)
{
say("That is a nice tree.", 1);
wait(500);
say("Thankyou, human.", &current_sprite);
}

Cool, but boring.  Ok fine.  Go back to the editor and create some
adjoining screens and put stuff on them.

*********** THE WRAP UP **************

This is really only the tip of the iceberg...  Check DINKC.TXT for info
on the scripting language.  But the best resource is to look at example
script too - check the Search For Milli Vanilli addon pack, it has
complete source.  You can also edit it's map to see how things were
connected, etc.

When you finally feel your addon is done, you can DELETE the HARD.DAT file,
(if you didn't make any changes) and ZIP it up.  (with dirs)

If no HARD.DAT exists, dink.exe will use the one in the main dink
dir.  This applies to graphics, tile bmp's, scripts and everything else.

- Seth (sethable@rtsoft.com)
