.C
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." ¤t_sprite);
}
Help?
void talk(void)
{
say("Welcome to the town." ¤t_sprite);
}
Help?
When you create a new document, remove .txt and erplace it with .c and it will be saved as a .c file.
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.
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.
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.", ¤t_sprite);
wait(200);
say("Well duh.", 1);
wait(200);
say("`3Don't insult me!", ¤t_sprite);
}
And the game crashes if I try talking.
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.", ¤t_sprite);
wait(200);
say("Well duh.", 1);
wait(200);
say("`3Don't insult me!", ¤t_sprite);
}
And the game crashes if I try talking.
Hmm, I don't know if this is it, but change say(... to say_stop(....
I tried that. Still, it doesn't work. The screen goes black and the game dies. Strange.
Well, I broke the sentences down to more than one line. That was the problem I guess. Example:
void talk(void)
{
say_stop("`1Blablablablablablablablablablablabla",¤t_sprite);
}
I changed that to:
say_stop("`1Blablabla",¤t_sprite);
say_stop("`1Blablabla",¤t_sprite);
And so on.
void talk(void)
{
say_stop("`1Blablablablablablablablablablablabla",¤t_sprite);
}
I changed that to:
say_stop("`1Blablabla",¤t_sprite);
say_stop("`1Blablabla",¤t_sprite);
And so on.
Woah, weird. I have some talk lines longer than that. I do try to avoid it as much as possible though.
Yup, you'll find that Dink doesn't like long sentences. You have to break up dialog.
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?", ¤t_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.", ¤t_sprite);
wait(200);
say_stop("I know, but what is this area?",1);
wait(200);
say_stop("`4Yard.", ¤t_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.", ¤t_sprite);
wait(200);
say_stop("Like what?",1);
wait(200);
say_stop("`4Ultimate wisdom. I not tell hoomanz tho.", ¤t_sprite);
unfreeze(1)
}
if (&result==4)
{
say_stop("Can you teach the wisdom?",1);
wait(200);
say_stop("`4No. Bye now!", ¤t_sprite);
wait(200);
say_stop("Oh.",1);
unfreeze(1)
}
I also tried adding return; but that didn't help.
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?", ¤t_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.", ¤t_sprite);
wait(200);
say_stop("I know, but what is this area?",1);
wait(200);
say_stop("`4Yard.", ¤t_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.", ¤t_sprite);
wait(200);
say_stop("Like what?",1);
wait(200);
say_stop("`4Ultimate wisdom. I not tell hoomanz tho.", ¤t_sprite);
unfreeze(1)
}
if (&result==4)
{
say_stop("Can you teach the wisdom?",1);
wait(200);
say_stop("`4No. Bye now!", ¤t_sprite);
wait(200);
say_stop("Oh.",1);
unfreeze(1)
}
I also tried adding return; but that didn't help.
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.
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.
Also remember a space either side of ==, ie.
if(&result == 2)
not:
if(&result==2)
if(&result == 2)
not:
if(&result==2)