script problem
Ok, so I was making this script (so far an easy one) but somehow I managed to screw up. Do you know what wrong with it? Because when i start about one topic, the computer gives all answers.
void talk(void)
{
freeze(1);
choice_start()
" I would like the key of my room, room 44. "
" Where can I have breakfast? "
" Can you show me my room? "
" Where are the toilets?"
" Nothing "
choice_end()
if(&result == 1)
{
say_stop("`0 Here you go, sir. ", ¤t_sprite);
say_stop(" Thanks.", 1);
unfreeze(1);
}
if(&result == 2);
{
say_stop("`0 First go to the left and then enter the big room, ", ¤t_sprite);
say_stop("`0 with the sign: 'BREAKFAST'.", ¤t_sprite);
unfreeze(1);
}
if(&result == 3);
{
say_stop("`0 Sir, you've been here over a week.", ¤t_sprite);
say_stop("`0 I'm not sending Louis again.", ¤t_sprite);
unfreeze(1);
}
if(&result == 5);
{
say_stop("`0 To the right, then through the door into the toilets.", ¤t_sprite);
unfreeze(1);
}
if(&result == 6);
{
unfreeze(1);
}
}
void talk(void)
{
freeze(1);
choice_start()
" I would like the key of my room, room 44. "
" Where can I have breakfast? "
" Can you show me my room? "
" Where are the toilets?"
" Nothing "
choice_end()
if(&result == 1)
{
say_stop("`0 Here you go, sir. ", ¤t_sprite);
say_stop(" Thanks.", 1);
unfreeze(1);
}
if(&result == 2);
{
say_stop("`0 First go to the left and then enter the big room, ", ¤t_sprite);
say_stop("`0 with the sign: 'BREAKFAST'.", ¤t_sprite);
unfreeze(1);
}
if(&result == 3);
{
say_stop("`0 Sir, you've been here over a week.", ¤t_sprite);
say_stop("`0 I'm not sending Louis again.", ¤t_sprite);
unfreeze(1);
}
if(&result == 5);
{
say_stop("`0 To the right, then through the door into the toilets.", ¤t_sprite);
unfreeze(1);
}
if(&result == 6);
{
unfreeze(1);
}
}
You have semicolons after if() - delete them
if(&result == 2);
if(&result == 2);
And you don't have to script the 'nothing' part.
Just use the unfreeze(1); after the last if() statement, and not after every if(&result)
if (&result == 5);
{
say_stop(blah blah);
}
unfreeze(1);
Just use the unfreeze(1); after the last if() statement, and not after every if(&result)
if (&result == 5);
{
say_stop(blah blah);
}
unfreeze(1);
I'm such a fool when i get started. I only have one excuse, it's been a while since i used dinkc
and i forgot the 4, god, how was it possible!
Please forgive me!
and i forgot the 4, god, how was it possible!
Please forgive me!



No, we won't forgive you, since this is a very serious offence.

You should be executed. But let's be honest, we are all too lazy to do it...so you can go free.

Well, i never thought i'd say this, but lazyness saved my life! And if I ever dare to make such mistakes again, let's hope nobody gave up being lazy!
