📧 Message Board Archive

QUESTION 11
OK,

why does void touch not work in me dmod??

i see that it's there in a lot of the original dink scripts, but when i put it in my sctipt, in this format, EXACTLY:-



void touch ( void )

and then whatever i tell it to do on touching, never happens when i touch it.

WHY????????????/;(
Re: QUESTION 11
: OK,



: why does void touch not work in me dmod??



: i see that it's there in a lot of the original dink scripts, but when i put it in my sctipt, in this format, EXACTLY:-



: void touch ( void )



: and then whatever i tell it to do on touching, never happens when i touch it.



: WHY????????????/;(



Have you set

 sp_touch_damage(& current_sprite, -1) ;

in the main procedure
Re: QUESTION 11
Indeed, touch damge MUST BE -1



Also, touch scripts for me never worked with hardness 1.



I don't know if that is normal...



Re: QUESTION 11
: Indeed, touch damge MUST BE -1



Actually, a positive number works too. But that means it will hurt Dink. For example slimes have a touch damage of 6 and a void touch( void ) function that plays a slurp sound. So when Dink touches them he both takes damage and gets a slurp sound.



: Also, touch scripts for me never worked with hardness 1.

: I don't know if that is normal...



Monsters are hardness one...
Re: QUESTION 11
: Indeed, touch damge MUST BE -1



Actually, a positive number works too. But that means it will hurt Dink. For example slimes have a touch damage of 6 and a void touch( void ) function that plays a slurp sound. So when Dink touches them he both takes damage and gets a slurp sound.



: Also, touch scripts for me never worked with hardness 1.

: I don't know if that is normal...



Monsters are hardness one...
No, really...
I have no idea why it didn't work then... maybe it was what was run in touch()



{

if (&flying == 0)

{

freeze(1);

say("I can't swim", 1);

wait(200);

fade_down()

&player_map = 368;

update stuff

fade_up();

unfreeze(1);

}



When I put in diagnostic code at the start of touch(), it wouldn't run the diagnostic.



Only when hardness was 0 did it run.
Re: No, really...
: Only when hardness was 0 did it run.



That's funny, becuase I have a very simliar script in my d-mod and it works fine even though it's not hard.



void main( void )

{

sp_touch_damage(&current_sprite, -1);

sp_nodraw(&current_sprite, 1);

sp_nohit(&current_sprite, 1);

}



void talk( void )

{

say("Doesn't look too safe", 1);

}



void touch( void )

{

if (&nofall == 1)

 return;

&nofall = 1;

sp_touch_damage(&current_sprite, 0);

&dinkx = sp_x(1, -1);

&dinky = sp_y(1, -1);



playsound(35, 20000, 3000, 0, 0);

sp_disabled(1, 1);

&life -= 3;

if (&life < 1)

{

 say_stop_xy("'%You drown in the freezing water.", 20, 200);

 return;

}

wait(1000);

spawn("crakwait");

sp_disabled(1, 0);

say("'3d-Damnn th-thatz cOld!", 1);

sp_touch_damage(&current_sprite, -1);

}



Feel free to use that as a base or something if you think it will help... though I don't know why it would.
Re: No, really...
: That's funny, becuase I have a very simliar



VERY similar indeed... A flying-type spell has been a while in coming.



My screwing with dink's flight must have somehow done something... Maybe I should remove the global flight variable and just call dink's flight status locally...  Not that you did.
Re: No, really...
: : That's funny, becuase I have a very simliar



: VERY similar indeed... A flying-type spell has been a while in coming.



: My screwing with dink's flight must have somehow done something... Maybe I should remove the global flight variable and just call dink's flight status locally... Not that you did.



Mine isn't really flight BTW, &nofall just gets set when dink falls in (in crakwait.c) and then unset after a second or two. That's to give him a chance to step away. Still, same princaple. I donno why yours doesn't work without it being hard.



Is that a problem in your d-mod BTW? Or just strange?
Weird
The water was a problem in my mod... but then I reformatted the water.  Now it's only around the edges, which is no problem.