Announcement
Announcement
| 2nd Quarter Contest Announcement posted! See the Community Announcements section. |
![]() ![]() |
Jun 6 2010, 08:33 PM
Post
#1
|
|
![]() ![]() 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: 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)
-------------------- |
|
|
|
Jun 6 2010, 08:39 PM
Post
#2
|
|
![]() 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. |
|
|
|
Jun 6 2010, 08:51 PM
Post
#3
|
|
![]() ![]() 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. This post has been edited by Leridan: Jun 6 2010, 08:55 PM -------------------- |
|
|
|
Jun 6 2010, 09:15 PM
Post
#4
|
|
![]() 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 |
|
|
|
Jun 6 2010, 09:21 PM
Post
#5
|
|
![]() ![]() 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). -------------------- |
|
|
|
Jun 6 2010, 09:23 PM
Post
#6
|
|
|
Hey. ![]() 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." |
|
|
|
Jun 9 2010, 04:00 AM
Post
#7
|
|
![]() ![]() 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. -------------------- |
|
|
|
Aug 5 2010, 10:04 PM
Post
#8
|
|
|
Never salt a snail. ![]() 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. |
|
|
|
Aug 8 2010, 07:55 PM
Post
#9
|
|
![]() ![]() Type: Designer Alignment: Neutral Good |
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! -------------------- |
|
|
|
Dec 3 2011, 07:30 PM
Post
#10
|
|
![]() 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
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 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 This post has been edited by OneWingedAngel12345: Dec 3 2011, 07:31 PM |
|
|
|
Dec 3 2011, 10:02 PM
Post
#11
|
|
![]() Rusted Souls ![]() 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. -------------------- |
|
|
|
Dec 21 2011, 06:48 PM
Post
#12
|
|
![]() ![]() Type: Designer Alignment: Neutral Good |
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. ^^; -------------------- |
|
|
|
Dec 22 2011, 01:17 AM
Post
#13
|
|
![]() 私は、日本語は話せません。 ![]() 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 -------------------- |
|
|
|
Dec 22 2011, 10:54 AM
Post
#14
|
|
![]() Type: Designer |
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 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
Attached File(s)
|
|
|
|
Dec 22 2011, 03:27 PM
Post
#15
|
|
![]() ![]() Type: Designer Alignment: Neutral Good |
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 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. -------------------- |
|
|
|
Dec 23 2011, 09:20 PM
Post
#16
|
|
![]() 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.
|
|
|
|
Dec 23 2011, 09:31 PM
Post
#17
|
|
![]() ![]() Type: Designer Alignment: Neutral Good |
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. -------------------- |
|
|
|
Dec 24 2011, 11:10 AM
Post
#18
|
|
![]() Type: Designer |
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 |
|
|
|
Dec 24 2011, 03:53 PM
Post
#19
|
|
![]() Type: Designer Alignment: Chaotic Good |
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 -------------------- OK, cyaz.
|
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 18th May 2013 - 04:45 PM |
|
|