iPhone App Directory
RPG Maker VX
 
Gallery Members Search Calendar Help


Welcome Guest ( Log In | Register )

Collapse

>Announcement

Keep an eye out for the upcoming 3rd Quarter Contest!
 
Reply to this topicStart new topic
> [-Minigame-] Play an Instrument, Similar to The Legend of Zelda: Ocarina of Time (Updated 6/9/10)
Leridan
post Jun 6 2010, 08:33 PM
Post #1



Group Icon


Type: Designer
Alignment: Neutral Good




Leridan's 'Play Instrument' Event





I see a lot of people ask how they can implement a way to allow the player to use an instrument in their game. A great example of this is the ocarina in The Legend of Zelda: Ocarina of Time.

This event was created based on that concept. Using this feature, you can give the player an item that will allow them to press specific buttons that you designate to play musical notes. If the notes played match a predetermined pattern (i.e. a 'song'), you can turn a switch on to activate another event, such as clearing a pathway or opening a door. Turn the switch off when you're done and you can reuse it on another map.

How it works:

Near the bottom of the event's code, you will see a section for the songs. The default song notes use the arrow keys, and each key has been assigned a number (up = 1, right = 2, down = 3, left = 4). You can use these notes to write your songs, or define your own keys instead. More songs can be added to the event by using the same formula.

To teach the player a new song, you will have to set up an event to initiate the process. All of this can be found in the demo. I have placed an NPC on the test map to show you how to set it up. You can use this example as a basis for teaching new songs.

Screenshots of the full code:
Spoiler:






























The NPC:









All necessary files are included in the download. The code has been commented to explain each part of the process.

Version history:
[v1.5]
- Added option to teach new songs via events.
- Added song list feature.

[v1.0]
- Completed initial version.

This post has been edited by Leridan: Jun 9 2010, 03:56 AM
Attached File(s)
Attached File  play_instrument15.zip ( 295.22K ) Number of downloads: 283
 


--------------------


I support:

Go to the top of the page
 
+Quote Post
   
Celianna
post Jun 6 2010, 08:39 PM
Post #2



Group Icon


Type: Artist
Alignment: Chaotic Evil




Next time remember to add in a tag in your topic title.

This event would be really cool if you showed a way for the player to do a certain song and then activate a switch or something.
Go to the top of the page
 
+Quote Post
   
Leridan
post Jun 6 2010, 08:51 PM
Post #3



Group Icon


Type: Designer
Alignment: Neutral Good




You mean a sort of 'learn this song' event? Like they do in the Zelda game?

Example:

NPC shows how to play song...
Player repeats song in the correct order...
Player learns song!

Something like that?

Edit: Actually, I think I'll include that anyway, even if that's not what you were suggesting. wink.gif I'll update this topic within the next couple of days, when I finish the addition.

This post has been edited by Leridan: Jun 6 2010, 08:55 PM


--------------------


I support:

Go to the top of the page
 
+Quote Post
   
sbethune81
post Jun 6 2010, 09:15 PM
Post #4



Group Icon


Type: Undisclosed




In your event code you have:

conditional branch: Script: Input.trigger?(Input::UP)

The default button pressing branch has always bugged me a bit in that it says "being pressed" which always makes a work around necessary...usually with a small time delay. Does that script call that you used above function in the same way, or does it check for a single, complete key stroke? That would be awesome if it's the latter. I'm guessing
it has to be or all 4 notes would be entered within a fraction of a second after the player pressed key, and all 4 notes would be the same.


--------------------
Manifest - A complete 30 hour rpg, 4 years in the making:http://www.filefactory.com/file/c028461/n/Manifest.rar


Check out Manifest on Facebook: http://www.facebook.com/pages/Manifest/163...ll&filter=1
Go to the top of the page
 
+Quote Post
   
Leridan
post Jun 6 2010, 09:21 PM
Post #5



Group Icon


Type: Designer
Alignment: Neutral Good




You are correct, sir.

The Input.trigger? call only accepts one input, rather than a repetition (such as the default 'x Button is Being Pressed' condition).


--------------------


I support:

Go to the top of the page
 
+Quote Post
   
Numb
post Jun 6 2010, 09:23 PM
Post #6


Hey.
Group Icon


Type: Designer
Alignment: Neutral Good




Nice tutorial. I don't think I will be using this in my game, but the input thing will help me out [:


