Why isnt this working
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(¤t_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(¤t_sprite, 175);
sp_script(¤t_sprite, "");
sp_notouch(¤t_sprite, 1);
sp_nohit(¤t_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);
}
}
}
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(¤t_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(¤t_sprite, 175);
sp_script(¤t_sprite, "");
sp_notouch(¤t_sprite, 1);
sp_nohit(¤t_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);
}
}
}
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().
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().
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
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

That ain't gonna fly in Windemere. Better start coding properly.