One important thing to remember is that almost everything is fake. For example, when I started is thought, "Well now I know how to place items in the world, now how do I make them 'pick-up-able'?" Well it turns out it's all smoke and mirrors so you speak. Dink doesn't really pick up the object at all, it's just a picture with a script attached, when dink touches it, the picture goes away and dink gets an item, but what the picture looked like doesn't even matter, it could be a table, and it would act like a pile of gold, if yo uattached that script to it.
Likewise, in your case, the girl won't really open the chest at all, you'll just have a script (perhaps attached to the girl, it doesn't matter much) make the girl walk across the room, then have the script open ther chest, then probably make the girl say, "Oh! Here's a ."
I'm doing my own DMOD as well and I don't have any programming background. Mimifish is right, the best way to learn is to plagiarize. Start off with some simple scripts like getting somebody to talk to you when you walk up and hit the talk button.
A good script that I learnt quite a lot from is s1-wiz.c in the develop directory. This is the scene in the original game where Dink first meets the wizard. There's movement, talking and creation of sprites out of thin air. It contains many of the move_stop lines that you would use to get your sprite to move across the room toward a chest. Then you might want to have a look inside one of the scripts that start with ch-xx.c. These are all the chest scripts and have the scripting for what happens when Dink hits a chest. You can pull the stuff out and make the same sequences play when your sprite gets close enough or at a particular time after the walking starts with wait statements. I don't know if I'm being much help but this is the only way I've been able to make anything happen. I have written a couple of scripts from scratch, but only now that I've been playing with scripts for a couple of months. I still think I'm at least 6 months away from putting out a small dmod.
The things I would like somebody to point me to are the details of the move_stop command. That is, each number has a meaning and a range and I've had to work it out from trial and error. A complete list would be great - like, what direction is 3 and which group of numbers is that - that kind of thing. Any way, babbled for far too long now........... Don't Give Up !!
Although it claimed that you don't need any programing experience for writing DinkC scripts, it would still be a pain in the ass for starters, even if you do have some programing experience.
Read tut1.txt and dinkc.txt. However, reading and learning things from dinkc.txt are sometimes even harder than just trying writing the scripts.
Here are some suggestions:
1. Download "Dink C Help Revision 2" by "Robert Fogt". It is basically a much more organized DinkC.txt with a lot more tutorial material.
2. Play some more dmods especially those well-written ones with .c story files available. Why? Because you might find some scenes just what you want. And then you can use dinkedit to "edit" that dmod and find what script does the job and try to learn from it.
3. Attach a simple script to a sprite and try to play it. Put say("blah blah blah", ¤t_sprite); in some place in the script to figure out if the script runs thru that part or not.
The first few days (or even weeks) might be very hard to overcome, you will get very frustrated for some simple but hard-to-kill bugs all the time. Just keep trying.
: ...sorry to the poor b@st@rd who has to read this!
: You can also blame Christiaan for these messages from me begging for help, he sent me the Dinkedit thing! ;)
: It's actually embarrasing for me having to write this, I must look like an idiot, but...
: ...how do I do this scripting thing? I've looked at the tutorials and the thing which mimifish recommended, all of which have helped me a bit, but I need to know the very basics really.
: Right, what I want to do is make some sprites walk across a screen and do an action. To be more specific I want to make a girl walk across the screen and open a chest, which she'll find something inside. I know I need to add a script but where do I type the script in and what should I type in?
: Can anyone help?
: Apologizes to anybody who I've bored with this message, sorry! :p
Have you read tut1.txt? It should be in the Develop directory in the Dink Smallwood main directory. It tells you where to place and how to make scripts better than I could do. Just in case it isn't there, I attached it below:
**** 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.", ¤t_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)