Help please
My script freezes my game.Why?
//The main function
void main( void )
{
//Make it so the sprite can be touched
sp_touch_damage(¤t_sprite, -1);
}
//The touch function
void touch( void )
{
//Make it so the sprite isn't touched more than once...
sp_touch_damage(¤t_sprite,0);
if (&story < 4)
{
Say("I think I'd better look around some more first!", 1);
freeze(1);
move_stop(1, 2, 200, 1);
unfreeze(1);
//Make it so we can touch it again
sp_touch_damage(¤t_sprite,-1);
}
if (&story > 3)
{
freeze(1);
sp_x(1, 261);
sp_y(1, 261);
sp_seq(1, 452);
sp_frame(1, 1);
sp_nocontrol(1, 1); //dink can't move until anim is done!
sp_touch_damage(¤t_sprite, 0);
sp_brain(1, 0);
wait(2000);
sp_brain(1, 1);
&player_map = 340;
sp_x(1, 261);
sp_y(1, 377);
load_screen(340);
draw_screen();
}
}
//The main function
void main( void )
{
//Make it so the sprite can be touched
sp_touch_damage(¤t_sprite, -1);
}
//The touch function
void touch( void )
{
//Make it so the sprite isn't touched more than once...
sp_touch_damage(¤t_sprite,0);
if (&story < 4)
{
Say("I think I'd better look around some more first!", 1);
freeze(1);
move_stop(1, 2, 200, 1);
unfreeze(1);
//Make it so we can touch it again
sp_touch_damage(¤t_sprite,-1);
}
if (&story > 3)
{
freeze(1);
sp_x(1, 261);
sp_y(1, 261);
sp_seq(1, 452);
sp_frame(1, 1);
sp_nocontrol(1, 1); //dink can't move until anim is done!
sp_touch_damage(¤t_sprite, 0);
sp_brain(1, 0);
wait(2000);
sp_brain(1, 1);
&player_map = 340;
sp_x(1, 261);
sp_y(1, 377);
load_screen(340);
draw_screen();
}
}
November 29th 2004, 01:51 PM

MiloBones


Merlin's advice seems on the money, but I'm slightly anal about this: I always use spawn() to do warps, which neccesitates an sp_active(¤t_sprite, 0); in the touched-thing's script (not such a bad idea in any case...)
Spawn()? Eww... why make a warp more complicated?
I put the unfreeze in and my screen still locked right after dink says 'I should look around..blah blah' .I'm thinking I might just scrap this script and do something a little different anyways.But thanks Merlin,your advice is muchly appreciated.

Try using say_stop() so the script waits until he's done speaking.
Have you tried debug mode?(alt-D) What are the last few lines in the debug.txt it writes while playing that?
Have you tried debug mode?(alt-D) What are the last few lines in the debug.txt it writes while playing that?
Okay,tried the stop thing...still froze up.
With debug mode on...the last line I saw
was..
Dink:if returned false,skipping next thing
Does that make any sense?
You should have seen how bad this script was before redink1 tried to help me...I think he may have laughed,it was that bad.
With debug mode on...the last line I saw
was..
Dink:if returned false,skipping next thing
Does that make any sense?
You should have seen how bad this script was before redink1 tried to help me...I think he may have laughed,it was that bad.
"Dink:if returned false,skipping next thing"
probably &story was not > 3 so the last if (if (&story > 3) skipped. Sounds normal.
Screen 340 does exist right? -nevermind, it got skipped.
This sript seem ok, what other scripts are running?
probably &story was not > 3 so the last if (if (&story > 3) skipped. Sounds normal.
Screen 340 does exist right? -nevermind, it got skipped.
This sript seem ok, what other scripts are running?
I got a couple tree scripts on that screen,but thats about it.And yeah,screen 340 is where the hole is supposed to warp you to.Meanwhile,I'm off to try and fix a few other scripts I managed to wreck.*sigh*