User Tag List

Results 1 to 2 of 2

Thread: Din's Fire (Smash Bros version)

  1. #1
    Octorok
    Join Date
    Jan 2007
    Age
    36
    Posts
    259
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,410
    Level
    12
    vBActivity - Bars
    Lv. Percent
    73.43%

    Din's Fire (Smash Bros version)

    Sure Din's Fire is already in Zelda Classic, but it's based off the OoT version. This spell is based off Zelda's forward special from the smash games. It (as a FFC) flies out from Link, accelerates as it goes, and can be directed perpendicular to the initial direction of motion. Once the button is released, a fire lweapon is spawned on top of the target. You could probably do some pretty cool things with long distance burn flag triggering or just use it to kill stuff.

    This script does have the limitation that it is currently hardcoded to be used with the B button. I don't know how I could make it respect being used by the A button.

    If you want to use this, you'll need to set DinFire2 to a custom item's "Action" script slot and slot_2 to a global script. You'll need a FFC that's reserved just for this.

    Incidentally, this was my first script that worked. Major thanks go to Joe123 whose FFA Ice spell script showed me a lot of the concepts that let this work.

    Code:
    import "std.zh"
    
    //This script is supposed to simulate Din's Fire from the Super Smash Brothers games. A FFC is used to
    //simulate a fireball moving away from Link that can be accelerated perpendicular to its initial direction.
    //When the button is released, a fire lweapon is spawned over the FFC's location. Before the FFC "detonates",
    //Link is frozen in place and temporarily invincible.
    
    bool Fireball_Active = false;
    
    item script DinFire2 {
    	void run(){
    		Fireball_Active=true;
    	}
    }
    
    global script slot_2 {
    	void run(){
    		ffc Fireball = Screen->LoadFFC(1); //Feel free to change the number of the FFC used.
    		int Fireball_CSet = 8; //The CSet of the undetonated Fireball.
    		int combonumber = 661; //Set the combo for the FFC pre-detonation.
    		int blankcombo = 0; //Set the combo for the FFC after detonation (invisible suggested).
    		float initial_velocity = .8; //This is the initial velocity of the FFC.
    		float initial_acceleration = .1; //This is the initial acceleration of the FFC.
    		float delta_acceleration = .05; //Make this bigger to increase steering.
    		int fire_damage = 2; //This sets the power of the fire lweapon.
    		int fire_sound = SFX_FIRE; //This sets the sound effect the fire makes when "detonated".
    		bool Frame1 = true; //Don't touch this.
    		int direction = 0; //Don't touch this.
    		while(true){
    			if (Fireball_Active == true && Frame1 == true){
    				Fireball->X = Link->X;
    				Fireball->Y = Link->Y;
    				direction = Link->Dir;
    				if (direction == DIR_UP){
    					Fireball->Vx = 0;
    					Fireball->Vy = -initial_velocity;
    					Fireball->Ax = 0;
    					Fireball->Ay = -initial_acceleration;
    				}
    				else if (direction == DIR_DOWN){
    					Fireball->Vx = 0;
    					Fireball->Vy = initial_velocity;
    					Fireball->Ax = 0;
    					Fireball->Ay = initial_acceleration;
    				}
    				else if (direction == DIR_LEFT){
    					Fireball->Vx = -initial_velocity;
    					Fireball->Vy = 0;
    					Fireball->Ax = -initial_acceleration;
    					Fireball->Ay = 0;
    				}
    				else if (direction == DIR_RIGHT){
    					Fireball->Vx = initial_velocity; 
    					Fireball->Vy = 0;
    					Fireball->Ax = initial_acceleration;
    					Fireball->Ay = 0;
    				}
    				Fireball->Data = combonumber;
    				Fireball->CSet = Fireball_CSet;
    				Frame1 = false;
    			}
    			if (Fireball_Active == true && Frame1 == false){
    				Link->Action = LA_FROZEN;
    				if (direction == DIR_UP || direction == DIR_DOWN){
    					if (Link->InputLeft == true){
    						Fireball->Ax = Fireball->Ax - delta_acceleration;
    					}
    					else if (Link->InputRight == true){
    						Fireball->Ax = Fireball->Ax + delta_acceleration;
    					}
    				}
    				else if (direction == DIR_LEFT || direction == DIR_RIGHT){
    					if (Link->InputDown == true){
    						Fireball->Ay = Fireball->Ay + delta_acceleration;
    					}
    					else if (Link->InputUp == true){
    						Fireball->Ay = Fireball->Ay - delta_acceleration;
    					}
    				}
    				Waitframe();
    				if (Link->InputB == false){
    					if (Fireball->X > 0 && Fireball->Y > 0
    					&& Fireball->Y < 176 && Fireball->X < 256){
    						lweapon fire = Screen->CreateLWeapon(LW_FIRE);
    						fire->Dir = direction;
    						fire->X = Fireball->X;
    						fire->Y = Fireball->Y;
    						fire->Damage = fire_damage;
    						Game->PlaySound(fire_sound);
    					}
    					Fireball->Data = blankcombo;
    					Fireball_Active = false;
    					Frame1 = true;
    					Link->Action = LA_NONE;
    					Waitframe();
    				}
    			
    			}
    			Waitframe();
    		}
    	}
    }
    Here's a test quest that has this correctly set up. It's just two simple screens, but it covers the basics.

    http://files.filefront.com/TESTqst/;.../fileinfo.html

  2. #2
    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,621
    Level
    25
    vBActivity - Bars
    Lv. Percent
    1.37%

    Re: Din's Fire (Smash Bros version)

    There was a flamethrower script that Joe made... it used a set integer when the item was activated. I was able to easily modify that to generate two separate integers for the "B" and "A" button when the item is used.
    Maybe we could do that with your script too.
    Code:
    item script DinFire2 {
    	void run(){
    		if (Link->InputB){
    			Fireball_Active=true;
    			ButtonCheck == 1;
    		else if (Link->InputA){
    			Fireball_Active=true;
    			ButtonCheck == 2;
    	}
    }
    Added a "ButtonCheck" integer.
    Which is then referenced in the global script.


    Then make
    Code:
    				if (Link->InputB == false){
    					if (Fireball->X > 0 && Fireball->Y > 0
    					&& Fireball->Y < 176 && Fireball->X < 256){
    						lweapon fire = Screen->CreateLWeapon(LW_FIRE);
    						fire->Dir = direction;
    						fire->X = Fireball->X;
    						fire->Y = Fireball->Y;
    						fire->Damage = fire_damage;
    						Game->PlaySound(fire_sound);
    					}
    					Fireball->Data = blankcombo;
    					Fireball_Active = false;
    					Frame1 = true;
    					Link->Action = LA_NONE;
    					Waitframe();
    				}
    into
    Code:
    				if((Link->InputB == false && ButtonCheck == 1) || (Link->InputA == false && ButtonCheck == 2)){
    					if (Fireball->X > 0 && Fireball->Y > 0
    					&& Fireball->Y < 176 && Fireball->X < 256){
    						lweapon fire = Screen->CreateLWeapon(LW_FIRE);
    						fire->Dir = direction;
    						fire->X = Fireball->X;
    						fire->Y = Fireball->Y;
    						fire->Damage = fire_damage;
    						Game->PlaySound(fire_sound);
    					}
    					Fireball->Data = blankcombo;
    					Fireball_Active = false;
    					Frame1 = true;
    					Link->Action = LA_NONE;
    					ButtonCheck == 0;
    					Waitframe();
    				}
    and you should be able to make it work with both buttons.

    I don't have a copy of Zelda Classic on this computer, so I can't test compile it. Sorry.

    Hope it helps!
    I'm an author. If you're interested in checking out my works, you can find them on Amazon.com:


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