User Tag List

Results 1 to 8 of 8

Thread: A fun little piano script.

  1. #1
    OBEY GOVERNMENT GOD ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,780
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,711
    Level
    32
    vBActivity - Bars
    Lv. Percent
    99.93%

    A fun little piano script.

    The object of the script? Get Link to Carnegie Hall. ...Which as it turns out is pretty hard due to the fact that Link has no musical talent. Someone's been playing too much guitar hero...

    How to play? Simple, walk up to the tree...err, piano, and start playing the tree,uuh, piano. Three octaves of keys in C major: D,L.U.R.B.A.Start. Press R to increase pitch, L to decrease, L+R and other keys to play diatonic chords. You can play many notes at a time, single or chordal!

    Now you can make those interior screens more interactive. Don't like Pianos? Maybe Link plays the guitar, or flute, or violin. or...*sigh* the ocarina...

    How about something spooky? Make it an organ and choir, then replace each E and G note with a Eb and Gb...And maybe those F's with F#'s too..oh my. :o

    Here it is: http://www.mediafire.com/?wlmx4majmmf


    Q:Will it trigger secrets?
    A:No.

    Q:Will it be easy to play songs?
    A:No.

    Q:Can I play a bassline and melody at the same time?
    A:Yes, but I hope you are really bored.

    Q:How do you play Hyrule Ocarina theme from OOT?
    A:U,B,L...U,B,L...U,B,R+L....R+D,.B..R,U,L.

    Q:Why am I downloading this?
    A:I don't know.



    Code:
    const int C1		= 100;
    const int D1		= 101;
    const int E1		= 102;
    const int F1		= 103;
    const int G1		= 104;
    const int A1		= 105;
    const int B1		= 106;
    
    const int C2		= 107;
    const int D2		= 108;
    const int E2		= 109;
    const int F2		= 110;
    const int G2		= 111;
    const int A2		= 112;
    const int B2		= 113;
    
    const int C3		= 114;
    const int D3		= 115;
    const int E3		= 116;
    const int F3		= 117;
    const int G3		= 118;
    const int A3		= 119;
    const int B3		= 120;
    
    
    
    
    
    ffc script piano{
    
    	void run(){
    
    		bool PIANO = false;
    
    		bool input_up;		bool u;
    		bool input_down;	bool d;
    		bool input_left;	bool l;
    		bool input_right;	bool r;
    		bool input_b;		bool b;
    		bool input_a;		bool a;
    		bool input_start;	bool s;
    
    		int timer = 300;
    
    		Game->PlayMIDI(0);
    
    		while(true){
    
    			Waitframe();
    
    			if(!PIANO){
    
    				if(Link->Y > this->Y && Link->Dir==0 && Abs(this->X-Link->X)<9
    					&& Abs(this->Y-Link->Y)<17 && Link->Z==0 && this->Data > 0 && Link->InputA)
    				{
    					PIANO=true;Link->InputA=false;
    				}
    				else PIANO=false;
    			}
    
    			else{
    
    				// needed setup
    
    				if(Link->InputUp){input_up=true;timer=600;}
    				else{input_up=false;u=false;}
    				if(Link->InputDown){input_down=true;timer=300;}
    				else{input_down=false;d=false;}
    				if(Link->InputLeft){input_left=true;timer=300;}
    				else{input_left=false;l=false;}
    				if(Link->InputRight){input_right=true;timer=300;}
    				else{input_right=false;r=false;}
    				if(Link->InputB){input_b=true;timer=300;}
    				else{input_b=false;b=false;}
    				if(Link->InputA){input_a=true;timer=300;}
    				else{input_a=false;a=false;}
    				if(Link->InputStart){input_start=true;timer=300;}
    				else{input_start=false;s=false;}
    
    				timer--;
    
    				if(timer==0)PIANO=false;
    
    				// plays sounds based on previous inputs
    
    				if(Link->InputL && !Link->InputR){
    
    					if(input_down && !d){
    						Game->PlaySound(C1);d=true;
    					}
    					if(input_left && !l){
    						Game->PlaySound(D1);l=true;
    					}
    					if(input_up && !u){
    						Game->PlaySound(E1);u=true;
    					}
    					if(input_right && !r){
    						Game->PlaySound(F1);r=true;
    					}
    					if(input_b && !b){
    						Game->PlaySound(G1);b=true;
    					}
    					if(input_a && !a){
    						Game->PlaySound(A1);a=true;
    					}
    					if(input_start && !s){
    						Game->PlaySound(B1);s=true;
    					}
    				}
    				else if(!Link->InputL && !Link->InputR){
    
    					if(input_down && !d){
    						Game->PlaySound(C2);d=true;
    					}
    					if(input_left && !l){
    						Game->PlaySound(D2);l=true;
    					}
    					if(input_up && !u){
    						Game->PlaySound(E2);u=true;
    					}
    					if(input_right && !r){
    						Game->PlaySound(F2);r=true;
    					}
    					if(input_b && !b){
    						Game->PlaySound(G2);b=true;
    					}
    					if(input_a && !a){
    						Game->PlaySound(A2);a=true;
    					}
    					if(input_start && !s){
    						Game->PlaySound(B2);s=true;
    					}
    				}
    				else if(!Link->InputL && Link->InputR){
    
    					if(input_down && !d){
    						Game->PlaySound(C3);d=true;
    					}
    					if(input_left && !l){
    						Game->PlaySound(D3);l=true;
    					}
    					if(input_up && !u){
    						Game->PlaySound(E3);u=true;
    					}
    					if(input_right && !r){
    						Game->PlaySound(F3);r=true;
    					}
    					if(input_b && !b){
    						Game->PlaySound(G3);b=true;
    					}
    					if(input_a && !a){
    						Game->PlaySound(A3);a=true;
    					}
    					if(input_start && !s){
    						Game->PlaySound(B3);s=true;
    					}
    				}
    				else if(Link->InputL && Link->InputR){
    
    					if(input_down && !d){
    						Game->PlaySound(C1);Game->PlaySound(E1);
    						Game->PlaySound(G1);Game->PlaySound(C2);d=true;
    					}
    					if(input_left && !l){
    						Game->PlaySound(D1);Game->PlaySound(F1);
    						Game->PlaySound(A1);Game->PlaySound(D2);l=true;
    					}
    					if(input_up && !u){
    						Game->PlaySound(E1);Game->PlaySound(G1);
    						Game->PlaySound(B1);Game->PlaySound(E2);u=true;
    					}
    					if(input_right && !r){
    						Game->PlaySound(F1);Game->PlaySound(A1);
    						Game->PlaySound(C1);Game->PlaySound(F2);r=true;
    					}
    					if(input_b && !b){
    						Game->PlaySound(G1);Game->PlaySound(B1);
    						Game->PlaySound(D1);Game->PlaySound(G2);b=true;
    					}
    					if(input_a && !a){
    						Game->PlaySound(A1);Game->PlaySound(C1);
    						Game->PlaySound(E1);Game->PlaySound(A2);a=true;
    					}
    					if(input_start && !s){
    						Game->PlaySound(B1);Game->PlaySound(D1);
    						Game->PlaySound(F1);Game->PlaySound(B2);s=true;
    					}
    				}
    			
    				Link->InputUp=false;
    				Link->InputDown=false;
    				Link->InputLeft=false;
    				Link->InputRight=false;
    				Link->InputA=false;
    				Link->InputB=false;
    				Link->InputStart=false;
    				Link->InputL=false;
    				Link->InputR=false;
    
    				//Link->Action = LA_FROZEN;
    			}
    		}
    	}
    }
    Join the Gleeok Book Club - It's easy, all you have to do is read...

    "Protocols of the Learned Elders of Zion" (British Royal Institute, 1906)
    None Dare Call It Conspiracy -Gary Allen
    Deliberate Dumbing Down of America -Charlotte Iserbyt
    Morals and Dogma -Albert Pike
    Bloodlines Of The Illuminati -Fritz Springmeier
    The Rape Of Justice -Eustace Mullins
    The World Order, A Study in the Hegemony of Parasitism -Eustace Mullins
    The Most Dangerous Superstition -Larken Rose
    "War is a Racket" �Major General Smedley Butler

    The WWI Conspiracy: Part 1 - Part 2 - Part 3 "A New World Order"

    �The modern theory of the perpetuation of debt has drenched the earth with blood, and crushed its inhabitants under burdens ever accumulating.� �Thomas Jefferson
    �It is well enough that the people of the nation do not understand our banking and monetary system for, if they did, I believe there would be a revolution before tomorrow morning.� �Henry Ford
    �Man will ultimately be governed by God or by tyrants.� �Benjamin Franklin

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

  2. #2
    Triforce Knight bigjoe's Avatar
    Join Date
    Apr 2000
    Age
    35
    Posts
    5,590
    Mentioned
    84 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,274
    Level
    24
    vBActivity - Bars
    Lv. Percent
    43.64%

    Re: A fun little piano script.

    I tried it out. Pretty cool. With slight modification to make this have secret triggering capabilities, this script would be perfect. However, it seems like you don't want to do that. :p It wouldn't be too hard for someone to do manually though. Just need a way to store the last ... err.. six or so keys that have been pressed by the player.

  3. #3
    Developer
    ZC Developer

    Join Date
    Aug 2006
    Location
    Australia
    Age
    33
    Posts
    2,777
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,710
    Level
    25
    vBActivity - Bars
    Lv. Percent
    15.4%

    Re: A fun little piano script.

    You know, I might use this in my own quest... if I could just figure out which of the buttons is assigned to "stop playing Chopsticks and get back to questing."

  4. #4
    OBEY GOVERNMENT GOD ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,780
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,711
    Level
    32
    vBActivity - Bars
    Lv. Percent
    99.93%

    Re: A fun little piano script.

    Quote Originally Posted by _L_ View Post
    You know, I might use this in my own quest... if I could just figure out which of the buttons is assigned to "stop playing Chopsticks and get back to questing."
    Oh yeah, Haha, It was set at ten seconds of non-use. I just set it to five, ..Just change the delay to whatever. Also I realized that perhaps there should be a PlayMIDI(screen_midi); When the Piano is not in use. That might be a bit better also.

    Maybe even a Link starts playing the piano! message. Sure.



    Ah yes the secrets...Well there's no way I'm gonna code out a song or anything, but you can easily access a global variable by hitting any one single key. Like, play the high 'F' and a door opens up...or something.
    Join the Gleeok Book Club - It's easy, all you have to do is read...

    "Protocols of the Learned Elders of Zion" (British Royal Institute, 1906)
    None Dare Call It Conspiracy -Gary Allen
    Deliberate Dumbing Down of America -Charlotte Iserbyt
    Morals and Dogma -Albert Pike
    Bloodlines Of The Illuminati -Fritz Springmeier
    The Rape Of Justice -Eustace Mullins
    The World Order, A Study in the Hegemony of Parasitism -Eustace Mullins
    The Most Dangerous Superstition -Larken Rose
    "War is a Racket" �Major General Smedley Butler

    The WWI Conspiracy: Part 1 - Part 2 - Part 3 "A New World Order"

    �The modern theory of the perpetuation of debt has drenched the earth with blood, and crushed its inhabitants under burdens ever accumulating.� �Thomas Jefferson
    �It is well enough that the people of the nation do not understand our banking and monetary system for, if they did, I believe there would be a revolution before tomorrow morning.� �Henry Ford
    �Man will ultimately be governed by God or by tyrants.� �Benjamin Franklin

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

  5. #5
    Keese
    Join Date
    Mar 2005
    Location
    Portugal
    Age
    33
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    680
    Level
    9
    vBActivity - Bars
    Lv. Percent
    21.86%

    Re: A fun little piano script.

    That's amazing! is there a way to get off the piano? lol


  6. #6
    Octorok SpacemanDan's Avatar
    Join Date
    Dec 2005
    Location
    Canada
    Age
    28
    Posts
    359
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,625
    Level
    13
    vBActivity - Bars
    Lv. Percent
    55.5%

    Re: A fun little piano script.

    Interesting...
    If this could trigger secrets, I could see many possibilities with this. Still an awsome script as-is for a fun extra thing to do. Nice work!
    I'm assuming those variables in the beginning are the sounds to use?
    -This signature lacks something interesting.-

  7. #7
    Octorok Ebola Zaire's Avatar
    Join Date
    Jun 2007
    Age
    29
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    900
    Level
    10
    vBActivity - Bars
    Lv. Percent
    43.93%

    Re: A fun little piano script.

    Sweet! It'd be cool if you could script this to activate secrets- it'd be like the Bat Cave. Play U D R and the bookcase moves right!

  8. #8
    Wizrobe The_Amaster's Avatar
    Join Date
    Dec 2005
    Location
    St. Mystere
    Age
    29
    Posts
    3,803
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    8,669
    Level
    28
    vBActivity - Bars
    Lv. Percent
    7.03%

    Re: A fun little piano script.

    It's Gleeok, master of radical scripting. He amazed us with his overhaul of the engine to form a top down shooter, but not content to stop there, he now has released a script that turns ZC into a passable music synthesizer!

    Whats next? ZC as pong? (Oh, wait, we already have that)
    Maybe Mario?

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