Reply to "Shadows of Death" script help thread
If you don't have an account, just leave the password field blank.
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:
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(¤t_sprite, -1); &y = sp_y(¤t_sprite, -1); if (&temp == 4) { freeze(1); &x -= 75; sp_hard(¤t_sprite, 1); draw_hard_map(); move(¤t_sprite, 4, &x, 0); wait(1200); sp_hard(¤t_sprite, 0); draw_hard_map(); //the issues begin around here if (&x < 20) { sp_nodraw(¤t_sprite, 1); sp_hard(¤t_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. }