The Dink Network

Script help- riddles

October 29th 2002, 04:53 PM
peasantmb.gif
I'm trying to make a riddle with choice_start(); proc.

And with watever I use (goto and some things like that) or all choices are right or all choices are wrong.

What might be happening?
October 29th 2002, 05:19 PM
wizardg.gif
Paul
Peasant He/Him United States
 
: I'm trying to make a riddle with choice_start(); proc.

: And with watever I use (goto and some things like that) or all choices are right or all choices are wrong.

: What might be happening?

I donno, could you post the relevant code? Just put "what color is the sky? Red, Blue or Green." or something like that if you don't want to give away the real riddle.

October 29th 2002, 05:39 PM
peasantmb.gif
: : I'm trying to make a riddle with choice_start(); proc.

: : And with watever I use (goto and some things like that) or all choices are right or all choices are wrong.

: : What might be happening?

: I donno, could you post the relevant code? Just put "what color is the sky? Red, Blue or Green." or something like that if you don't want to give away the real riddle.

Yeah, it's REALLY complex for me. Well, here is the entire script.

void main (void)

{

int &rcrap = sp(14);

if (&riddle == 1)

{

sp_active(&rcrap, 0);

sp_hard(&rcrap, 1);

draw_hard_map(&rcrap);

}

}

void talk (void)

{

if (&riddle == 0)

{

freeze(1);

say_stop("'0What do you want, human?", &current_sprite);

wait(250);

say_stop("Huh? You can talk?", 1);

say_stop("'0Of course I do, I'm a magic post.", &current_sprite);

wait(250);

say_stop("'0And I'm supposed to give you a riddle.", &current_sprite);

say_stop("Oh dang.", 1);

wait(250);

choice_start();

set_y 240

set_title_color 2

title_start();

//It's not the real riddle, not giving it away

"What color is the banana?"

title_end();

"Red"

"Blue"

"Black"

"Green"

"Orange"

"Yellow"

choice_end();

if (&result == 1)

{

say_stop("'0WRONG!", &current_sprite);

unfreeze(1);

return;

}

if (&result == 2)

{

say_stop("'0WRONG!", &current_sprite);

unfreeze(1);

return;

}

if (&result == 3);

{

say_stop("'0WRONG!", &current_sprite);

unfreeze(1);

return;

}

if (&result == 4)

{

say_stop("'0WRONG!", &current_sprite);

unfreeze(1);

return;

}

if (&result == 5)

{

say_stop("'0WRONG!", &current_sprite);

unfreeze(1);

return;

}

if (&result == 6)

{

goto pass;

}

pass:

say_stop("'0HA!, busted. Ok, seriously...", &current_sprite);

say_stop("'0Well choosen human.", &current_sprite);

sp_kill(&rcrap, 1);

playsound(43, 22050, 0, 0, 0);

sp_hard(&rcrap, 1);

draw_hard_map(&rcrap);

unfreeze(1);

}

}

I have tried with else proc too, but didn't work.
October 29th 2002, 06:35 PM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
Interesting... at first glance nothing seems wrong... but maybe you don't need the ";" after choice_start()
October 29th 2002, 08:20 PM
wizardg.gif
Paul
Peasant He/Him United States
 
Found it

if (&result == 3);

{

say_stop("'0WRONG!", &current_sprite);

unfreeze(1);

return;

}

See that ; on the if line?

Don't feel bad though, little mistakes like this often are the hardest to find.

BTW, you don't need all those ifs, if they really say he same thing, just have and if for the right answer and put the response for wrong in an else like this:

if (&result == 6)

{

say_stop("'0Right!", &current_sprite);

} else

{

say_stop("'0Wrong!", &current_sprite);

}

I don't quite see why you're using that goto either, or was that an atempt to fix the proglem you were having?
October 30th 2002, 04:05 PM
peasantmb.gif
: Found it

: if (&result == 3);

: {

: say_stop("'0WRONG!", &current_sprite);

: unfreeze(1);

: return;

: }

: See that ; on the if line?

: Don't feel bad though, little mistakes like this often are the hardest to find.

: BTW, you don't need all those ifs, if they really say he same thing, just have and if for the right answer and put the response for wrong in an else like this:

: if (&result == 6)

: {

:  say_stop("'0Right!", &current_sprite);

: } else

: {

:  say_stop("'0Wrong!", &current_sprite);

: }

: I don't quite see why you're using that goto either, or was that an atempt to fix the proglem you were having?

AAhhhhh dangnn. Just some little error like it, oh well....

One more thing, the else proc didn't work...somehow.

And yes, the goto was a "try" to fix the problem, couldn't find it out.

Thanks a lot