The Dink Network

Why isnt this working

April 13th 2004, 02:33 PM
pillbug.gif
Oh this looks realy realy ugly on here, but i need help. This script stops working after the chest opens and dink stands their still frozen. I put a comment in where i think the script hiccups. Any help will be kindly rewareded

void hit( void )
{
if (&missions < 4)
{
freeze(1);
freeze(&guard);
say_stop("`2Get away from that!", &guard);
wait(200);
say_stop("Sorry", 1);
wait(1);
unfreeze(1);
unfreeze(&guard);
}

if (&missions == 4)
{
freeze(1);
int &hold = sp_editor_num(&current_sprite);
if (&hold != 0)
{
//this was placed by the editor, lets make the chest stay open
editor_type(&hold, 4);
editor_seq(&hold, 175);
editor_frame(&hold, 4);
//type means show this seq/frame combo as background in the future
}
sp_seq(&current_sprite, 175);
sp_script(&current_sprite, "");
sp_notouch(&current_sprite, 1);
sp_nohit(&current_sprite, 1);
//im guessing it dies here because dink never says the next line but the graphic changes.
say_stop("There is a stachel full of swords in here!", 1);
wait(200);
int &acrap = free_items();
if (&acrap < 2)
{
say_stop("I dont have room for the swords though!.", 1);
else
{
say_stop("Drake will be glad i got these", 1);
wait(200);
say_stop("I'll just keep one for myself", 1);
wait(200);
add_item("item-sw1", 257, 1);
add_item("item-stach", 444, 1);
playsound(10, 22050, 0, 0, 0);
say("dang sombody is coming", 1);
unfreeze(1);
}
}


}
April 13th 2004, 02:56 PM
pq_frog.gif
Ric
Peasant They/Them Canada
 
after: say_stop("I dont have room for the swords though!.", 1);
you need a closing bracket (}) before the else.
Personaly, I avoid using else, I would rather use "return" at the end of the previous if().
April 13th 2004, 08:12 PM
pillbug.gif
I had a bracket there earlier and it still didn't work and i have else in other scripts and dont have brackets on it and it works
April 13th 2004, 08:48 PM
pq_frog.gif
Ric
Peasant They/Them Canada
 
It was the only thing I could see. It otherwise looks good. And many things work sometimes. That was one thing about the Dink engine that bugged me was that it is unstable. There are many different ways to script an idea, experiment and good luck
April 13th 2004, 08:56 PM
wizardb.gif
merlin
Peasant He/Him
 
That ain't gonna fly in Windemere. Better start coding properly.
April 13th 2004, 10:54 PM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
Try moving the &hold stuff about background to after all the other stuff with Dink has happened. Setting editor_type before the rest of the script has finished may well kill the script... I'm not sure... can't test it myself.