The Dink Network

more trouble with these dang scripts

April 25th 2005, 08:26 AM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
i need help with this dang script, its for a very inportant blocker, but it freezes when &wife says "`1 Dink". i couldn't find anything wrong with it, but mabe i missed something...

void main ( void )
{
preload_seq(251);
preload_seq(253);
preload_seq(257);
preload_seq(259);
int &wife = create_sprite(435, 200, 16, 251, 4);
sp_script(&wife, "wife");
sp_base_walk(&wife, 250);
sp_timing(&wife, 33);
sp_speed(&wife, 1);

sp_touch_damage(&current_sprite, -1);

}

void touch ( void )
{

freeze(1);
freeze(&wife);
say_stop_npc("`1 Dink", &wife);
wait(200);
sp_dir(1,8);
wait(400);
say_stop_npc("Yes Alyssa?", 1);
wait(400);
say_stop_npc("`1 Will you go to the store and buy some milk?", &wife);
wait(400);
say_stop_npc("`1 We just ran out", &wife);
wait(400);
say_stop_npc("Anything for you my lovely wife", 1);
wait(200);
sp_dir(1, 2);

sp_touch_damage(&current_sprite, 0);

kill_this_task();

}

all help will be greatly appriciated
-rabidwolf9
April 25th 2005, 08:31 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
Use say_stop instead of say_stop_npc. You'll rarely need say_stop_npc, that's when you want to have a NPC talking in the background where Dink doesn't interfere with the conversation: ie, they talk in the background and Dink does other things, pressing spacebar won't change the NPC's conversation.

Edit: more importantly, change the sp_touch_damage of the blocker to sp_touch_damage(&current_sprite, 0); before the whole code and back to -1 after the whole code. Because you freeze Dink when touching the sprite, it'll constantly trigger this script so it'll crash Dink. Also, the kill_this_task(); code doesn't seem necessary to me in a blocker script because you'd want the blocker to function every time Dink touches it.
April 25th 2005, 08:44 AM
spike.gif
Well, say_stop_npc can be annoying unless it's a cutscene you don't want the player to be able to skip. You should propably give the girl a different colour voice too, `1 is the same as Dink's and you don't need the colour code since it's the default colour.
April 25th 2005, 08:52 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
Actuall, `1 is light magenta and `!, `@ and `$ give the same as Dink
April 25th 2005, 08:53 AM
spike.gif
really?? I guess I never looked close enough...
April 25th 2005, 08:59 AM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
i did lyke you said...
i even fixed this line
sp_dir(1,8);
but it still freezes at the same point
April 25th 2005, 09:08 AM
spike.gif
void main ( void )
{
preload_seq(251);
preload_seq(253);
preload_seq(257);
preload_seq(259);
int &wife = create_sprite(435, 200, 16, 251, 4);
sp_script(&wife, "wife");
sp_base_walk(&wife, 250);
sp_timing(&wife, 33);
sp_speed(&wife, 1);

sp_touch_damage(&current_sprite, -1);

}
void touch ( void )
{
sp_touch_damage(&current_sprite, 0);
freeze(1);
freeze(&wife);
say_stop_npc("`1 Dink", &wife);
wait(200);
sp_dir(1,8);
wait(400);
say_stop_npc("Yes Alyssa?", 1);
wait(400);
say_stop_npc("`1 Will you go to the store and buy some milk?", &wife);
wait(400);
say_stop_npc("`1 We just ran out", &wife);
wait(400);
say_stop_npc("Anything for you my lovely wife", 1);
wait(200);
sp_dir(1, 2);

}

Like this, there's no way this script should crash Dink. Perhaps the wife script?

by the way, you don't unfreeze either of them at the end of the script.

EDIT: if you want to give the touch damage back at the end, you propably want to move Dink away from the blocker too or the script will loop forever.
April 25th 2005, 09:19 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
void main(void)
{
preload_seq(251);
preload_seq(253);
preload_seq(257);
preload_seq(259);
int &wife = create_sprite(435, 200, 16, 251, 4);
sp_script(&wife, "wife");
sp_base_walk(&wife, 250);
sp_timing(&wife, 33);
sp_speed(&wife, 1);
sp_touch_damage(&current_sprite, -1);
}

void touch(void)
{
sp_touch_damage(&current_sprite, 0);
freeze(1);
freeze(&wife);
say_stop("`1Dink", &wife);
wait(200);
sp_dir(1,8);
wait(400);
say_stop("Yes Alyssa?", 1);
wait(400);
say_stop("`1Will you go to the store and buy some milk?", &wife);
wait(400);
say_stop("`1We just ran out", &wife);
wait(400);
say_stop("Anything for you my lovely wife", 1);
wait(200);
move command here - away from the blocker
sp_dir(1, 2);
unfreeze(1)
unfreeze(&wife)
sp_touch_damage(&current_sprite, -1);
}
April 25th 2005, 09:27 AM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
ok its fixed now
i think it was b/c this needed to be the first line of void touch ( void )

sp_touch_damage(¤t_sprite, 0);

thank you everybody

-rabidwolf9

here's the finished script(may put back in say_stop_npc)

void main ( void )
{
preload_seq(251);
preload_seq(253);
preload_seq(257);
preload_seq(259);
int &wife = create_sprite(435, 200, 16, 251, 4);
sp_script(&wife, "wife");
sp_base_walk(&wife, 250);
sp_timing(&wife, 33);
sp_speed(&wife, 1);

sp_touch_damage(&current_sprite, -1);

}

void touch ( void )
{
sp_touch_damage(&current_sprite, 0);

freeze(1);
freeze(&wife);
say_stop("`1 Dink", &wife);
wait(200);
sp_dir(1, 8);
wait(400);
say_stop(" Yes Alyssa?", 1);
wait(400);
say_stop("`1 Will you go to the store and buy some milk?", &wife);
wait(400);
say_stop("`1 We just ran out", &wife);
wait(400);
say_stop(" Anything for you my lovely wife", 1);
wait(400);
sp_dir(1, 2);
unfreeze(1);
unfreeze(&wife);

kill_this_task();
}