📧 Message Board Archive

Blocker Script problem
Hi folks,



I'm slowly teaching myself dink c and have quite a few scripts done for the dmod I'm making to teach myself but one simple blocker script is causing me trouble.  I read the author files (have made a small book with all of the author tutorials everybody has provided - my thanks to everyone that has published) I even cut and pasted from one tutorial straight into the script but it still doesn't work.  Dink hits the block (a table in this case that has had the hardblock area enlarged and then I nibbled away the graphic until it was gone.  I did not make the sprite type 2.)  he says the line, does not move away from the block but seems to get stuck at it.  Then the keyboard controls fail and I can't get him out.  It's unrecoverable at that point.  The script should be easy, I'm just doing something wrong.  It is ;



//blocked bridge - SK



void main(void)

{    

sp_touch_damage(&current_sprite, -1);

}

void touch(void)

{

freeze(1);    

move_stop(1, 6, 190, 1);    

sp_dir(1, 4);    

say_stop(""I'm not strong enough yet", 1);    

unfreeze(1); }



Thanks in advance for your help guys.



SK
Re: Blocker Script problem
: Hi folks,



: I'm slowly teaching myself dink c and have quite a few scripts done for the dmod I'm making to teach myself but one simple blocker script is causing me trouble. I read the author files (have made a small book with all of the author tutorials everybody has provided - my thanks to everyone that has published) I even cut and pasted from one tutorial straight into the script but it still doesn't work. Dink hits the block (a table in this case that has had the hardblock area enlarged and then I nibbled away the graphic until it was gone. I did not make the sprite type 2.) he says the line, does not move away from the block but seems to get stuck at it. Then the keyboard controls fail and I can't get him out. It's unrecoverable at that point. The script should be easy, I'm just doing something wrong. It is ;



: //blocked bridge - SK

: void main(void)

: {

: sp_touch_damage(&current_sprite, -1);

: }

: void touch(void)

: {

: freeze(1);

: move_stop(1, 6, 190, 1);

: sp_dir(1, 4);

: say_stop(""I'm not strong enough yet", 1);

: unfreeze(1); }



Try moving that } down onto it's own line.



: Thanks in advance for your help guys.

: SK



What redink said is true too, though. If dink is already to the right of "160" (about 1/4 across the screen) then he won't go anywher.
Re: Blocker Script problem
: Hi folks,



: I'm slowly teaching myself dink c and have quite a few scripts done for the dmod I'm making to teach myself but one simple blocker script is causing me trouble. I read the author files (have made a small book with all of the author tutorials everybody has provided - my thanks to everyone that has published) I even cut and pasted from one tutorial straight into the script but it still doesn't work. Dink hits the block (a table in this case that has had the hardblock area enlarged and then I nibbled away the graphic until it was gone. I did not make the sprite type 2.) he says the line, does not move away from the block but seems to get stuck at it. Then the keyboard controls fail and I can't get him out. It's unrecoverable at that point. The script should be easy, I'm just doing something wrong. It is ;



: //blocked bridge - SK



: void main(void)



: {



: sp_touch_damage(&current_sprite, -1);



: }



: void touch(void)



: {



: freeze(1);



: move_stop(1, 6, 190, 1);



: sp_dir(1, 4);



: say_stop(""I'm not strong enough yet", 1);



: unfreeze(1); }



: Thanks in advance for your help guys.



: SK



Where is the blocker in relation to the screen and Dink?  See the pic link below for about where the bridge should be (it could vary on the y axis)
Re: Blocker Script problem


: Where is the blocker in relation to the screen and Dink? See the pic link below for about where the bridge should be (it could vary on the y axis)



Yep, the bridge is about where you have it and the blocker sprite is just hanging halfway on the bank and half way on the bridge.  



That } was on a seperate line, sorry.   SK



Found Blocker Script problem!!
Sorry Redink, I thought the picture link was just right when I responded but then I had a good look in edit mode and found that it was at about x=350 instead of what I had down.  Changed that value and it worked fine.  Well, that's what learning is all about I suppose.  Thanks to Paul and yourself for helping me out.  I'm sure there will be many more times to come. ;)  SK