The Dink Network

Reply to "Shadows of Death" script help thread

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
November 5th 2013, 10:57 PM
knights.gif
DinkKiller
Peasant He/Him United States
The world could always use more heroes 
So, I figure I'll just make one big thread to post all issues I come across that I just can't figure out. Also, this means I'm probably working on my D-mod, the newly renamed "Shadows of Death," once again.

So here is my issue: I'm trying to get this script to do something once it reaches a certain x-coordinate. I want it to dissapear, and advance the overall dungeon puzzle. For some reason it has issues with the if (&x < 20) statement. For some reason, it initiates part of the script after the if statement, so the sprite ends up moving farther than it's supposed to, and then for some reason the hardness doesn't follow it and I can't move the sprite anymore without Dink getting stuck in hardness. I seriously have no idea what's going wrong, and it's probably a simple solution that my limited understanding of DinkC just doesn't cover.

Part of the script:
void push(void)
{
 &temp = sp_dir(1, -1);
 &x = sp_x(&current_sprite, -1);
 &y = sp_y(&current_sprite, -1);

 if (&temp == 4)
 {
  freeze(1);
  &x -= 75;
  sp_hard(&current_sprite, 1);
  draw_hard_map();
  move(&current_sprite, 4, &x, 0);
  wait(1200);
  sp_hard(&current_sprite, 0);
  draw_hard_map();
//the issues begin around here
  if (&x < 20)
  {
   sp_nodraw(&current_sprite, 1);
   sp_hard(&current_sprite, 1);
   draw_hard_map();
   wait(1000);
   playsound(35, 22050, 0, 0, 0);
   wait(750);
   say_stop("Looks like that did the trick.", 1);
   &var = 1;
   unfreeze(1);
   return;
  }
  unfreeze(1);
 }
//Etc.
}