The Dink Network

Touch procedure doesn't work

April 9th 2008, 10:55 AM
bonca.gif
Christiaan
Bard They/Them Netherlands
Lazy bum 
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(&current_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?
April 9th 2008, 11:06 AM
custom_fish.png
SabreTrout
Noble He/Him United Kingdom
Tigertigertiger. 
void main( void )
{
preload_seq(452);
sp_touch_damage(&current_sprite, -1);
}

You need to add this.
April 9th 2008, 01:58 PM
bonca.gif
Christiaan
Bard They/Them Netherlands
Lazy bum 
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.
April 9th 2008, 02:08 PM
custom_fish.png
SabreTrout
Noble He/Him United Kingdom
Tigertigertiger. 
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.
April 9th 2008, 04:05 PM
knights.gif
merder
Peasant He/Him Netherlands
The Voice in the back of your head! 
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
April 10th 2008, 02:13 AM
wizardb.gif
Phoenix
Peasant He/Him Norway
Back from the ashes 
It probably works in Dink because it was set as an editor setting instead of a script. Methinks...