Jump to content

Photo

Volcano Eruption


  • Please log in to reply
4 replies to this topic

#1 Cedric

Cedric

    Illustrious

  • Members
  • Gender:Male
  • Location:on a lava castle

Posted 18 May 2017 - 02:12 PM

Hi i do want ask you a ffc script request. 
Do you know on Zelda Oracle of Ages/Seasons somes huges volcanos enters in eruptions making a earthquake sound with fire balls that they getting out of the volcano and falls on random place on the room where's the volcano is and after some moments the earthquake stop and start again after somes times ? 

Well i do wants a script that can mimic thoses functions.

''Earthquake'' ffc is the ffc where you have to put the invisible tiles on everywhere your desire. the D0 will be the time before the eruption restart. the D1 will be the time before the eruption when Link enters on the volcanos room and the D2 will be the sound of the earthquake.

''Eruption'' ffc will be the eruption where you can put the function everywhere you desire and in lava if you desire. The D0 will be the tile combo to use for the fireballs. the D1 will be the damage Link will take if the fireball hit him. (1= 1 damages, 2= 4 damages, and 3= 8 damages.) 
(The fire ball will appears sometimes after the earthquake caused by the volcano in eruptions. When the fireballs touch the ground they will explode like a bombs.


  • >ELV002< likes this

#2 ZoriaRPG

ZoriaRPG

    ZC Contributor & Wiki Editor

  • Members
  • Gender:Unspecified
  • Location:Prydon Academy

Posted 21 May 2017 - 10:33 AM

This might be what you want. I have not tested it, nor compiled it, and I likely need to do both to check for errors, but at least it is something for you to look at.
 
 
///////////////////////////
/// Vulcan FFC          ///
/// By: ZoriaRPG        ///
/// Requested by Cedric ///
/// 21st May, 2017      ///
/// v0.5                ///
///////////////////////////////////////////////////////////////////////////////////////////
/// D0: Sprite of the fireball from Quest->Graphics->Sprites->Weapons/Misc
/// D1: Damage of projectiles
/// D3:Time in seconds beforwe fireballs land. Defaults to 1.75 seconds.
/// D4: Time in frames before the eruption begins, randomised by +/- 80 frames.
/// D5: Sound of rumbling
/// D6: Sound of eruption
/// D7: Time before we can erupt again.

ffc script erupt{
	void run(int fireball_sprite, int damage, float falltime, float erupt_time, int rumble_sfx, int erupt_sfx, float time_return){
		eweapon e[10]; //The eight fireballs, and generic indices for looping. 
		int q[10];  	//[0]: Q loop, 
				//[1]: Radians counter, 
				//[2]: ffmarker, 
				//[3]: Exploding 
				//[4]: Remaining fireballs on-screen
				//[5]: Used for positive Angle variation
				//[6]: Used for negative Angle variation 
				//[7]: Unused,
				//[8]: Unused,
				//[9]: Unused
		int timers[4]; 	//[0]: Eruption Timer, 
				//[1]: Frame at which rumbling begins. 
				//[2]: time before second eruption, randomised., 
				//[3]: Unused, 

		//Do initial var set-up. 
		if ( falltime <= 0 ) { falltime = 1.75; } //Sanity
		if ( erupt_time <= 0 ) { erupt_time = 300; }
		else { erupt_time = erupt_time * 60; } //Turn seconds into frames. 
		timer[0] = Abs(erupt_time + Rand(-80,80)); timer[1] = Rand(30,90); //A slightly randomised eruption rate. 

		//Determine the UID to bind a fireball to its parent ffc. 
		q[2] = ComboAt(this->X, this->Y) + 1; //A way of determining which ffc made the fireballs.
		//If you place more then one ffc over the same location, this will BREAK. 
		
		//If we want to erupt more than one time, then set the value. 
		if ( time_return > 0 ) { time_return *= 60; timer[2] = Abs(time_return + Rand(-80,80)); }
		
		while(true){
			//Wait to erupt. 
			while ( timer[0]-- > 0 ) { 
				if ( timer[0] == timer[1] ) { 
					//One second before the eruption...
					///Rumble sound
					if ( rumble_sfx > 0 ) Game->PlaySound(rumble_sfx);
					//Shake screen
					Screen->Quake = timer[1]; //A slightly randomised eruption rate. 
					q[3] = 1;
				}
				Waitframe(); 
			} 
			
			//Animate eruption at this ffc.
			if ( q[3] == 1 ) { //We are exploding ) 
				//Make the eruption sound.
				if ( erupt_sfx > 0 ) Game->PlaySound(erupt_sfx);
				
				//Spew eweapons
				for ( q[0] = 0; q [0] < 8l q[0]++ ) {
					e[q] = Screen->CreateEWeapon(EW_SCRIPT); 
					e[q]->UseSprite = fireballsprite; 
					e[q]->Power = Damage;
					e[q]->Angular = true; 
					e[q]->Angle = q[1]; //This angle will be varied a bit as they fall. 
					e->Misc[15] = q[2]; //The UID that links them to this specific ffc, because this->ID is not implemented in 2.50.x. 
					q[1] += 0.25; //Adust the radians. 
					e->Z = falltime * 60; //Give them an initial Z. Do they have shadows?
				}
				q[3] = 0; //Mark that we are done exploding. 
			}
			
			//Now that the volcane has exploded, 
			q[4] = 0; //Clear this counter for use. 
			
			//Find all fireballs made by this script, and track them 
			for ( q[0] = Screen->NumEWeapons(); q[0] > 0; q[0]-- ) {
				e[8] = Screen->LoadEWeapon(q[0]);
				if ( e[8]->Misc[15] != q[2] ) { continue; } //Ignore weapons without the same UID as we created with this ffc. 
				
				q[4]++; //Track how many fireballs remain.
				q[5] = 0.0050; q[6] = -0.0050; 
				e[8]->Angle += Choose(q[5], q[6]); // Vary the angle a bit. 
				
				//If it is still falling, let it fall.
				if ( e[8]->Z > 0 ) { e[8]->Z--; } //Decrement its Z
				
				//if it hits the ground, make it explode. 
				if ( e[8]->Z <= 0 ) {
					e[8]->ID = EW_BOMBBLAST;
				}
			}
			
			//If we have set to explode again...
			if ( timer[2] > 0 ) { 
				if ( timer[2] > 1 ) { timer[2]--; } //Decrement the delay timer until it strikes 1.  
				if ( timer[2] <= 1 ) {  //When it strikes '1':
					if ( q[4] <= 0 ) { //If no fireballs remain from the last burst. 
					///new explosion
						//Reset the original timer, and start fresh.
						timer[0] = Abs(erupt_time + Rand(-80,80)); timer[1] = Rand(30,90); //A slightly randomised eruption rate. 
					} 
					//If fireballs remain, we will continue to check every frame as the timer will not continue to decrement. 
				}
			}
			
			//if ( time_return <= 0 && q[4] == 0 ) Quit(); //Do we want to exit?
			Waitframe();
		}
	}
}

Edited by ZoriaRPG, 21 May 2017 - 10:48 AM.


#3 Cedric

Cedric

    Illustrious

  • Members
  • Gender:Male
  • Location:on a lava castle

Posted 21 May 2017 - 11:18 AM

thanks alot :) but you got a exemple quest ? sorry if i do always asking the exemple quest but exemples quests helps me alot ^^'

#4 Cedric

Cedric

    Illustrious

  • Members
  • Gender:Male
  • Location:on a lava castle

Posted 05 June 2017 - 08:55 AM

I trying to compile the script but i got a fatal error when i import this one on my scripts list. 



#5 Cedric

Cedric

    Illustrious

  • Members
  • Gender:Male
  • Location:on a lava castle

Posted 11 June 2017 - 03:03 PM

There's a problem with those commends because i was got a error for the line 52 (i exclude the comments on the start lines.so i start by
ffc script erupt{ )
 


Edited by Cedric, 11 June 2017 - 03:03 PM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users