The Dink Network

Pushing

September 9th 2009, 11:19 AM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
So, I want dink to push a rock to reveal a hidden cave. How should I do to make the program know in witch direction dink is pushing from?
September 9th 2009, 12:29 PM
dinkdead.gif
You can use sp_dir() to find out which way Dink is facing. For example if you want the rock to be moved from left to right only:

void push (void)
{
  int &dir = sp_dir(1, -1);
  if (&dir == 6)
  {
    //move rock change hardness etc
  }
  else
    say("I can't move it...", 1);
}
September 9th 2009, 01:37 PM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
This isn't working :/

void push (void)
{
int &dir = sp_dir(1, -1);
if (&dir == 6)
{
sp_hard(&current_sprite, 1);
draw_hard_map();
move_stop( &current_sprite, 6, 401, 1);
sp_hard(&current_sprite, 0);
draw_hard_map();
}
else
say("I can't push it in this direction...", 1);
}
September 9th 2009, 01:58 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Have you given the rock a speed higher than 0?
September 9th 2009, 02:09 PM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
Hmmm... either what Meta said, and you also have a space beetwen
move_stop(
and
&current_sprite, 6, 401, 1);
September 9th 2009, 02:15 PM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
Oh, how stupid of me <.<
I had speed 0
anyway, it's working now
September 10th 2009, 01:53 AM
anon.gif
MsDink
Ghost They/Them
 
What stops that rock going back to where u started from (so you cant get out if its a doorway etc) The rock returns to its original location after you exit the area and effectively blocks u in? (sorry to poach yer topic iplaydink)but this particular prob is drivin me nuts too
September 10th 2009, 03:35 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Well, you probably want to use a global in that case. (At least that's the easy way out.)

Something like this:

void main (void)
{
  if (&story > 3)
  {
    sp_x(&current_sprite,401);
    draw_hard_map();
  }
}

void push (void)
{
  if (&story == 3)
  {
    int &dir = sp_dir(1, -1);
    if (&dir == 6)
    {
      sp_speed(&current_sprite,1);
      move_stop( &current_sprite, 6, 401, 1);
      &story = 4;
      draw_hard_map();
    }
    else
      say("I can't push it in this direction...", 1);
  }
}
September 15th 2009, 04:02 AM
custom_msdink.png
MsDink
Peasant She/Her New Zealand
Tag - Umm.. tag, you're it? 
Nup tried that and it wont push in any direction - Thanks anyhoo... I need to do some heavy duty readin of the ole script makin thingi ma bob
September 15th 2009, 05:19 AM
knightgl.gif
zeddexx
Peasant He/Him New Zealand
I'm pretty sure I'm worth atleast SIX goats... 
use the "hold" funtion.