The Dink Network

Could someone look at this script?

March 5th 2004, 01:56 AM
duckdie.gif
In the script below, I have two problems:
1) I don't want the game to fade if Dink chooses not to go to bed, but it does.
2)If Dink takes a nap there will be a fade and the storyline is up to 1, if not the story stays at 0.
I tried to put that in, but the game just chrashed, and I don't know what to do about it. I would be very thankful if someone could show me excactly how this should be written out... I'm just starting to learn this, so excuse this basic question...

THE SCRIPT:

void talk(void)
{

freeze(1);

choice_start();
"Lie down?"
"Nah... Sleep is overrated..."
choice_end();

if(&result==1)
{
fade_down();
fill_screen(0);
say_stop("`4Dink! Wake up!", &current_sprite);
wait(200);
&player_map = 33;
sp_x(1, 300);
sp_y(1, 160);
script_attach(1000);
load_screen();
draw_screen();
draw_status();
fade_up();
unfreeze(1);

kill_this_task();
}

return;

}

void hit(void)
{
freeze(1);

say_stop("You're hard!! Soften!", 1);
wait(200);
say_stop("`4In your dreams...", &current_sprite);
unfreeze(1);

}
March 5th 2004, 02:25 AM
spike.gif
It could be some spaces in your script that screw it up... Anyway, you should do as below so that Dink is unfreezed if he chooses not to take a nap.

void talk(void)
{
choice_start()
"Lie down?"
"Nah... Sleep is overrated..."
choice_end()

if(&result == 1)
{
freeze(1);
fade_down();
fill_screen(0);
say_stop("`4Dink! Wake up!", &current_sprite);
wait(200);
script_attach(1000);
&player_map = 33;
sp_x(1, 300);
sp_y(1, 160);
load_screen();
draw_screen();
draw_status();
fade_up();
unfreeze(1);
kill_this_task();
}
return;
}
March 5th 2004, 02:33 AM
duckdie.gif
The spaces are there just to make it easier to read, so they should have nothing to say, at least according to "The Rudiments of scripting". Something else is wrong...
March 5th 2004, 02:40 AM
spike.gif
That's not what I mean, I mean the spaces before an { and after if etc.

it's impossible to say if that has anything to do with anything though, as you cannot see the spaces in the posts.
March 5th 2004, 04:08 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
Let's say ¬ is a space, then it should look like this:

if¬(&result¬==¬1)
{
//blah
}

spaces before { or } don't matter as far as I know. I don't know for sure if the spaces before and after the == are neccesary, but the one after the if is.
March 5th 2004, 05:23 AM
pq_frog.gif
Ric
Peasant They/Them Canada
 
Spaces don't matter when setting a variable, but they must be there when comparing a variable.
eg;
&story+=1;
works.

if(&result==1)
no good. Needs a space before and after the '=='.

You might also try a wait(1000); after the fade_up(); I'm not sure, but mabey it kills before it finishes the fade.
March 5th 2004, 10:34 AM
duckdie.gif
Hmm... I will try to make it work once more. Thanks!
March 6th 2004, 01:26 AM
duckdie.gif
It worked! Thanks a lot!