--------------------
"Memory is more indelible than ink."
Go to the top of the page
 
+Quote Post
   
Leridan
post Jun 9 2010, 04:00 AM
Post #7



Group Icon


Type: Designer
Alignment: Neutral Good




I've uploaded the latest version of the event.

Additions:
- Option to teach the player new songs via events.
- Viewable song list (displays the songs learned so far).

If anyone has been using this event, I'd like to know what you think. If there are any features you'd like to see implemented into this event, post your ideas here and I'll let you know if I think I can do it or not.


--------------------


I support:

Go to the top of the page
 
+Quote Post
   
TypicalTylur
post Aug 5 2010, 10:04 PM
Post #8


Never salt a snail.
Group Icon


Type: Undisclosed
Alignment: Unaligned




I wonder if I can do this same thing for chopping vegetables, or flipping something on a pan. (For a cooking game, thinking out loud.)

Anyways, great tutorial.
Go to the top of the page
 
+Quote Post
   
Leridan
post Aug 8 2010, 07:55 PM
Post #9



Group Icon


Type: Designer
Alignment: Neutral Good




QUOTE (TypicalTylur @ Aug 5 2010, 07:04 PM) *
I wonder if I can do this same thing for chopping vegetables, or flipping something on a pan. (For a cooking game, thinking out loud.)

That would be interesting to see. =) Kudos for thinking outside the box!


--------------------


I support:

Go to the top of the page
 
+Quote Post
   
OneWingedAngel12...
post Dec 3 2011, 07:30 PM
Post #10



Group Icon


Type: Designer




Hey Leridan, I'm having a small problem and I posted it up on the Support Section but I was told by a mod that was wrong (sorry Celianna sad.gif )

So yeah, I've been told to post it here. It's probably really easy to fix but I can put my finger on it sad.gif the post goes as so;

Hey guys,

Recently been working on my game and have decided to implement Leridan's Play Instrument event system. A link is below;

http://www.rpgmakervx.net/index.php?showtopic=31535

Its and awesome system and it works really well... until you try and play a third note What happens is when you have played the first two notes everything is fine, but when you get to the third note the image doesn't appear, no matter what button you press (left, right, up or down) but the fourth image does.

I've been trying to fix this for a while with very little luck and so I was hoping one of you lovely people would be able to help me
Thanks in advance!!

EDIT: If ya need anymore info just let me know smile.gif

This post has been edited by OneWingedAngel12345: Dec 3 2011, 07:31 PM
Go to the top of the page
 
+Quote Post
   
Syx
post Dec 3 2011, 10:02 PM
Post #11


Rusted Souls
Group Icon


Type: Musician
Alignment: Chaotic Neutral




this looks absolutely awesome! It's a shit-ton of eventing though. o.o; ... I just scrolled through the event screenshots and I was like.. 'Dude, this is NOT happening' Lol.

Seriously, though, I might end up using this in my game. smile.gif


--------------------


Go to the top of the page
 
+Quote Post
   
Leridan
post Dec 21 2011, 06:48 PM
Post #12



Group Icon


Type: Designer
Alignment: Neutral Good




QUOTE (OneWingedAngel12345 @ Dec 3 2011, 04:30 PM) *
Its and awesome system and it works really well... until you try and play a third note What happens is when you have played the first two notes everything is fine, but when you get to the third note the image doesn't appear, no matter what button you press (left, right, up or down) but the fourth image does.

It is difficult to determine what is causing your problem, without seeing your event code. If you want to take a screenshot of one of the input sections (specifically for the third note), that might help.

I apologize for the late response; I try to check in every so often to catch questions/feedback, but I guess I missed it. ^^;


--------------------


I support:

Go to the top of the page
 
+Quote Post
   
BlackMuffin
post Dec 22 2011, 01:17 AM
Post #13


私は、日本語は話せません。
Group Icon


Type: Writer
Alignment: Chaotic Good




This is awesome. I don't know why, but I've ALWAYS wanted to do this in a game, even if it has nothing to do with music.

I thank thee. TwT


--------------------
"People with Autism and other brain disorders are the most unfairly treated people in the world."- Dorian's World

Projects
Go to the top of the page
 
+Quote Post
   
OneWingedAngel12...
post Dec 22 2011, 10:54 AM
Post #14



