User Tag List

Results 1 to 4 of 4

Thread: "Normal" Boss Battle script

  1. #1
    Keese Schwa's Avatar
    Join Date
    Jun 2007
    Age
    36
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    731
    Level
    9
    vBActivity - Bars
    Lv. Percent
    51.57%

    "Normal" Boss Battle script

    First off: This is my first script. I had another one once, but pikaguy900 wrote 95% of it for me... This one I figured out mostly on my own, but pikaguy900 taught me about Global Variables, and Gleeok showed me how to create Arrays and gave me the code to kill all enemies on the screen.

    Now then... This script allows for boss fights with regular enemies rather than custom ones... by drawing a HP gauge for any enemy you choose... and then some. Read the comment tags at the top of the script and see what it does!

    Code:
    //***"Normal" Boss Battle Script***
    //By: Schwa
    //- - - - - - - -
    //What this does:
    //This script spawns an enemy of your choice to any X Y screen location you want. As long
    //as this enemy is alive, the enemy's HP will be gauged in the form of a bar at the top
    //of the screen. When the enemy dies, the bar will vanish, and every other enemy on the
    //screen will die on the spot. The killed "boss" enemy will NEVER reappear.
    //- - - - - - - -
    //Customizability:
    //*Set D0 to decide which enemy is being spawned. Use the constants in std.zh to help.
    //*Set D1 and D2 to choose the X and Y position of the spawned enemy, respectively. This
    //   is important because enemies like Aquamentus need to start at certain screen positions
    //   and due to the nature of the script, this must be done manually.
    //*Set D3 to set the "Fight ID" of the fight. This is what makes the enemy never reappear
    //   when you kill it. No two instances of this script should ever have the same Fight ID,
    //   or else killing one boss will kill any bosses of the same Fight ID. It can be any
    //   value from 0 to 255. If you need more room, change "int garr_bosskill[255]" to some
    //   higher value.
    //- - - - - - - -
    //Limitations:
    //This script won't work so well with Gleeok, Patra and probably Manhandla. It's meant for
    //you to make your own enemies in the Enemy Editor, such as stronger versions of existing
    //basic enemies, and use them as bosses. It might be possible to combine this script with
    //C-Dawg's Ghosting Script for more possibilities... We'll see what happens.
    //- - - - - - - -
    
    int garr_bosskill[255];
    
    import "std.zh"
    
    ffc script scr_bossmeter
    {
      void run(int enemy_id, int enemy_x, int enemy_y, int fight_id)
      {
        this->X = 0;
        this->Y = 0;
    
        if (garr_bosskill[fight_id] == 0)
        {
          npc var_enemynum = Screen->CreateNPC(enemy_id);
          int var_maxhp = var_enemynum->HP;
    
          var_enemynum->X = enemy_x;
          var_enemynum->Y = enemy_y;
    
          while(var_enemynum->isValid() && var_enemynum->HP > 0)
          {
            Screen->Rectangle(6, (this->X + 32), this->Y, (this->X + 32 + (var_enemynum->HP * 2)), (this->Y + 8), 82, 1, 0, 0, 0, true, 128);
            Screen->Rectangle(6, (this->X + 32), this->Y, (this->X + 32 + (var_maxhp * 2)), (this->Y + 8), 81, 1, 0, 0, 0, false, 128);
    
            Waitframe();      
          }
          int e = Screen->NumNPCs();
          int i;
    
          while(i++ < e)
          {
            npc autokill = Screen->LoadNPC(i);
            autokill->HP = 0;
          }
        }
        garr_bosskill[fight_id] = 1;
    
        this->Y -= 128;
        Quit();
      }
    }
    Test it out and tell me what you think! Not bad for my first script, eh? ...Eventually I'll need a way to combine this with C-Dawg's Ghosting Script, but that shouldn't be too hard at all, unless there are certain factors I'm overlooking.

    Thanks to everyone who helped me out, and everyone who enjoys my first script! Cheers!

    P.S. Yes, this code uses an Array... and to my knowledge it's one of the first scripts to do so. Someone will need to add some info to the Wiki soon, methinks.
    --Schwa

    Go here for updates on my Quest project: Molka Elite.
    Here is my first finished Quest: Molka. Ranked with 4.5 stars on PureZC.

  2. #2
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,959
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.2%

    Re: "Normal" Boss Battle script

    Hey good job and congrats on your first script. :)

    One suggestion though; Since this script could be used in conjuction with another boss script, Maybe people might like an alternate version of the bossmeter script using LoadNPC.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  3. #3
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.73%

    Re: "Normal" Boss Battle script

    Wow, very flash.

    I think my first script was
    Code:
    ffc script{
      void run(){
        while(true){
          Link->InputL = false;
        Waitframe();
        }
      }
    }
    >_<



    Anyway, well done ^_^

  4. #4
    Keese Schwa's Avatar
    Join Date
    Jun 2007
    Age
    36
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    731
    Level
    9
    vBActivity - Bars
    Lv. Percent
    51.57%

    Re: "Normal" Boss Battle script

    Thanks guys. ^_^

    Quote Originally Posted by Gleeok View Post
    One suggestion though; Since this script could be used in conjuction with another boss script, Maybe people might like an alternate version of the bossmeter script using LoadNPC.
    This was my original intent, so I could get it to work with Ring Leaders and Enemies holding Items... LoadNPC was fritzing out on me though. It wouldn't recognize anything when I tried putting "1" as the NPC to load, so I assumed that Enemy ID values were calculated in weird orders, which I wasn't really able to decipher.

    Also at some point I want to make an alternate version of this script where the bar is a parallelagram instead of a rectangle.
    --Schwa

    Go here for updates on my Quest project: Molka Elite.
    Here is my first finished Quest: Molka. Ranked with 4.5 stars on PureZC.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social