The Dink Network

Sprite won't move...

February 28th 2005, 04:09 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
void main( void )
{
int &dir;
int &xie;
int &yie;
sp_speed(&current_sprite, 2);
}

void push( void )
{
freeze(1);
&dir = sp_dir(1, -1);
&xie = sp_x(&current_sprite, -1);
&yie = sp_y(&current_sprite, -1);
if (&dir == 2)
{
&yie += 50;
}
if (&dir == 4)
{
&xie -= 50;
}
if (&dir == 6)
{
&xie += 50;
}
if (&dir == 8)
{
&yie -= 50;
}
sp_hard(&current_sprite, 1);
draw_hard_sprite(&current_sprite);
if (&dir == 2)
{
move_stop(&current_sprite , 2 , &yie , 1);
}
if (&dir == 4)
{
move_stop(&current_sprite , 4 , &xie , 1);
}
if (&dir == 6)
{
move_stop(&current_sprite , 6 , &xie , 1);
}
if (&dir == 8)
{
move_stop(&current_sprite , 8 , &yie , 1);
}
//more stuff here, but it's stuck with the movement command.

Can anyone explain why it won't move.
I've set the hardness off, gave it a speed, and every movement is "nohard". I can't see what should go wrong.

It's the ReDink v0.04 ReDMod.exe, by the way, not the original Dink.exe.
February 28th 2005, 09:26 PM
pq_frog.gif
Ric
Peasant They/Them Canada
 
There is a fair bit there to sort through. I have doubts about the local var '&dir' working right. There is an occasional bug when a local var starts with the same letter as a global var. Try changing the name of that local var, or if you use it often, make it a global var.
But first try alt/D just before that script runs (debug mode). Look in the log(it write the log in the dmod folder)at the last 'comparing' and see what var its using and what the log says after that.
March 1st 2005, 02:37 AM
wizardg.gif
Chaotic
Peasant He/Him
 
Now i'm not familiar with the ReDink engine, but are you SUUURE you gave that sprite a base_walk?
March 1st 2005, 06:15 AM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Try draw_hard_map instead of draw_hard_sprite... I think I've had problems with the latter before.
March 1st 2005, 04:21 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
It seems that brain > 17 sprites do not exactly behave like brain 0 sprites. One thing is that move[_stop](); doesn't work.