The Dink Network

Choices.. The heart of all evil...

June 28th 2003, 08:53 AM
pillbug.gif
I have tried so hard with this script! Only to be extremely frustrated! Please help!

VOID MAIN(VOID)
{
sp_base_walk(&current_sprite, 340);
sp_speed(&current_sprite, 1);
return;
}

VOID TALK(VOID)
{
if(&plant == 0)
{
freeze(1);
choice_start()
"Blah?"
"Return"
choice_end()

if(&choice == 1)
{
say_stop("blah",1);

wait(500);
say_stop("Well gotta go, Ramen!",1);
wait(500);
say_stop("`2Bye",&current_sprite);
unfreeze(1);
return;
}
if(&plant == 1)
{
freeze(1);
choice_start()
"Do you know where I can find a water-can?"
"You people sure are brutal, killing a pillbug so slowly with a rock..."
choice_end()
if(&choice == 1)
{
say_stop("blah",&current_sprite);
wait(2000);
say_stop("OK! You really don't need to tell me any more!",1);
wait(2000);
say_stop("`2say",&current_sprite);
unfreeze(1);
return;
}
if(&choice == 2)
{
say_stop("It fun! You want to try?",&current_sprite);
choice_start()
"Yah!"
"Are you inhumane??"
choice_end()

if(&choice == 1)
{
say_stop("Good! Me take you to kill fields!",&current_sprite);
}
}
}
}

I can see the first choice screeen but it just freezes when I answer.


June 28th 2003, 09:51 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
Well, you shouldn't use &choice, you have to use &result. If you select the first choicemenu-choice, &result becomes 1. Therefore, you should use &result to see which choice the player took.

Oh, and place a space (that rhymes) between if and (&result):

if (&result)
June 28th 2003, 10:08 AM
pillbug.gif
Thank you!
June 28th 2003, 11:03 AM
pillbug.gif
Actually, the first part of the script will work, but after &plant is set to 1, nothing happens when I talk to him. Dink doesn't say "huh?" just nothing happens. What am I doing wrong, I changed the script like you suggested.
June 28th 2003, 11:26 AM
anon.gif
illusivefing
Ghost They/Them
 
oOo, i actually see this one...put another semicolon right before it checks to see if &plant == 1
June 28th 2003, 11:55 AM
pillbug.gif
Do you mean,
;if (&plant == 1)?

Maybe it's just me with my limited aspect on scripting, but I'm pretty sure that won't work...
June 28th 2003, 12:06 PM
knightg.gif
WC
Peasant He/Him United States
Destroying noobs since 1999. 
He doesn't mean semi-colon, he means a closing bracket. Here is the fixed script with the added bracket. I also moved two returns in order to keep the script from going places it shouldn't.

VOID MAIN(VOID)
{
sp_base_walk(&current_sprite, 340);
sp_speed(&current_sprite, 1);
return;
}

VOID TALK(VOID)
{
if(&plant == 0)
{
freeze(1);
choice_start()
"Blah?"
"Return"
choice_end()

if(&result == 1)
{
say_stop("blah",1);

wait(500);
say_stop("Well gotta go, Ramen!",1);
wait(500);
say_stop("`2Bye",&current_sprite);
unfreeze(1);
}
return;
}
if(&plant == 1)
{
freeze(1);
choice_start()
"Do you know where I can find a water-can?"
"You people sure are brutal, killing a pillbug so slowly with a rock..."
choice_end()
if(&result == 1)
{
say_stop("blah",&current_sprite);
wait(2000);
say_stop("OK! You really don't need to tell me any more!",1);
wait(2000);
say_stop("`2say",&current_sprite);
unfreeze(1);
}
if(&result == 2)
{
say_stop("It fun! You want to try?",&current_sprite);
choice_start()
"Yah!"
"Are you inhumane??"
choice_end()

if(&result == 1)
{
say_stop("Good! Me take you to kill fields!",&current_sprite);
}
}
return;
}
}
June 28th 2003, 12:06 PM
goblinm.gif
trav666
Peasant He/Him
 
nunz is right, the ; closes a line

*edit*
heh, we posted at the same time
June 28th 2003, 12:42 PM
pillbug.gif
Thank you!
June 28th 2003, 01:23 PM
anon.gif
illusivefing
Ghost They/Them
 
er...oops lol the bracket is exactly what i meant, sorry about that
June 29th 2003, 04:04 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
Oh, and you don''t need a return; at the very end of void main(void), void talk(void) and other things like that.
June 29th 2003, 07:38 AM
pillbug.gif
VOID MAIN(VOID)
{
sp_base_walk(¤t_sprite, 340);
sp_speed(¤t_sprite, 1);
}

VOID TALK(VOID)
{
if (&plant == 0)
{
freeze(1);
choice_start()
"Do you know what day it is?"
"Return"
choice_end()

if (&result == 1)
{
say_stop("Hello sir! Do you have any idea when or what day it is?",1);
wait(500);
say_stop("`2When sun up. Me Ramen, like some bug? Lots for dinner!",¤t_sprite);
wait(500);
say_stop("Err, no thank you",1);
wait(500);
say_stop("`2Leader have shiny cold wood, he use for kill, me only have rock",¤t_sprite);
wait(500);
say_stop("(Hmmm.. I'd better see what he's talking about, it could be metal..) oh, I see",1);
wait(500);
say_stop("Well gotta go, Ramen!",1);
wait(500);
say_stop("`2Bye",¤t_sprite);
unfreeze(1);
}
return;
}
if (&result == 2)
{
unfreeze(1);
}
return;

if (&plant == 1)
{
freeze(1);
choice_start()
"Do you know where I can find a water-can?"
"You people sure are brutal, killing a pillbug so slowly with a rock..."
choice_end()
if (&result == 1)
{
say_stop("`2When me have to go can, me do it in cave and use leaves to..",¤t_sprite);
wait(2000);
say_stop("OK! You really don't need to tell me any more!",1);
wait(2000);
say_stop("`2whatever skinny man say",¤t_sprite);
unfreeze(1);
return;
}
if (&result == 2)
{
say_stop("`2It fun! You want to try?",¤t_sprite);
choice_start()
"Yeah!"
"Are you crazy??"
choice_end()

if (&result == 1)
{
say_stop("`2Good! Me take you to kill fields!",¤t_sprite);
fade_down();
&player_map = 206;
sp_x(1, 348);
sp_y(1, 326);
script_attach(1000);
load_screen();
draw_screen();
draw_status();
}
}
}
}

Hmm... After only very minor changes the script will still not work. Am I still doing something wrong?
June 29th 2003, 01:31 PM
wizardg.gif
Paul
Peasant He/Him United States
 
Well, I see you've got return right before "if (&plant == 1)" so that's never going to be executed. Even is plant is 1.
June 30th 2003, 09:35 AM
pillbug.gif
Thank you!
July 1st 2003, 01:51 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
And I see that &current_sprite (or &current_sprite) still has the currency character...
Will these things NEVER get fixed???
July 1st 2003, 08:39 AM
wizardg.gif
Paul
Peasant He/Him United States
 
Funny, It seems to be working in most posts, but not in Nunzilla post before my last one.