Group Icon


Type: Designer




QUOTE (Leridan @ Dec 21 2011, 06:48 PM) *
It is difficult to determine what is causing your problem, without seeing your event code. If you want to take a screenshot of one of the input sections (specifically for the third note), that might help.

I apologize for the late response; I try to check in every so often to catch questions/feedback, but I guess I missed it. ^^;


Oh it's fine don't worry about it smile.gif I've just been struggling along with it and I've run out of things I can think that will fix it XD I've taken the screenshots, the first three are of the event that starts the problem (it all works fine up until the player tries to use this event), and the last two are of the song in the common event that the player is trying to learn when the error occurs.

Sorry but all the screenshots are in attatchments, but here is a link to my Mediafire page with the images on;

Screenshots

P.S: If these screenshots still dont help then I can arrange to send you a copy of my game for you to see the error itself. Just let me know if this is what you need smile.gif thanks for all your help biggrin.gif
Attached File(s)
Attached File  1.png ( 268.32K ) Number of downloads: 7
Attached File  2.png ( 271.49K ) Number of downloads: 10
Attached File  3.png ( 207.7K ) Number of downloads: 10
Attached File  4.png ( 269.06K ) Number of downloads: 8
Attached File  5.png ( 244.01K ) Number of downloads: 6
 
Go to the top of the page
 
+Quote Post
   
Leridan
post Dec 22 2011, 03:27 PM
Post #15



Group Icon


Type: Designer
Alignment: Neutral Good




QUOTE (OneWingedAngel12345 @ Dec 22 2011, 07:54 AM) *
P.S: If these screenshots still dont help then I can arrange to send you a copy of my game for you to see the error itself. Just let me know if this is what you need smile.gif thanks for all your help biggrin.gif

Yeah, I'm gonna have to see a demo of the section you're having trouble with. The only thing that caught my attention from those images was the fact that you activate the common event at the bottom of both the first and second pages of the event, but I'm not sure why, without seeing the whole process. I'd have to play around with it to see if I can figure out what the problem is.


--------------------


I support:

Go to the top of the page
 
+Quote Post
   
gabreddy
post Dec 23 2011, 09:20 PM
Post #16



Group Icon


Type: Designer
Alignment: Chaotic Good




Hey, does this allow you to play something like a piano? Maybe with something around 3 or so full sets of keys?


--------------------
OK, cyaz.
Go to the top of the page
 
+Quote Post
   
Leridan
post Dec 23 2011, 09:31 PM
Post #17



Group Icon


Type: Designer
Alignment: Neutral Good




QUOTE (gabreddy @ Dec 23 2011, 06:20 PM) *
Hey, does this allow you to play something like a piano? Maybe with something around 3 or so full sets of keys?

Yes, but you would need to modify the existing code to include those features. You would need to adjust the maximum number of notes, as well as the key inputs used to play the notes. If you wanted a large number of keys from which to choose from, you would likely have to use modifiers, such as the Shift key.


--------------------


I support:

Go to the top of the page
 
+Quote Post
   
OneWingedAngel12...
post Dec 24 2011, 11:10 AM
Post #18



Group Icon


Type: Designer




QUOTE (Leridan @ Dec 22 2011, 03:27 PM) *
Yeah, I'm gonna have to see a demo of the section you're having trouble with. The only thing that caught my attention from those images was the fact that you activate the common event at the bottom of both the first and second pages of the event, but I'm not sure why, without seeing the whole process. I'd have to play around with it to see if I can figure out what the problem is.


Ah alright then smile.gif when I've completed the first island I'll send you a copy of the demo smile.gif thanks for your help biggrin.gif
Go to the top of the page
 
+Quote Post
   
gabreddy
post Dec 24 2011, 03:53 PM
Post #19



Group Icon


Type: Designer
Alignment: Chaotic Good




QUOTE (Leridan @ Dec 23 2011, 10:31 PM) *
Yes, but you would need to modify the existing code to include those features. You would need to adjust the maximum number of notes, as well as the key inputs used to play the notes. If you wanted a large number of keys from which to choose from, you would likely have to use modifiers, such as the Shift key.


Ah, I see smile.gif Thanks! This'll be useful.


--------------------
OK, cyaz.
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 27th August 2014 - 02:01 PM

RPGMakerVX.net is an Privacy Policy, Legal.