The Dink Network

pushing things

August 24th 2004, 06:58 PM
pig.gif
theres some thing im not quite getting with oblects that can be pushed. i just cant do it goddamit! anyways, i've even tryed copying scripts from dink. if somebody would explain the baisics of pushing things (and perhaps making things go away when you place a bomb beside them) it would be humungously.

EDIT: holy crap, it is an *art* to be able to spell that bad!
August 25th 2004, 01:55 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
If Dink is showing his push animation, things work just fine, but then it's the script. Here's an example push script:

void main( void )
{
int &mydir;
}

void push( void )
{
&mydir = sp_dir(1, -1);
if (&mydir != 6)
{
say("I can't push from this direction",1);
}
sp_hard(&current_sprite, 1);
draw_hard_sprite(&current_sprite);
move_stop(&current_sprite, 6, 400, 1);
sp_hard(&current_sprite, 0);
draw_hard_sprite(&current_sprite);
}

Make sure, though, that you've set push_active(1); somewhere, and that it's still 1
August 25th 2004, 10:47 AM
goblinm.gif
I quote the updated DinkC reference:

"draw_hard_sprite() adds the hardness for
the sprite's new location, but does not remove the hardness from its old one."

I've never encountered this problem since I always use draw_hard_map, so I wouldn't know if Ted is right or not. But if you still have trouble, that's something to try (draw_hard_map instead of draw_hard_sprite).
August 25th 2004, 12:17 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Dude. I've probably read that definition a few dozen times, but I never really noticed the 'but does not remove the hardness from the old one' clause.

That makes draw_hard_sprite *extremely* powerful.
August 25th 2004, 12:24 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
Heh, I encountered that "problem" before, when only using draw_hard_sprite() after moving. But now you mention it, it could be used for really cool things.