The Dink Network

Reply to Re: boss seems to screw up engine

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:
 
 
July 21st 2012, 05:11 PM
knights.gif
merder
Peasant He/Him Netherlands
The Voice in the back of your head! 
ok i fixed it and was surprisingly simple i messed up order of the random chooser and forgot the power f the wait command it is surprising how such oversights can make a script screw up and well after figuring that out and saw how it properly transformed now I could test him properly to find other missing parts unlike the old script which didn't clear memory with the wait command it is bugs like those that remind just how important the wait command is and well glad i figured it out before someone pointed out even if i wouldn't mind if anyone did. well he's nearly finished now and some bugs i dunno how t fix is after hitting echo he moves around in dinks idle animation and not the given sword-less walk animation and i dunno the best way to make individual forms change their attack animations and or methods when transformed. well so here is the 90% completed script.

//Echo The ancient one of sund(shapeshifting boss)

void main (void)
{
int &fsave_x;
int &kcrap;
int &fsave_y;
int &resist;
int &mcounter;
int &mtarget;
int &what = 5;
screenlock(1);
sp_brain(&current_sprite, 9);
sp_timing(&current_sprite, 66);
sp_speed(&current_sprite, 1);
sp_nohit(&current_sprite, 0);
sp_exp(&current_sprite, 10000);
//initial form Dink  
sp_base_walk(&current_sprite, 70);
sp_touch_damage(&current_sprite, 15);
sp_hitpoints(&current_sprite, 3000);
sp_defense(&current_sprite, &bossdef);
preload_seq(361);
preload_seq(363);
preload_seq(367);
preload_seq(369);
preload_Seq(70);
preload_Seq(166);

set_callback_random("trans",2000,10000)

}

void trans (void)
{
//here he chooses his form and plays the apropiote "Echo"
wait(1);
&what = random (5,1);

if (&what == 1)
{
//speedy pillbug form
&bossdef = &strength;
&bossdef -= 20;
sp_defense(&current_sprite, &bossdef);
sp_base_walk(&current_sprite, 130);
sp_speed(&current_sprite, 3);
playsound(30, 17050, 4000, &current_sprite, 0);
}

if (&what == 2)
{
//spell casting dragon
&bossdef = &strength;
&bossdef -= 20;
sp_defense(&current_sprite, &bossdef);
sp_base_walk(&current_sprite, 200);
sp_speed(&current_sprite, 1);
playsound(46, 17050, 4000, &current_sprite, 0);
}

if(&what == 3)
{
//Small, annoying and speedy slimer
&bossdef = &strength;
&bossdef -= 20;
sp_defense(&current_sprite, &bossdef);
sp_base_walk(&current_sprite, 690);
sp_speed(&current_sprite, 2);
 laysound(38, 38050, 6000, 1, 0);
}

if (&what == 4)
{
//tanky stone giant
&bossdef = &strength;
&bossdef -= 5;
sp_defense(&current_sprite, &bossdef);
sp_base_walk(&current_sprite, 820);
sp_speed(&current_sprite, 1);
playsound(28, 28050,0,&current_sprite, 0);
}
if (&what == 5)
{
//Dink  
&bossdef = &strength;
&bossdef -= 20;
sp_defense(&current_sprite, &bossdef);
sp_base_walk(&current_sprite, 10);
sp_speed(&current_sprite, 1);
}
set_callback_random("trans",2000,10000)
return;
}

void attack (void)
{
if(&what == 2)
{
  playsound(47, 22050,0,0,0);

        &kcrap = sp_target(&current_sprite, -1);
&fsave_x = sp_x(&kcrap, -1);
&fsave_y = sp_y(&kcrap, -1);
        &mcounter = random(5000,3000);
        sp_attack_wait(&current_sprite, &mcounter);

&resist = random(60, 1);

//if NPC, turn off resist option
if (&kcrap != 1)
&resist = 100000;

if (&resist > &magic)
        {
        say("`4<Casts harm>", &current_sprite);

        playsound(31, 12050,0,0, 0);
        hurt(&kcrap, 20);

        &fsave_y -= 29;
        int &spark = create_sprite(&fsave_x, &fsave_y, 7, 70, 1);
        sp_seq(&spark, 70);
        sp_que(&spark, -70);
        sp_speed(&spark, 5);
        return;
        }

        playsound(31, 44050,0,0, 0);
        &fsave_y -= 29;
        int &spark = create_sprite(&fsave_x, &fsave_y, 7, 166, 1);
        sp_seq(&spark, 166);
        sp_que(&spark, -70);
        say("Magic resisted.", &kcrap);

		}
set_callback_random("trans",2000,10000)
return;
}

void die (void)
{
playsound(43, 22050,0,0,0);
  int &reward = create_sprite(300,100,0,428,2);
  sp_script(&reward,"rewardsta");

  int &hold = sp_editor_num(&current_sprite);
  if (&hold != 0)
  editor_type(&hold, 6); 

&save_x = sp_x(&current_sprite, -1);
&save_y = sp_y(&current_sprite, -1);

 external("emake","boss");

}


still to add but i know how is the different sounds while transformed(a simple matter of checking transform form counter