Jump to content

Photo

[2.55] Blast Blooms from Oracle of Seasons


  • Please log in to reply
2 replies to this topic

#1 Jenny

Jenny

    braixen

  • Members
  • Real Name:Jennette
  • Pronouns:She / Her

Posted 07 November 2021 - 05:20 PM

Blast Blooms are flowers from the Oracle games that can shoot you up to higher elevations

 

https://www.zeldadun...iki/Blast_Bloom

 

 

Here's a video example of how they work (11:38 in the video if it doesn't start there). If at all possible, I'd like to have a script so I can replicate this behavior in ZC.

 

Any help is appreciated.


Edited by Jenny, 07 November 2021 - 05:20 PM.

  • Jared likes this

#2 Mani Kanina

Mani Kanina

    Rabbits!

  • Members

Posted 07 November 2021 - 10:22 PM

Okay so, the animation isn't *perfect* to how it looks in GB, but it should be decently close?

 

//If you prefer using a global array, comment out this global variable, and instead uncomment the global array stuff elsewhere:
//You want this value to be -1 initially though, regardless of array or not.
int BlastBloomTime = -1;

//Delay between being on the flower to it throwing you
const int BB_DELAY = 30;
//offsets from the top left of the FFC to where link has to stand. (and where leafs will draw)
const int BB_X_ACT = 16;
const int BB_Y_ACT = 16;
//Leaf combo, draws under the flower/FFC
const int BB_FLOWER = 3080;
const int BB_FLOWER_CSET = 7;
//will make the flower draw above link for part of the animation.
const int BB_OVERHEAD = 1;
//if the standard jump SFX plays when shot (SFX 45)
const int BB_JUMP_SFX = 1;
//Travel Speed when flying up, in pixels/frames (does not support decimals)
const int BB_SPEED = 3;
//Screen transition offset. This tries to account for screen transitions automatically, but might be outdated in newer versions of ZC.
//  -> The value you want is dependent on screen scrolling speed. Default is configured for Very Fast Screen Scroll.
const int BB_SCROLLING = 11;
//Height Multiplication (In case you prefer to input tiles into the FFC rather than pixels.) 16 = 1 tile per 1 height in FFC. 1 = 1 pixel per height.
const int BB_MULTIPLIER = 16;

void BlastBlooms(){
	
	//int BlastBloomTime = GlobalArray[998];
	
	if(BlastBloomTime < 0) return;
	
	
	
	if(BlastBloomTime >= 0){
		
		if(Link->Z == 0){
			Link->Z = 4;
			Link->Jump = 0;
		}
		else{
			
			Link->Z = 4;
			Link->Jump = 0;
			
			for(int i = 0; i < BB_SPEED; i++){
				if(BlastBloomTime >= 0){
					Link->Y --;
					BlastBloomTime --;
				}
				
			}
			
			
		}
		
		if(BlastBloomTime <= 0){
			//Link->Z = 0;
		}
		
		NoAction();
	}
	
	
	//GlobalArray[998] = BlastBloomTime;
	
}

