The Dink Network

Slow Ride

March 16th 2010, 12:00 PM
dragon.gif
Quiztis
Peasant He/Him Sweden bloop
Life? What's that? Can I download it?! 
Is there some way to slow down a brain creature when it walks over a sprite? Like a pillbug moving over a patch of grass, it's speed is reduced by 1 (If its speed is 2 by standard) and when it leaves the box of the grass the speed is returned to normal. Any ideas?
March 16th 2010, 01:21 PM
spike.gif
Sure, but it could get moderately complicated... You could give the grass a missile brain, and check if the pillbug is walking over it in void damamge(), and slow him down for 250 milliseconds or something. The damage() procedure would run over and over again so he would stay slowed down as long as he's on the grass (maybe- it might be jumpy). Actually speeding the pillbug up only when he leaves the patch of grass should be more difficult (or ugly with loops and such ).
March 16th 2010, 01:54 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
Edit: Scratcher seemed to have snuck in while I was testing out my code

You mean like inside_box(int x, int y, int left, int top, int right, int bottom). You'd have to do a loop and possibly get_next_sprite_with_this_brain() to check all brain whatever monsters, but it could work. Use sp_custom() to keep track of who's speed has been modified to fix it later on. You'd need to do custom boxes to make it work in a lot of areas though.

Using a missile's damage procedure could also work. It could spawn a script to reduce speed, wait, then set it back. As long as the thing is touching the missile sprite, then the speed of it should keep being set lower. Well it has a few bugs though. The enemy's hit sound will constantly play when touching it, and I think it will force the enemy to target Dink if it touches the grass.

//missile brain
void main ()
{
int &b_speed
int &cur_speed;
sp_brain(&current_sprite,11);
sp_seq(&current_sprite,-1);
}

void damage ()
{
&b_speed = sp_custom("basespeed",&missile_target,-1);
 if (&b_speed == 0)
 {
 &b_speed = sp_speed(&missile_target,-1);
 sp_custom("basespeed",&missile_target,&b_speed);
 }
&cur_speed = sp_speed(&missile_target,-1);
  if (&cur_speed == &b_speed)
  {
   if (&cur_speed > 1)
   {
   &cur_speed -= 1;
   sp_speed(&missile_target,&cur_speed);
   
   &save_x = &missile_target;
   spawn("reset_spd")
   }
  }

}

//reset_spd
void main ()
{
script_attach(0);
int &sprite = &save_x;
wait(100);
int &speed = sp_custom("basespeed",&sprite,-1);
sp_speed(&sprite,&speed);
kill_this_task();
}
March 16th 2010, 01:59 PM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
How is the dmod going anyway? Will it be released for this RRR?
March 16th 2010, 04:19 PM
dragon.gif
Quiztis
Peasant He/Him Sweden bloop
Life? What's that? Can I download it?! 
Hopefully yes, there's still some tweaking to do. It will be a hard DMOD if you don't get the bonuses from the secret locations. Kinda linear story and tough boss battles, there's also a secret ending.

Thanks for your answers so far, I'll get tweaking tomorrow.