The Dink Network

Reply to Re: talking

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
August 24th 2004, 03:58 AM
pig.gif
if you want to make some thing talk, its quite easy, try this:

(important note, &curent_sprite is & current _ sprite without the spaces, sorry its a bug in the board.)

the first thing you do, (assuming you already have a dmod skeleton and know how toedit your map) is to go into dinkedit, and pick up a sprite, then press shift and 5, and write something in the box that will apear, like rock, or tree (you'l need to remember what you wrote). you then press enter, and leave dinkedit. then open your skeleton folder, then go into the story directory, and create a note pad file, then enter the following;

void talk (void)
{
say("hi rock your my friend! i like rocks.", 1);
}

this would make dink say hi rock your my friend! i like rocks when you went near it and pressed spacebar. if you want the rock to say something back, its simple. you just write ¤t_sprite instead of 1. eg;

void talk (void)
{
say("hi rock your my friend! i like rocks.", 1);
say("`4thanks dink i like humans to, lets make a cheesy dmod about that", &curent_sprite);
}

notice the "`4" before the dialog, this makes the rock speak in a different colour, (i think `4 is red) if you were to write `2 or `5 it would be a different colour. youl need to experiment with all the different numbers to see what colours they make. after that you save the txt file as rock.c (or whatever you put in when you pressed shift and 5 in dinkedit). after that, fire up your dmod and talk to the sprite you attached thecript to, and just like magic (or dink), he says the stuff you put in! but, how do you make it so dink cant move when you talk to the rock? to easy, heres how;

void talk (void)
{
freeze(1);
say_stop("hi rock your my friend! i like rocks.", 1);
say_stop("`4thanks dink i like humans to, lets make a cheesy dmod about that", &curent_sprite);
unfreeze(1);
}

see, pice of cake! but what does say_stop mean? simple, it means that whenever you press spac while talking to dink it will skip through text to make it less boring having to wait for the text to go away automaticly. (note: if you are talking to a sprite that moves, after freeze just type
freeze(&curent_sprite);

remember to unfreeze it to! that caused a lot of problems for me recently, i had to go through every script in my dmod!)

anyway, pretty easy so far? try to learn this by heart, because youl need it a lot in dmod making.

next thing, talking in other situatitions, open up the script again, (you cant open it directly, you need to load it from notepad if you follow me) simply white below what you wrote;

void hit (void)
{
freeze(1);
say_stop("`4owww, that hurt!", &curent_sprite);
say_stop("you think your sore, i just punched a rock!", 1);
unfreeze(1);
}

quite predictably that makes the rock speak if you punch it. what other commands are there?

void push (void) //not to hard to guess

void touch (void) //once again, im sure you know what i does.

void main (void) //this makes something happen when dink is in the same screen as the sprite

void die (void) //this is when the sprite dies, (can only happen if it has hitpoints)

there might be a few more, im a newbie myself, so... well good luck anyways!

edit: thats wierd, i posted twice!

edit edit: the best way to learn is to go into the develop file, and unzip mysource.zip, and look through dinks story files.

edit edit edit: (sorry) did you say tut 1 and dinkc, that are in the develop file are gone from the file?