User Tag List

Results 1 to 8 of 8

Thread: The Crab_boss script (yes "The"; 'cause as we all know there's lots of crab scripts.)

  1. #1
    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.24%

    The Crab_boss script (yes "The"; 'cause as we all know there's lots of crab scripts.)

    Do you need and endless supply of ffc's being hurled at Link from a Giant Crab-like monster? If so then look no further. Because i've got crabs, and now you can have crabs too. :p




    This is my first fully completed boss script, but not to be the last! ..Anyway most of you will have no use for this script because, well...It's designed to kill you. :eyebrow: But that's why there's variables I guess. So you can set 'em up however you like. Although I guess you could give Link more equipment too...I'm mostly posting this for simplicity and learning purposes for future scripters. But if anyone actually uses it then that's great too.


    Code:
     //===========================================================================
    //                   ***FFC SCRIPT CRAB BOSS***
    // Link FFC's to this ffc to make it any way you like. :D
    // this ffc expects to be in the upper part of the screen. It will move left and right
    // and fire projectiles at downward angles.
    //D0 the number of this ffc
    //D1 enemy HP
    //D2 enemy speed
    //D3 bubble speed
    //D4 the combos to be used as bubble projectiles
    //D5 the cset of the bubble projectiles
    //D6 0=constant movement, 1=randomly stops for a short time
    //===========================================================================
    
    ffc script Crab_boss{
    
    	void run(int this_ffc_number, int enemyHP, int crabspeed, int bubblespeed, int bubble_combo, int cset, int constant){
    
    		ffc this_ffc = Screen->LoadFFC(this_ffc_number);
    		if(this_ffc_number == 0){ this_ffc_number = 1; }
    		if(enemyHP == 0){ enemyHP = 100; }
    		if(bubblespeed == 0){ bubblespeed = 1; } 
    		int delay = 0;
    		int attack_state = 0;    // 0=moving, 1=standing still
    		int movement_state = 0;  // 0=right, 1=left
    		int switch_state = 0;
    		int bubble_ffc = 10;
    		int crab_stopped = 0;
    		int RandNum;
    		int screen_enemy_number = Screen->NumNPCs();
    
    		ffc bubble;
    		
    		Waitframes(4);
    
    		npc crablife = Screen->LoadNPC(1);
    		crablife->HP = enemyHP;
    		
    		while(true){
    
    			if((delay == 60) && (crablife->HP > enemyHP*0.8)){ delay = 0;}
    			if((delay == 150)&&(crablife->HP <= enemyHP*0.8)&&(crablife->HP > enemyHP*0.35)){ delay = 0;}
    			if((delay == 200) && (crablife->HP <= enemyHP*0.35)){ delay = 0;}
    			delay++;
    
    			if(bubble_ffc >= 23){ bubble_ffc = 10;}
    
    			crablife->X = this->X; crablife->Y = this->Y;
    			
    			if(this_ffc->X <= 64){ movement_state = 0;}
    			if(this_ffc->X >= 180){ movement_state = 1;}
    
    
    		//===========================
    		//ENEMY MOVEMENT
    		//===========================
    
    			if(crab_stopped > 0){ crab_stopped--;}
    			if(crab_stopped == 0){ attack_state = 0;}
    
    			if(movement_state == 0 && attack_state == 0){this_ffc->Vx = crabspeed;}
    			if(movement_state == 1 && attack_state == 0){this_ffc->Vx = -crabspeed;}
    			if(movement_state == 0 && attack_state == 1){this_ffc->Vx = 0;}
    			if(movement_state == 1 && attack_state == 1){this_ffc->Vx = 0;}
    
    			if((constant == 1)&&(switch_state == 0)){RandNum = Rand(180);switch_state = 1;}
    			if((constant == 1)&&(switch_state == 1)){
    				RandNum++;
    				if(RandNum == 180){ 
    					attack_state = 1; switch_state = 0; crab_stopped = 30;
    				}
    			}
    			if((this_ffc->X > Link->X)&&(this_ffc->Y >= Link->Y-8)){ this_ffc->Vx = -crabspeed-0.2; crab_stopped = 0; movement_state = 1;}
    			if((this_ffc->X < Link->X)&&(this_ffc->Y >= Link->Y-8)){ this_ffc->Vx = crabspeed+0.2; crab_stopped = 0; movement_state = 0;}
    
    					
    		//===========================
    		//ENEMY FIRE
    		//===========================
    			
    			if(crablife->HP > enemyHP*0.8){
    
    				if((delay == 15)||(delay == 45)){
    					bubble = Screen->LoadFFC(bubble_ffc);
    					bubble->Data = bubble_combo;
    					bubble->CSet = cset;			
    					bubble->X = this->X;
    					bubble->Y = this->Y + 8;
    					bubble->Vy = bubblespeed;
    					bubble_ffc++; }
    				if(delay == 30){
    					bubble = Screen->LoadFFC(bubble_ffc);
    					bubble->Data = bubble_combo;
    					bubble->CSet = cset;			
    					bubble->X = this->X;
    					bubble->Y = this->Y + 8;
    					bubble->Vy = bubblespeed;
    					bubble->Vx = bubblespeed*0.8;
    					bubble_ffc++;}
    				if(delay == 60){
    					bubble = Screen->LoadFFC(bubble_ffc);
    					bubble->Data = bubble_combo;
    					bubble->CSet = cset;			
    					bubble->X = this->X;
    					bubble->Y = this->Y + 8;
    					bubble->Vy = bubblespeed;
    					bubble->Vx = -bubblespeed*0.8;
    					bubble_ffc++;}
    				}	
    			if((crablife->HP <= enemyHP*0.8)&&(crablife->HP > enemyHP*0.35)){
    
    				if((delay == 10)||(delay == 50 )||(delay == 90)||(delay == 130)){
    					bubble = Screen->LoadFFC(bubble_ffc);
    					bubble->Data = bubble_combo;
    					bubble->CSet = cset;			
    					bubble->X = this->X;
    					bubble->Y = this->Y + 8;
    					bubble->Vy = bubblespeed;
    					bubble->Vx = 0;
    					bubble_ffc++; }
    				if((delay == 20)||(delay == 40 )||(delay == 100)||(delay == 120)){
    					bubble = Screen->LoadFFC(bubble_ffc);
    					bubble->Data = bubble_combo;
    					bubble->CSet = cset;			
    					bubble->X = this->X;
    					bubble->Y = this->Y + 8;
    					bubble->Vy = bubblespeed;
    					bubble->Vx = bubblespeed*0.6;
    					bubble_ffc++; }
    				if((delay == 30)||(delay == 110 )){
    					bubble = Screen->LoadFFC(bubble_ffc);
    					bubble->Data = bubble_combo;
    					bubble->CSet = cset;			
    					bubble->X = this->X;
    					bubble->Y = this->Y + 8;
    					bubble->Vy = bubblespeed*0.8;
    					bubble->Vx = bubblespeed;
    					bubble_ffc++; }
    				if((delay == 60)||(delay == 80 )||(delay == 140)){
    					bubble = Screen->LoadFFC(bubble_ffc);
    					bubble->Data = bubble_combo;			
    					bubble->X = this->X;
    					bubble->Y = this->Y + 8;
    					bubble->Vy = bubblespeed;
    					bubble->Vx = -bubblespeed*0.6;
    					bubble_ffc++; }
    				if((delay == 70)||(delay == 150 )){
    					bubble = Screen->LoadFFC(bubble_ffc);
    					bubble->Data = bubble_combo;
    					bubble->CSet = cset;			
    					bubble->X = this->X;
    					bubble->Y = this->Y + 8;
    					bubble->Vy = bubblespeed*0.8;
    					bubble->Vx = -bubblespeed;
    					bubble_ffc++; }
    				}
    			if(crablife->HP <= enemyHP*0.35){
    
    				if((delay == 7)||(delay == 49 )||(delay == 91)||(delay == 133)||(delay == 175)){
    					bubble = Screen->LoadFFC(bubble_ffc);
    					bubble->Data = bubble_combo;
    					bubble->CSet = cset;			
    					bubble->X = this->X;
    					bubble->Y = this->Y + 8;
    					bubble->Vy = bubblespeed;
    					bubble->Vx = 0;
    					bubble_ffc++; }
    
    				if((delay == 14)||(delay == 42 )||(delay == 98)||(delay == 126)){
    					bubble = Screen->LoadFFC(bubble_ffc);
    					bubble->Data = bubble_combo;
    					bubble->CSet = cset;			
    					bubble->X = this->X;
    					bubble->Y = this->Y + 8;
    					bubble->Vy = bubblespeed;
    					bubble->Vx = bubblespeed*0.4;
    					bubble_ffc++; }
    				if((delay == 21)||(delay == 35 )||(delay == 105)||(delay == 119)){
    					bubble = Screen->LoadFFC(bubble_ffc);
    					bubble->Data = bubble_combo;
    					bubble->CSet = cset;			
    					bubble->X = this->X;
    					bubble->Y = this->Y + 8;
    					bubble->Vy = bubblespeed;
    					bubble->Vx = bubblespeed*0.8;
    					bubble_ffc++; }
    				if((delay == 28)||(delay == 112)){
    					bubble = Screen->LoadFFC(bubble_ffc);
    					bubble->Data = bubble_combo;
    					bubble->CSet = cset;			
    					bubble->X = this->X;
    					bubble->Y = this->Y + 8;
    					bubble->Vy = bubblespeed*0.9;
    					bubble->Vx = bubblespeed*1.2;
    					bubble_ffc++; }
    				if((delay == 56)||(delay == 84 )||(delay == 140)||(delay == 168)){
    					bubble = Screen->LoadFFC(bubble_ffc);
    					bubble->Data = bubble_combo;
    					bubble->CSet = cset;			
    					bubble->X = this->X;
    					bubble->Y = this->Y + 8;
    					bubble->Vy = bubblespeed;
    					bubble->Vx = -bubblespeed*0.4;
    					bubble_ffc++; }
    				if((delay == 63)||(delay == 77 )||(delay == 147)||(delay == 161)){
    					bubble = Screen->LoadFFC(bubble_ffc);
    					bubble->Data = bubble_combo;
    					bubble->CSet = cset;			
    					bubble->X = this->X;
    					bubble->Y = this->Y + 8;
    					bubble->Vy = bubblespeed;
    					bubble->Vx = -bubblespeed*0.8;
    					bubble_ffc++; }
    
    				if((delay == 70)||(delay == 154 )){
    					bubble = Screen->LoadFFC(bubble_ffc);
    					bubble->Data = bubble_combo;
    					bubble->CSet = cset;			
    					bubble->X = this->X;
    					bubble->Y = this->Y + 8;
    					bubble->Vy = bubblespeed*0.9;
    					bubble->Vx = -bubblespeed*1.2;
    					bubble_ffc++; }
    				}
    
    			Waitframe();
    		}
    	}
    }

    =================***READ***==================

    I do some things a little different than you may be used to. First is this script does not create an enemy. It assumes you have a screen enemy set and enemies->secrets is probably enabled. It then uses this enemy for fuel, increasing it's HP and such. DO NOT USE "ENTER FROM SIDES'.

    Next: Do NOT use FFC's 10-23 for anything! don't even set anything on them. The script does all the work and will use these for it's own twisted scheme.

    -Variables-

    //D0 the number of this ffc : You can blame C- for this. I got used to reading through his stuff a while back, so I'll accidentally type this_ffc instead of this, and then it won't compile, so now I just add this by default.

    //D1 enemy HP
    //D2 enemy speed
    //D3 bubble speed : I'd test this at 1 before you set it any higher than that.
    //D4 the combos to be used as bubble projectiles
    //D5 the cset of the bubble projectiles
    //D6 0=constant movement, 1=randomly stops for a short time

    Others self explanitory.

    -Oh, and if anyone is wondering why there's no demo it's because there's a bug with damage combo's in 635. *hint* devs fix pwease...

    Have fun.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  2. #2
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,612
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.95%

    Re: The Crab_boss script (yes "The"; 'cause as we all know there's lots of crab scrip

    There is at least ONE other crab boss script out there, you know.

    As for using this_ffc: If it's fixed, great, but I tried it a few builds back when DarkDragon said it was fixed, and it wasn't. For now, I've been able to avoid using up all seven Data fields, so I still use this_ffc_number.

    Good job, Gleeok!

    Quote Originally Posted by Gleeok View Post
    Oh, and if anyone is wondering why there's no demo it's because there's a bug with damage combo's in 635. *hint* devs fix pwease...

    Have fun.
    Wait what?

  3. #3
    Lynel Majora's Avatar
    Join Date
    Mar 2006
    Age
    32
    Posts
    1,197
    Mentioned
    24 Post(s)
    Tagged
    7 Thread(s)
    vBActivity - Stats
    Points
    4,388
    Level
    20
    vBActivity - Bars
    Lv. Percent
    94.05%

    Re: The Crab_boss script (yes "The"; 'cause as we all know there's lots of crab scrip

    WTF

    NEEDS MOAR DIABABA


    Joking aside, this is pretty bad-ass. Nicely done! Maybe I'll use it in my quest.

  4. #4
    Wizrobe
    Join Date
    Dec 2006
    Age
    29
    Posts
    3,693
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    8,936
    Level
    28
    vBActivity - Bars
    Lv. Percent
    43.01%

    Re: The Crab_boss script (yes "The"; 'cause as we all know there's lots of crab scrip

    Looks good. But what do you mean by D0 equals the number of the freeform combo?
    Quote Originally Posted by rock_nog View Post
    Well of course eveything's closed for Easter - don't you know of the great Easter tradition of people barricading themselves up to protect themselves from the return of Zombie Christ?


  5. #5
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,612
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.95%

    Re: The Crab_boss script (yes "The"; 'cause as we all know there's lots of crab scrip

    Quote Originally Posted by russadwan View Post
    Looks good. But what do you mean by D0 equals the number of the freeform combo?
    D0, D1, D2, D3, D4, D5, D6, D7 are the "arguments" you can enter in the FFC when you set it up in ZQuest. This lets you re-use the same script on multiple FFCs and modify it. For example, this crab boss could occur several times in the quest, with more health and speed each time. Just change the arguments when you attach the script to an FFC.

    My habit, that Gleeok has adopted, is to copy the Number of the FFC (they are numbered 1 through 32) into the D0 argument. Then the script knows exactly what FFC to load up and move around pursuant to the script. If the "this" function is now properly implemented, you don't really need to do this anymore.

    Using "this_ffc" instead of "this," which is short hand for passing the number of the FFC explicitly in D0, has some other flexibility. You could, if you wanted, put the script on one FFC and then tell the script it is acting on ANOTHER FFC. This might be useful if you want two scripts running on the same FFC at once. So you could have one script making an FFC move around, another making it ghost an enemy, and a third shooting other FFCs, for instance. (I plan on making use of this in the Megaman toolbox Gleeok and I are tinkering with. This is the only way I know of to easily make custom bosses modular for people who don't want to bother with ZScripting.)

  6. #6
    Wizrobe
    Join Date
    Dec 2006
    Age
    29
    Posts
    3,693
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    8,936
    Level
    28
    vBActivity - Bars
    Lv. Percent
    43.01%

    Re: The Crab_boss script (yes "The"; 'cause as we all know there's lots of crab scrip

    I know what the augments are. I just was confused about what the first augment of this script does.
    Quote Originally Posted by rock_nog View Post
    Well of course eveything's closed for Easter - don't you know of the great Easter tradition of people barricading themselves up to protect themselves from the return of Zombie Christ?


  7. #7
    &&
    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,304
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.79%

    Re: The Crab_boss script (yes "The"; 'cause as we all know there's lots of crab scrip

    I got caught by that 'this_ffc' of yours too C
    Managed to escape to 'this' after not too long though

  8. #8
    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.24%

    Re: The Crab_boss script (yes "The"; 'cause as we all know there's lots of crab scrip

    Yeah, it comes in handy. I'm working on some new scripts that have this_ffc, other_ffc, and i'm tinkering with an additional third_ffc and fourth_ff. To anyone wondering as to why, let me explain:

    What this will do is allow you to set these;
    A) to any ffc slot you want,
    B) to have each ffc able to read and change data from other ffc's,
    C) be able to coordinate simple and complex tasks between them


    For an example of this think Portal script or Mothula script.

    Quote Originally Posted by C-Dawg
    Megaman toolbox
    That reminds me I need to add all the 2x2 enemies, which is basically All the bosses from 1-4(8 combos of 2x2 large ffc's, [standing, moving, jumping, firing] for left and right) and weapon animation, and some other enemies. I have all the sprites, I've just need to rip them.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

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