The Dink Network

.C

August 11th 2007, 03:48 PM
pillbug.gif
pillbug
Peasant He/Him United States
Love! True love! 
This is a stupid qestion, but I can't make something a .C file, and according to the rudiments of scriptiing it has to be a .c to work. I've named the text document sign1.c This is what I have typed inside the folder.

void talk(void)
{
say("Welcome to the town." &current_sprite);
}

Help?
August 11th 2007, 04:57 PM
fairy.gif
Glennglenn
Peasant He/Him Norway
GlennGlenn doesn't want a custom title. 
When you create a new document, remove .txt and erplace it with .c and it will be saved as a .c file.
August 11th 2007, 05:18 PM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
In any Explorer (not to be confused with IE) window:
Tools > Folder Options > Display > Remove the tick next to "Hide Common Filetypes"

Result: no more annoying hidden file types. The file will probably reveal to be "file.c.txt" and then you can easily save and remove the wrong extensions from files without problems.
August 11th 2007, 05:34 PM
pillbug.gif
pillbug
Peasant He/Him United States
Love! True love! 
Thanks. I finally a sprite to say something!
Edit: Btw, there are a couple more scripting problems I have had. If a script is long, or the conversation exceeds three scripts, then the game crashes. Here is an example.

void talk(void)
{
say("`3I am sign.", &current_sprite);
wait(200);
say("Well duh.", 1);
wait(200);
say("`3Don't insult me!", &current_sprite);
}

And the game crashes if I try talking.
August 11th 2007, 11:43 PM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
Hmm, I don't know if this is it, but change say(... to say_stop(....
August 11th 2007, 11:50 PM
pillbug.gif
pillbug
Peasant He/Him United States
Love! True love! 
I tried that. Still, it doesn't work. The screen goes black and the game dies. Strange.
August 12th 2007, 01:00 AM
pillbug.gif
pillbug
Peasant He/Him United States
Love! True love! 
Nevermind, I think I got it.
August 12th 2007, 07:30 AM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
If you think you got it, do tell us why.
August 12th 2007, 11:40 AM
pillbug.gif
pillbug
Peasant He/Him United States
Love! True love! 
Well, I broke the sentences down to more than one line. That was the problem I guess. Example:

void talk(void)
{
say_stop("`1Blablablablablablablablablablablabla",&current_sprite);
}
I changed that to:
say_stop("`1Blablabla",&current_sprite);
say_stop("`1Blablabla",&current_sprite);

And so on.
August 12th 2007, 05:04 PM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
Woah, weird. I have some talk lines longer than that. I do try to avoid it as much as possible though.
August 13th 2007, 01:49 AM
burntree.gif
Striker
Noble She/Her United States
Daniel, there are clowns. 
Yup, you'll find that Dink doesn't like long sentences. You have to break up dialog.
August 13th 2007, 11:11 AM
pillbug.gif
pillbug
Peasant He/Him United States
Love! True love! 
Oh, and one more scripting problem I found: Whenever I do a menu,
with like 3 or more questions, all of the options (including leave) say the same thing as the first option. Here is an example right out of my story file:

void talk(void)
{
freeze(1)
choice_start();
"Introduce Yourself"
"What Is This Place?"
"Who are you?"
"Ask For Him To Teach You Wisdom"
"Leave"
choice_end();

if(&result==1)
{
say_stop("Hello. I am Dink, supreme ruler of this dmod. Who are you?", 1);
wait(200);
say_stop("`4Me Henry. Me smash yer bones for yoo?", &current_sprite);
wait(200);
say_stop("No thanks, Henry.",1);
unfreez(1)
}

if(&result2==)
{
say_stop("What is this place?",1);
wait(200);
say_stop("`4This house.", &current_sprite);
wait(200);
say_stop("I know, but what is this area?",1);
wait(200);
say_stop("`4Yard.", &current_sprite);
wait(200);
say_stop("I know, but...nevermind.",1);
unfreeze(1)
}

if(&result==3)
{
say_stop("Who are you?",1);
wait(200);
say_stop("`4Me Henry. Me father and husbund. Me know lots of stuff.", &current_sprite);
wait(200);
say_stop("Like what?",1);
wait(200);
say_stop("`4Ultimate wisdom. I not tell hoomanz tho.", &current_sprite);
unfreeze(1)
}

if (&result==4)
{
say_stop("Can you teach the wisdom?",1);
wait(200);
say_stop("`4No. Bye now!", &current_sprite);
wait(200);
say_stop("Oh.",1);
unfreeze(1)
}

I also tried adding return; but that didn't help.
August 13th 2007, 12:00 PM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
Simple, you made typos:

unfreez(1) should be unfreeze(1);
if(&result2==) should be if (&result == 2)
You forgot a bunch of ;s.

You only need to unfreeze once, and that's after all conditions.

Reversing the order of checking things (if 4, then 3, then 2, then 1), or using "else if" (I'm not sure if this works in Dink) will make sure that it runs an event only once without much problems, or you might get the problem of it going through ALL conditions. You should fix the errors in your script first though.
August 14th 2007, 04:44 PM
dinkdead.gif
Also remember a space either side of ==, ie.
if(&result == 2)
not:
if(&result==2)