The Dink Network

Reply to Re: "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 10th 2013, 04:48 PM
knights.gif
DinkKiller
Peasant He/Him United States
The world could always use more heroes 
Okay, I am having multiple problems with my boss script and I have no idea what's going on. I have examined a couple other scripts, including ones I wrote earlier for this game as well as for DatB, and I took pieces of the scripts to fix a couple things already, but I can't seem to get the rest of it to work right. I condensed two scripts into this one, and it solved a few issues, but added at least one of these current ones.

Issues:
sp_target(&current_sprite, 1); doesn't work, boss won't target Dink.
boss's die procedure text appears in top left corner of the screen for some reason.
hit sounds are playing randomly

The whole script (minus spoilers):
void main(void)
{
 preload_seq(271);
 preload_seq(273);
 preload_seq(275);
 preload_seq(277);
 preload_seq(279);
 preload_seq(712);
 preload_seq(714);
 preload_seq(716);
 preload_seq(718);
 int &x;
 int &y;
 int &wait;
 sp_brain(&current_sprite, 10);
 sp_base_walk(&current_sprite, 270);
 sp_speed(&current_sprite, 3);
 sp_base_attack(&current_sprite, 710);
 sp_hitpoints(&current_sprite, 110);
 sp_defense(&current_sprite, 3);
 sp_strength(&current_sprite, 7);
 sp_exp(&current_sprite, 250);
 sp_timing(&current_sprite, 33);
 sp_touch_damage(&current_sprite, 4);
 sp_distance(&current_sprite, 40);
 sp_range(&current_sprite, 35);

 if (&story != 16)
 {
  sp_nodraw(&current_sprite, 1);
  sp_nohit(&current_sprite, 1);
  kill_this_task();
 }

 if (&story == 16)
 {
  screenlock(1);
  playmidi("18.mid");
  freeze(1);
  freeze(&current_sprite);
  move_stop(1, 2, 180, 1);
  wait(200);
  sp_dir(1, 4);
  if (&plot == 1)
  {
//spoiler dialogue
  }

  if (&plot == 0)
  {
//spoiler dialogue
  }
  unfreeze(1);
  unfreeze(&current_sprite);
 }
 sp_target(&current_sprite, 1);
}

void attack(void)
{
 playsound(8, 5050, 0, &current_sprite, 0);
 &wait = random(4000, 0);
 sp_attack_wait(&current_sprite, &wait);
}

void die(void)
{
 script_attach(1000);
 &x = sp_x(&current_sprite, -1);
 &y = sp_y(&current_sprite, -1);

 int &dead = create_sprite(&x, &y, 0, 275, 1);
 sp_nohit(&dead, 1); 
 screenlock(0);
 freeze(1);
 say_stop("`7Uhg.....", &dead);
 wait(200);
 say_stop("Now tell me why Luke is here!", 1);
 wait(500);
 say_stop("`7Spoiler", &dead);
 wait(500);
 say_stop("`7Spoiler", &dead);
 wait(500);
 say_stop("`7<bleh>", &dead);
 wait(1000);
 say_stop("Great.", 1);
 wait(200);
 say_stop("Spoiler", 1);
 wait(200);
 say_stop("Time to leave this cave and wander the desert.", 1);
 &story = 17;
 unfreeze(1);
}