The Dink Network

The noob needs help, AGAIN

August 24th 2006, 01:26 PM
custom_marpro.png
Marpro
Peasant He/Him bloop
 
Hi and sorry for bothering you all with my lazy questions... Anyway I have some problems with my script... It runs almost perfectly, but when it comes to the last part the script freezes! I've marked the place there the script freezes with , the part with does NOT work... dunno why. Maybe you who reads this know?

sp_active(&current_sprite, 0);
int &suprise1 = create_sprite(&witch_x,&witch_y, 0, 167, 1);
sp_seq(&suprise1, 167);
playsound(24, 22052, 0, 0, 0);
wait(500);
sp_active(&suprise1, 0);
wait(200);
say_stop("AAAAAAA", 1);
say_stop("AAAAAAAA", 1);
wait(100);


unfreeze(1);
&story = 3;

}
August 24th 2006, 03:25 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
sp_active(); will kill the sprite the script is attached to and that causes the script to be killed and a dead script doesn't work

Do this:

sp_active(&current_sprite, 0);
script_attach(1000);
int &suprise1 = create_sprite(&witch_x,&witch_y, 0, 167, 1);
sp_seq(&suprise1, 167);
playsound(24, 22052, 0, 0, 0);
wait(500);
sp_active(&suprise1, 0);
wait(200);
say_stop("AAAAAAA", 1);
say_stop("AAAAAAAA", 1);
wait(100);

unfreeze(1);
&story = 3;

kill_this_task();
}

This will attach the script to nothing which will make sure it will continue to run properly. And don't forget the kill_this_task(); command at the end if you don't want memory trouble...
August 24th 2006, 03:33 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
I'm even surprised a sprite got created, as &current_sprite got killed right before it.
August 24th 2006, 03:55 PM
custom_marpro.png
Marpro
Peasant He/Him bloop
 
Yepp, it works like it should now! Thanks!