The Dink Network

Help with a Script

September 8th 2011, 11:40 PM
pillbug.gif
Pillbug
Peasant He/Him United States
Love! True love! 
Hello. After fiddling with this for a while, I have gotten all of the script to work except for the seat choosing problem. Please take a look and see if you can find what's wrong.

void friday()
{
int &bowl = get_sprite_with_this_brain(bowl);
int &cereal = get_sprite_with_this_brain(cereal);

if(&bowl == 1)
{
    if(&cereal == 1)
    {
    goto seat;
    }
}

if(&cereal == 1)
    {
    if(bowl == 1)
    {
    goto seat;
    }
}

seat:
choice_start();
set_y 240
set_title_color 3
title_start();
"Which seat should I take?"
title_end();
"Kick it in the Front Seat"
"Kick it in the Back Seat"
choice_end();

if(&result == 1)
{
&seat = 1;
goto partyin;
}

if(&result == 2)
{
&seat = 2;
goto partyin;
}

partyin:
if(&partyin < 2)
{
&partyin += 1;
goto partyin;

}

else
{
goto yeah;
}

yeah: 
say_stop("Yeah!",1);
goto partyin;

}
September 9th 2011, 12:11 AM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
What exactly doesn't work? Looking at the script in morning dizzyness, I can't spot any mistake. Not gonna guarantee, but sometimes when making choices, I just screw around with the amount of the curly brackets and it starts working.
September 9th 2011, 01:02 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
Oh, NOW YOU'VE DONE IT! 
*slow clap*
September 9th 2011, 04:23 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
I'm totally confused as to what this script actually does...

First of all get_sprite_with_this_brain() takes two integers as parameters, so having the text 'bowl' or 'cereal' there should always return 0.

Secondly you compare the sprite numbers to 1 next, this would imply that the sprite is Dink. That can be known in advance since Dink is the only one with a brain 1. Also the check is a bit superfluous as the only thing it does is a goto command to a place it would goto anyway. As it is you could just as well remove this entire part as it does absolutely nothing, even when the get_sprite_with_this_brain() part is fixed:

if(&bowl == 1)
{
    if(&cereal == 1)
    {
    goto seat;
    }
}

if(&cereal == 1)
    {
    if(bowl == 1)
    {
    goto seat;
    }
}


In the same way you can remove the goto commands to partyin in this part:

if(&result == 1)
{
&seat = 1;
goto partyin;
}

if(&result == 2)
{
&seat = 2;
goto partyin;
}

Also, I don't see you having declared &seat anywhere. I assume this is a global then?
September 9th 2011, 08:00 AM
pillbug.gif
Pillbug
Peasant He/Him United States
Love! True love! 
I based it off of the song Friday I got bored and made a fake script. I would never knowingly let Rebecca Black in my D-Mod.
September 9th 2011, 08:01 AM
wizardg.gif
Really? Friday pillbug, really?
September 9th 2011, 10:25 AM
duck.gif
I'm totally confused as to what this script actually does...

metatarasal, your post is funny.