Re: Touch procedure doesn't work
I hate it when the most simple scripts don't work. I'm trying to let Dink crawl through a hole like in the original Dink, as a matter of fact I practically copied this script from the original Dink. Why doesn't it work?
void main( void )
{
preload_seq(452);
}
void touch( void )
{
say("yes!", 1);
freeze(1);
sp_x(1, 346);
sp_y(1, 343);
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 = 566;
sp_x(1, 315);
sp_y(1, 350);
load_screen(566);
draw_screen();
}
The "yes!" is for testing purposes, but Dink never says yes, nor does he crawl in the hole and teleport. What's wrong?
void main( void )
{
preload_seq(452);
}
void touch( void )
{
say("yes!", 1);
freeze(1);
sp_x(1, 346);
sp_y(1, 343);
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 = 566;
sp_x(1, 315);
sp_y(1, 350);
load_screen(566);
draw_screen();
}
The "yes!" is for testing purposes, but Dink never says yes, nor does he crawl in the hole and teleport. What's wrong?
void main( void )
{
preload_seq(452);
sp_touch_damage(¤t_sprite, -1);
}
You need to add this.
{
preload_seq(452);
sp_touch_damage(¤t_sprite, -1);
}
You need to add this.

LOL, that was kind of obvious. I wonder why the script works in Dink though, where that line isn't there. Or maybe it doesn't work, which means Dink 1.08 skipped a bug fix.
Anyway, thanks.

Anyway, thanks.

No worries. It's nice to be able to help for once - My knowledge of DinkC is pretty limited.
It's always the obvious things we don't see.
It's always the obvious things we don't see.

maybe in dink it works because the sprite was placed by the editor and it was -1'd in there(i'm not sure because) i don't know which script u copied in your quest