The Dink Network

why does this script not work?

June 4th 2005, 10:30 AM
pig.gif
sorry to pester ye's all again, but i've got this script that just freezes dink, plays a midi, and then becomes unresponsive. I know its full of bugs, but i cant see any at the start. thanks.

void main (void)
{
playmidi("2.mid");
&fight = 1;
Freeze(1);
wait(2000);
int_&tifany = Create_sprite(210, 400, 16, 227, 1);
sp_base_walk(&tifany, 220);
sp_speed(&tifany, 1);
freeze(&tifany);
say("`4------" &tifany);
wait(2500);
say("`4-------------------------------------------------------" &tifany);
move("&tifany, 8, 200, 1);
wait(4000);
move_Stop("1, 8, 200, 1);
wait(500);
int_gaurd = Create_sprite("300, 0, 16, 293, 1);
sp_base_walk(&gaurd, 290);
sp_speed(&gaurd, 1);
move_stop("&gaurd, 2, 130, 1);
say_stop("`6-----------------------------------------------------", &gaurd);
say_stop("`4-------------------------------------------", &tifany);
say_stop("`6------------------------------------------", &gaurd);
say_stop("--------");
say_stop("-----------------------", &gaurd);
say("---------", 1);
int_gaurd2 = Create_sprite("200, 0, 16, 293, 1);
sp_base_walk(&gaurd2, 290);
sp_speed(&gaurd2, 1);
move("&gaurd2, 2, 130, 1);
int_gaurd3 = Create_sprite("400, 0, 16, 293, 1);
sp_base_walk(&gaurd3, 290);
sp_speed(&gaurd3, 1);
move("&gaurd3, 2, 130, 1);
wait(2000);
playmidi("3.mid");
&player_map = 1;
fade_down();
load_screen();
draw_screen();
fade_up();
kill_this_task();
}
June 4th 2005, 10:55 AM
pq_skull.gif
dinkme
Peasant He/Him India
 
Perhaps it is because of this:
int_&guard = create_sprite(x,y,brain,sequence,1);
it should be
int &guard
June 4th 2005, 10:57 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
void main (void)
{
playmidi("2.mid");
&fight = 1;
Freeze(1);
wait(2000);
int_&tifany = Create_sprite(210, 400, 16, 227, 1); <-- no underscore there, so: int &tifany
sp_base_walk(&tifany, 220);
sp_speed(&tifany, 1);
freeze(&tifany);
say("`4------" &tifany);
//this say command doesn't have a comma after the text
wait(2500);
say("`4-------------------------------------------------------" &tifany);
//this say command doesn't have a comma after the text
move("&tifany, 8, 200, 1);
wait(4000);
move_Stop("1, 8, 200, 1);
wait(500);
int_gaurd = Create_sprite("300, 0, 16, 293, 1);
//that should be int &gaurd ? (or &guard, no underscore at least and an ampersand is needed ) - and no " there
sp_base_walk(&gaurd, 290);
sp_speed(&gaurd, 1);
move_stop("&gaurd, 2, 130, 1);
say_stop("`6-----------------------------------------------------", &gaurd);
say_stop("`4-------------------------------------------", &tifany);
say_stop("`6------------------------------------------", &gaurd);
say_stop("--------");
//this say_stop command has no sprite to say it
say_stop("-----------------------", &gaurd);
say("---------", 1);
int_gaurd2 = Create_sprite("200, 0, 16, 293, 1);
//no underscore and an ampersand is needed, and no " here
sp_base_walk(&gaurd2, 290);
sp_speed(&gaurd2, 1);
move("&gaurd2, 2, 130, 1);
int_gaurd3 = Create_sprite("400, 0, 16, 293, 1);
//same here and no " here
sp_base_walk(&gaurd3, 290);
sp_speed(&gaurd3, 1);
move("&gaurd3, 2, 130, 1);
//no " here
wait(2000);
playmidi("3.mid");
&player_map = 1;
fade_down();
load_screen();
draw_screen();
draw_status();
//might be useful there
fade_up();
kill_this_task();
}
June 4th 2005, 10:58 AM
pq_frog.gif
Ric
Peasant They/Them Canada
 
When using play_midi();, it may be a good idea to stopmidi(); first.
Line 5;Whenever you use a freeze(), plan your unfreeze().
Line 25; include the sprite # that needs to talk.
Line 35; It helps to freeze guard2 before moving.
Debug mode can find many things too. Press Alt/D to toggle it on/off. It writes a file detailing a scripts' execution.