User Tag List

Results 1 to 2 of 2

Thread: [Script Tutorial] Epic Ganon (CJC5th)

  1. #1
    Cor Blimey! CJC's Avatar
    Join Date
    Dec 2002
    Location
    Fading into the darkness
    Age
    35
    Posts
    1,398
    Mentioned
    150 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,618
    Level
    25
    vBActivity - Bars
    Lv. Percent
    0.96%

    [Script Tutorial] Epic Ganon (CJC5th)

    As I have been eliminated from the contest, I thought I would share the secrets of my epic Ganon battle (therefore saving people the trouble of reverse engineering it from the quest file). First, the code:

    Spoiler: show
    Code:
    import "std.zh"
    const int SecretBlocker = 511;
    int SecretBlocker = 511;
    ffc script TransformingBoss {
    	void run(int Spawners, int phase2ID, int phase3ID, int phase4ID, int phase5ID, int phase6ID, int phase7ID) {
    	//States the number of spawn points the boss will use, as well as the enemy ID of each phase.
    	//Use FFC arguments to define these values.
    
    	//You will need to create an invisible enemy in slot 511 that ignores all damage.  This is the secret
    	//blocker; it prevents the doors and secrets from triggering when one phase of the boss is defeated.
    	//Set the enemy's image to a blank tile, its type to 'Other', and its animation style to 'None'.
    	//Make sure to give it some HP, and make it ignore all weapon types!
    	
    	//You may notice that the script does not request the phase 1 ID.  The first phase should be whatever
    	//enemies you place on the screen to begin with, so the first phase's ID is unnecessary.
    	
    	//Be sure to place the FFC where you want the enemy to spawn (and make sure it's invisible!)
    	//Also, don't lie about the number of spawn points you're going to use; going short could cause the boss
    	//to behave erratically or die instantly after a certain phase, and going over could make the boss have
    	//very long intervals of time between phases.  You should avoid using more than three spawners.
    	//Also, make sure you use the same spawner number in each instance of the FFC.
    	
    	//If you want to skip a phase, set the phaseID to 0.  If you want the enemy to spawn in multiple spots,
    	//use a separate FFC to define the position for each phase, and skip the appropriate phases as necessary.
    	
    	//This script does not currently support the permanent defeat of transforming bosses.
    	int TotalNPCs;
    	int Curphase = 1;
    	int Setup = 0;
    	Spawners = Clamp(Spawners, 1, 3);
    	phase2ID = Clamp(phase2ID, 0, 510); //Making sure the enemy ID referenced is not an overflow value.
    	phase3ID = Clamp(phase3ID, 0, 510);
    	phase4ID = Clamp(phase4ID, 0, 510);
    	phase5ID = Clamp(phase5ID, 0, 510);
    	phase6ID = Clamp(phase6ID, 0, 510);
    	phase7ID = Clamp(phase7ID, 0, 510);
    		while(true){
    		if(Setup==0){
    			CreateNPCAt(SecretBlocker, 0, 0);
    			Setup=1;
    		}
    		Waitframes(10);
    		TotalNPCs = Screen->NumNPCs();
    			if(Curphase < 8){
    				if(TotalNPCs==Spawners){
    					if(Curphase==1){
    						if(phase2ID==0){
    							Waitframes(Spawners);
    	//This script determines the spawn location by FFC based on a base 'spawner' number system.  That is, it checks
    	//the first FFC on the screen with this script, then the next, and so on before 'skipping' a phase.
    	//The more spawners you use, the longer the wait between boss spawns; try to avoid using more than three.
    							Curphase +=1;
    						}
    						else{
    							CreateNPCAt(phase2ID, this->X, this->Y);
    							//Spawns the phase 2 boss
    							Curphase+=1;
    						}
    					}
    					else if(Curphase==2){
    						if(phase3ID==0){
    							Waitframes(Spawners^2);
    							Curphase +=1;
    						}
    						else{
    							CreateNPCAt(phase3ID, this->X, this->Y);
    							//Spawns the phase 3 boss
    							Curphase +=1;
    						}
    					}
    					else if(Curphase==3){
    						if(phase4ID==0){
    							Waitframes(Spawners^3);
    							Curphase +=1;
    						}
    						else{
    							CreateNPCAt(phase4ID, this->X, this->Y);
    							//Spawns the phase 4 boss
    							Curphase +=1;
    						}
    					}
    					else if(Curphase==4){
    						if(phase5ID==0){
    							Waitframes(Spawners^4);
    							Curphase +=1;
    						}
    						else{
    							CreateNPCAt(phase5ID, this->X, this->Y);
    							//Spawns the phase 5 boss
    							Curphase +=1;
    						}
    					}
    					else if(Curphase==5){
    						if(phase6ID==0){
    							Waitframes(Spawners^5);
    							Curphase +=1;
    						}
    						else{
    							CreateNPCAt(phase6ID, this->X, this->Y);
    							//Spawns the phase 6 boss
    							Curphase +=1;
    						}
    					}
    					else if(Curphase==6){
    						if(phase6ID==0){
    							Waitframes(Spawners^6);
    							Curphase +=1;
    						}
    						else{
    							CreateNPCAt(phase7ID, this->X, this->Y);
    							//Spawns the phase 6 boss
    							Curphase +=1;
    						}
    					}
    					else if(Curphase==7){
    						Waitframes(Spawners^7);
    						Curphase +=1;
    					}
    				}
    			}
    			else if(TotalNPCs>0){
    				npc KillSweep = Screen->LoadNPC(1);
    				KillSweep->HP = 0;
    			}
    		Waitframe();
    		}
    	}
    }
    
    ffc script BossFire {
    //Make all projectiles unblockable
    	void run(){
    		while(true){
    			for(int i = Screen->NumEWeapons(); i>0; i--){
    				eweapon ew = Screen->LoadEWeapon(i);
    				if(ew->Dir != -1){
    					ew->Dir = -1;
    				}
    			}
    			Waitframe();
    		}
    	}
    }

    In essence, the script creates 'secret blocker' enemies that keep screen secrets from triggering until the boss has cleared all of its phases (Each phase is a separate enemy in the editor; the idea is built off of Tribble On Death but is applicable to all enemy types, including bosses). This changer does not require any special headers outside of the default, but the FFC setup is a little specific (You'll want to read the prologue comment).

    BossFire is a script designed by @SUCCESSOR that makes all projectiles on screen unblockable. It is included primarily to give the two Aquamentus phases more punch. Note that weapons that use the circle attack style will clump together in a single projectile due to this adjustment: this is because they depend on their direction to move and the direction is effectively nullified. I'm sure a workaround is possible but I am not interested in pursuing it.

    Here's the enemy data for my custom Ganon phases:

    Phase 1 (Shielded)
    Uses the shielded animation (Second Highest Ganon tiles in attachment)

    Weapon: Fireball (Rising)
    Type: Digdogger
    O. Anim: Digdogger
    HP 48
    Dam 8
    W Dam 4
    Random 7
    Turn 3
    Step 35
    F. Rate 72
    All others 0, use standard Ganon Palette (Palette Set 3)

    Enemy 1 ID: Ganon Fire Bat
    Enemy 1 Qty: 4
    Type: Digdogger (Don't make it a child, this will cause problems!)
    Sound effects should both be "Boss is Hit".

    Ganon Room Type Spawn Flag


    Ganon Fire Bat
    Uses the bat two-frame tiles in a red CSet (Usually CSet 8)

    Weapon: Flame
    Type: Wizzrobe
    O. Anim: 2-Frame Flying
    HP 24
    Dam 4
    W Dam 4
    Random 2
    Halt 8
    Homing 12
    Step 60
    F. Rate 0
    All others 0, use red CSet

    Walk: Phase
    Shot: 1
    Solid OK: No
    Sound effect should be "Boss is hit" for damage and "Enemy dies" for death.

    Defenses 1: 1/2 ALL
    Defenses 2: 1/2 ALL except Sword & SBeams (None for those)


    Phase 2 (Fireballs Right)
    Uses the Aquamentus animation (Second from bottom in attachment)

    Weapon: Fireball (Rising)
    Type: Aquamentus
    O. Anim: Aquamentus
    HP 36
    Dam 32
    W Dam 16
    Random 3
    Halt 2
    Step 50
    F. Rate 0
    All others 0, use standard Ganon Palette (Palette Set 3)

    Side: Right
    Sound effects should be "Boss is hit" for both.

    Defenses 1: Block ALL except Arrow (Ignore <1 instead)
    Defenses 2: Block ALL but Sword & SBeams (1/4 instead)


    Phase 3 (Fireballs Left)
    *Identical to Phase 2 except Side is Left. Be sure to place on a spawner at the left side of the screen.*

    Weapon: Fireball (Rising)
    Type: Aquamentus
    O. Anim: Aquamentus
    HP 36
    Dam 32
    W Dam 16
    Random 3
    Halt 2
    Step 50
    F. Rate 0
    All others 0, use standard Ganon Palette (Palette Set 3)

    Side: Left
    Sound effects should be "Boss is Hit" for both.

    Defenses 1: Block ALL except Arrow (Ignore <1 instead)
    Defenses 2: Block ALL but Sword & SBeams (1/4 instead)


    Phase 4 (Swarm of Bats)
    Triforce (Big) with both bat frames following. Use a red CSet (Such as CSet 8)

    Weapon: Flame
    Type: Patra
    O. Anim: Flip
    HP 16
    Dam 8
    W Dam 12
    Random 3
    Turn 8
    Step 40
    F. Rate 8
    All others 0, use red CSet (CSet 8)

    Outer Eyes: 2
    Inner Eyes: 3
    Eyes' HP: 4
    Movement: Oval
    Shooters: Inner Eyes
    Pattern Odds: 1
    Pattern Cycles: 4
    Eye Offset: 24
    Eye Cset: 8
    Type: 1x1
    Sound effects should be "Boss is Hit" for hit and "Enemy dies" for death.

    Defenses 1: Block ALL except Arrow (Ignore <1 instead) and Wand Melee (1/4 instead)
    Defenses 2: Block ALL but Sword & SBeams (1/4 instead)


    Phase 5 (Flames of Power)
    Three Cool Poses (Lowest Ganon sprites on attached sheet), 'extra' tiles should be set to the blank in front of the three copies of the Big Triforce

    Weapon: Flame
    Type: Gleeok
    O. Anim: Gleeok
    HP 48
    Dam 12
    W Dam 4
    Step 100
    F. Rate 0
    All others 0, use red CSet (CSet 8)

    Heads: 1
    Head HP: 200
    Shot Type: Breath
    Neck Segments: 2
    Neck Offset 1: 6
    Neck Offset 2: 7
    Head Offset: 8
    Sound effects should be "Boss is Hit" for damage and "Ganon's Fanfare" for death.

    Defenses 1: Block ALL except Arrow (Ignore <1 instead)
    Defenses 2: Block ALL but Sword & SBeams (1/4 instead)


    Phase 6 (Stab Into Darkness)
    Use the Normal Ganon Sprites (The ones at the top of the attachment)

    Weapon: Fireball
    Type: Ganon
    O. Anim: Ganon
    HP 53
    Dam 16
    W Dam 4
    Random 5
    Homing 72
    Step 100
    F. Rate 0
    All others 0, use standard Ganon Palette (Palette Set 3)

    Sound effects should be "Boss is Hit" and "Boss Dies" respectively.

    Never Returns After Death




    Due to the way the script is designed, Ganon will respawn every time you enter the room, triggering the Triforce lighting the darkness. When he dies, he'll leave a dust pile, but if you've beaten him once before he will not drop the Triforce of Power a second time. It is recommended that you one-way shutter the entrance to Ganon's room and then one-way shutter the room AFTER the Ganon fight (so the player doesn't accidentally turn back and have to fight him again). You could, of course, do whatever you please, and I could see a vindictive questmaker forcing players through the Ganon fight room multiple times (Might make an interesting if not cruel dungeon).
    Also, turn off the Boss Roar flag on the screen; the fight is long and it gets in the way of the mood.


    If you have any questions, this is the place to ask. I warn you in advance, I write 'quick and dirty' scripts that are useful for my situations but might not play nice with the work of others. In early setups I encountered some VERY erratic behavior from this script, randomly spawning and killing bosses every frame. It takes a little testing to get it to run just right; be sure you check your work when using anything I made.


    EDIT: Confirmed that script as written does not work with Shooters or Traps, since they mess up the enemy count that dictates when to change phases.
    Attached Images Attached Images
    I'm an author. If you're interested in checking out my works, you can find them on Amazon.com:


  2. #2
    Wizrobe Nightmare's Avatar
    Join Date
    Mar 2000
    Age
    44
    Posts
    2,523
    Mentioned
    40 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    3,840
    Level
    19
    vBActivity - Bars
    Lv. Percent
    75.69%
    Scripting part was generally easy CJC, but I think you need to detail more how the sprites work. I'm not even totally sure.

    -James

    Facebook: http://www.facebook.com/nightmarejames YouTube: http://www.youtube.com/nightmarejames

    Game Projects
    Zelda Classic:
    Completed: Zelda NES Remastered, Demo 1st Quest, Demo 2nd Quest, James Quest: Remastered (V 2.1), Memorial Quest, New Quest 2 2015. New Quest: Rebuilt
    In development: Demo SP, James Quest: Remastered (V 3.0)t, 6QI

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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