The Dink Network

Coding error

January 28th 2006, 01:43 AM
duckdie.gif
I attached this script to one of redink1's trees, and the script works like a charm except for the fact the bloody thing goes ahead and sings anyway regardless of whether you choose to ignore it or not. I can't see any errors, can anyone else?

void talk(void)

{
freeze(1);
choice_start();
"Ask for directions"
"Ignore the tree for now"
choice_end();

if(&result==1)
{
say_stop("`7It was twenty years ago today", &current_sprite);
say_stop("`7That Sergeant Pepper taught the band to play",&current_sprite);
wait(200);
say_stop("What's up?", 1);
wait(200):
say_stop("`7And a stranger stopped to ask the way...", &current_sprite);
wait(200);
say_stop("Which way is Swinetown?", 1);
wait(200);
say_stop("`7Somewhere, over the rainbow-", &current_sprite);
wait(200);
say_stop("What?", 1);
wait(200);
say_stop("`7Way up high...", &current_sprite);
say_stop("`7And he failed to realise it was very nigh...", &current_sprite);
}

unfreeze(1);
return;

}
January 28th 2006, 02:01 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
I believe the choice statement doesn't need a semicolon. I believe this will work:

choice_start()
"Ask for directions"
"Ignore the tree for now"
choice_end()
January 28th 2006, 03:44 AM
spike.gif
if(&result==1) doesn't seem to have spaces. It should look like this:

if (&result == 1)

And yeah, the semicolons need not be there.
January 28th 2006, 04:57 AM
duckdie.gif
Thank you!