ffc script BlastBlooms{
	void run(int Height, int SFX){
		
		if(BB_MULTIPLIER > 0) Height = Height * BB_MULTIPLIER;
		
		//int BlastBloomTime = GlobalArray[998];
		
		int FC = 0;
		int StandingOn = 0;
		int LeafLayer = 1;
		if(BB_OVERHEAD) LeafLayer = 4;
		
		int AX = this->X + BB_X_ACT;
		int AY = this->Y + BB_Y_ACT;
		
		int LeafX = this->X + BB_X_ACT;
		int LeafY = this->Y + BB_Y_ACT;
		
		int DefaultCombo = this->Data;
		int WiggleCombo = this->Data + 1;
		int GrabCombo = this->Data + 2;
		int HoldCombo = this->Data + 3;
		int ShootCombo = this->Data + 4;
		int ShotCombo = this->Data + 5;
		int RelaxCombo = this->Data + 6;
		
		int SteppedOn = 0;
		
		//To adjust for screen transitions
		if(AY - Height < 0) Height = Height + BB_SCROLLING * BB_SPEED;
		
		while(true){
			
			
			
			if(Link->X < AX + 5 && Link->X > AX - 5 && Link->Y < AY + 4 && Link->Y > AY - 8 && Link->Z == 0){
				if(this->Data != WiggleCombo) this->Data = WiggleCombo;
				StandingOn ++;
				
				if(StandingOn > BB_DELAY){	// activating shooting
					
					int ActiveX = AX;
					int ActiveY = AY - 4;
					this->Data = GrabCombo;
					Game->PlaySound(SFX);
					
					for(int i = 0; i < 60; i++){	// Animation
						
						if(i == 10){
							this->Data = HoldCombo;
							if(BB_OVERHEAD > 0) this->Flags[FFCF_OVERLAY] = true;
						}
						else if(i == 20){
							this->Y = this->Y + 2;
							ActiveY = ActiveY + 2;
						} 
						else if(i == 40){
							this->Y = this->Y- 2;
							ActiveY = ActiveY - 2;
							this->Data = ShootCombo;
						} 
						
						Link->X = ActiveX;
						Link->Y = ActiveY;
						
						//Underdraw leaf
						if(i >= 10) Screen->FastCombo(LeafLayer, LeafX, LeafY, BB_FLOWER, BB_FLOWER_CSET, OP_OPAQUE);
						else{
							Screen->FastCombo(1, LeafX, LeafY, BB_FLOWER, BB_FLOWER_CSET, OP_OPAQUE);
						}
						NoAction();
						Waitframe();
					}
					
					Link->Dir = DIR_UP;
					
					if(BB_JUMP_SFX > 0) Game->PlaySound(45);
					StandingOn = 0;
					BlastBloomTime = Height;
					//GlobalArray[998] = BlastBloomTime;
					SteppedOn = 0;
					
					
					
					for(int i = 0; i < 40; i++){
						if(BB_OVERHEAD > 0 && i == 5) this->Flags[FFCF_OVERLAY] = false;
						
						if(i == 5) this->Data = ShotCombo;
						if(i == 25) this->Data = RelaxCombo;
						Screen->FastCombo(1, LeafX, LeafY, BB_FLOWER, BB_FLOWER_CSET, OP_OPAQUE);
						Waitframe();
					}
				}
			}
			else if(Link->X < AX + 8 && Link->X > AX - 8 && Link->Y < AY + 4 && Link->Y > AY - 8 && Link->Z == 0){
				if(this->Data != WiggleCombo) this->Data = WiggleCombo;
				StandingOn = 0;
				
				SteppedOn = 15;
			}
			else{
				StandingOn = 0;
				 if(SteppedOn <= 0) this->Data = DefaultCombo;
				 else{
					 SteppedOn --;
				 }
			}
			
			
			
			FC ++;
			if(FC > 14748) FC = 0;
			
			
			Screen->FastCombo(1, LeafX, LeafY, BB_FLOWER, BB_FLOWER_CSET, OP_OPAQUE);
			Waitframe();
		}
		
	}
}

As for set-up instructions:
Put:
 

BlastBlooms();

Somewhere in your global active script.

Given the flowers odd shape, the default config for this script has the FFC at a one tile offset up and left from where the interaction happens (and the FFCs tile draw X is 3, and draw Y is 2).
Here's an example of my tilepage:

Spoiler


This thing is combo based, and needs 7 combos configured in a row:
1: First combo is when the flower is idle.
2. Second combo happens when Link steps on the flower. (I configured this to be animated, 3 frames, 2 X animation offset)
3. Third combo is the starting of grabbing link (second row on my tile page)
4. Holding Link combo (Second row second tile group)
5. Preparing to shoot (Second row, third tile group)
6. This is the combo when the flower shoots, I have this one set up to be a 2 frame animated combo, but a static might look better, hence not being GB accurate in animation).
7. The flower moving back to default position. This combo for me is identical to combo 3.

Lastly you need to set up the leaf combo somewhere and define the combo ID in the script. It will auto draw it below itself. (Be sure to set "run script at screen init" in the FFC to prevent pop-in).

Height can be in pixels or any multiplication of pixels, and goes in the FFC's first D variable.
D1 on the FFC is the SFX that plays when the flower grabs Link. (I think GB Bomb place is the correct one?)

There's some constants at the top of the script that you can tweak if you wish. The script supports traveling through screen transitions, but the distance traveled can be a bit jank to get right.


Edited by Mani Kanina, 07 November 2021 - 10:26 PM.

  • Jenny, Architect Abdiel and Bagu like this

#3 Architect Abdiel

Architect Abdiel

    Kingdom Builder

  • Members
  • Real Name:Michael
  • Location:Florida

Posted 08 November 2021 - 06:01 AM

This is lovely. I am actually about to make a dungeon that will benefit greatly from these flowers.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users