The Dink Network

script problem

August 1st 2003, 08:06 AM
duck.gif
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. ", &current_sprite);
say_stop(" Thanks.", 1);
unfreeze(1);
}

if(&result == 2);
{
say_stop("`0 First go to the left and then enter the big room, ", &current_sprite);
say_stop("`0 with the sign: 'BREAKFAST'.", &current_sprite);
unfreeze(1);
}

if(&result == 3);
{
say_stop("`0 Sir, you've been here over a week.", &current_sprite);
say_stop("`0 I'm not sending Louis again.", &current_sprite);
unfreeze(1);
}

if(&result == 5);
{
say_stop("`0 To the right, then through the door into the toilets.", &current_sprite);
unfreeze(1);
}

if(&result == 6);
{
unfreeze(1);
}

}

August 1st 2003, 09:21 AM
sob_scorpy.gif
Tyrsis
Peasant She/Her Russia
 
You have semicolons after if() - delete them

if(&result == 2);
August 1st 2003, 09:35 AM
spike.gif
Weirdo
Peasant They/Them
 
The last two ifs are for 5 and 6, you skipped 4.
August 1st 2003, 11:29 AM
fish.gif
Binirit
Peasant She/Her
 
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);
August 1st 2003, 11:57 AM
duck.gif
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!
August 1st 2003, 12:07 PM
fish.gif
Binirit
Peasant She/Her
 
No, we won't forgive you, since this is a very serious offence.
August 1st 2003, 02:31 PM
custom_fish.png
SabreTrout
Noble He/Him United Kingdom
Tigertigertiger. 
You should be executed. But let's be honest, we are all too lazy to do it...so you can go free.
August 2nd 2003, 04:46 AM
duck.gif
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!
August 2nd 2003, 05:45 AM
custom_fish.png
SabreTrout
Noble He/Him United Kingdom
Tigertigertiger. 
Methinks you will be ok.