WaitingPhoFood

Villager
Member
Joined
Sep 24, 2023
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMZ
Hi, I'm trying to make a piano puzzle that makes the user press a sequence on the keyboard, and it gives the user an item. I tried my best following other threads and videos but I have no idea what I'm doing.
 

Ms Littlefish

Time Traveling Victorian Vampire
Global Mod
Joined
Jan 15, 2014
Messages
8,984
Reaction score
14,481
First Language
English
Primarily Uses
RMMV
Hi there! Welcome to the forums! Think you can show us some event pages you’ve worked on? It could also be helpful to share the threads and videos you’ve been referencing.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,675
Reaction score
11,194
First Language
English
Primarily Uses
RMMV
Welcome!

I have no idea what I'm doing.
We also have no idea what you're doing unless you show us :stickytongue:

It doesn't help that your terminology, in this case, is vague.

When you say pressing a sequence on the keyboard, do you mean there's an image of the piano keyboard and they're clicking on keys? Or do you mean pressing letter keys on their computer keyboard?

As @Ms Littlefish said, please put all of the information that's in your head into this thread.
 

WaitingPhoFood

Villager
Member
Joined
Sep 24, 2023
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMZ
Yeah lol, my badimage3.pngimage2.pngimage.png

So this is what I was working with. I got my code from this thread https://forums.rpgmakerweb.com/index.php?threads/sequential-puzzle-issues.38163/
and I also followed . My code closely followed the thread but I realized its a different Rpg Maker engine so I feel a little lost. Also sorry for the inconsistent code.

Welcome!


We also have no idea what you're doing unless you show us :stickytongue:

It doesn't help that your terminology, in this case, is vague.

When you say pressing a sequence on the keyboard, do you mean there's an image of the piano keyboard and they're clicking on keys? Or do you mean pressing letter keys on their computer keyboard?

As @Ms Littlefish said, please put all of the information that's in your head into this thread.
Also yes, pressing a sequence on the computer keyboard
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,675
Reaction score
11,194
First Language
English
Primarily Uses
RMMV
Okay...so what isn't working? What is it doing or not doing? What is the question?

Off the top of my head I see several potential errors, such as having an event with an Action Button trigger and no image, and an Erase Event command with other commands still following it.
 

WaitingPhoFood

Villager
Member
Joined
Sep 24, 2023
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMZ
So, when I followed the code exactly from the thread I sent, the code didn't seem to read that I was inputing the sequence from the keyboard. I also tried to do it as a parallel but it still didn't work. The only thing that works from the puzzle is when I press the keyboard, the note plays. Other than that, its doesn't run how I want it to be(which is press s e d f on the keyboard. If wrong then reset the puzzle if right, give item to player.

I was trying to do the array method but nothing worked. I think my main question is what is the best method/code to execute the puzzle?
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,675
Reaction score
11,194
First Language
English
Primarily Uses
RMMV
Well, you still don't show the entire page 2 of your event, so it's hard to completely troubleshoot.

But here are things that look wonky to me:
- Page 1 has an Erase Event, which means Page 2 shouldn't even get triggered, because you erased the event until you load back into the map. Why is that command there at all?

- Your common event has a conditional inside it. In the video you linked to, that was present because the common event was being called directly from a button via a plugin. But you aren't doing that, you're trying to look at the player's keyboard input - so if you're calling the common event manually, only when you intend to, why is the conditional there?

- Your event 8 page 2 is triggered by action button. That means any of the conditions inside are only going to happen if, for example, the player hits Enter while holding "E". From the design of the event, I presume you want that event to be a parallel process, continually running.

- That other thread is really not a useful reference for anything because it's a completely different programming language. Your script calls are incorrect - push(e) is going to try to push a variable named "e", but you don't have one. Are you intending to push the character "E", in quotations? You, again, don't actually show us what you're doing with this array so it's impossible for us to tell you.

- Then, the next thing in your scripts is also incorrect, @button_on = true doesn't mean anything. It's going to create a temporary variable called @button_on which will go away as soon as the script box ends. (actually, it won't even get that far because simply starting with @ and no commands before it will produce a syntax error)
 
Last edited:

WaitingPhoFood

Villager
Member
Joined
Sep 24, 2023
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMZ
I see. I don't have my file on me right now but the rest of my code essentially looked like this but variable 1 = 17 and variable 2 = 18 and variable 3 = 19 but I now realized since its a different script it probably won't work.
1695748807533.png


I'm really new to RPG maker in general so I kind of tried my best to understand the code from the material I found. Would this code in theory work in RPG Maker MZ if I used the right script format?
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,675
Reaction score
11,194
First Language
English
Primarily Uses
RMMV
In the nicest possible way, I think you have gotten yourself terribly mixed up by combining advanced tutorials from different systems and languages - you have overlapping gaps in your knowledge which results in your event not working, you don't know why, and there are fundamental errors in it.

I strongly suggest that you first do some tutorials on MZ's event system and the event commands. You should know how events that are Action Trigger, Autorun, and Parallel Process work. You should have a passing understanding of what the actual event command buttons do.

This system can be done with sheer eventing, you do not need any arrays or code. I don't see how your goal benefits from this array system.

I personally think the best thing for you would be to restart it, figure out the correct sequence of logic without following someone else's tutorial that's written around plugins you're not using, and then if you get stuck ask for help.

Then, in the event you do need to ask for more help, please post the entire thing, making sure all of it is legible and visible if there are portions that need scrolling.

It would require more effort to tear out the wrong bits of this and splice things back together than it should to just recreate it.

Edit: Minor correction - you will need one piece of code for checking button presses that aren't default RPG Maker keys.
 

WaitingPhoFood

Villager
Member
Joined
Sep 24, 2023
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMZ
I see. Thanks for the help anyways.
(Edit) Hey guys! I was able to get help from the RPG Maker discord server (https://discord.com/invite/vcd2SD29UH) and I'm posting the code if anyone wants to do a piano puzzle. 1695830932831.png1695831523964.png

Make pianoPuzzle a common event
1695830968450.png

1695831025363.png1695830999959.png
every time you press a key on the computer keyboard, it adds one to a counter and stores the key in an array. If the $gameVariables.value(16) makes the sequence you have, you win the game and sets a self switch and turns off the common event. To add the Input.isTriggered, you would have to code the keycode https://www.toptal.com/developers/keycode in rmmz_core on line 5683 under the Input.keyMapper like this
1695831182260.png
The discord channel help-mz would probably explain the process better than me, but I hope this helps anyone.
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

Kokoro Reflections is my favorite tileset maker. I absolutely love their work. I have bought quite a bit from them. Best RPG Maker tileset creator ever imo.
Me working on a deadline, "don't make the baseline and chords too funky, don't over compose it... remember, you have to finish it." Touches MIDI controller...instant funk.
TGA are coming up, and I'm still mad Lies of P didn't get nominated.
Like, they chose a remake of a 20 year old game and a vanilla 2D Mario game over it?

Bah, humbug!
I'll be there for the trailers and whatever weird mistakes are made.
I've bundled all my free plugin releases on itch.io I'll add more later, feel free to check it out! https://starlit.itch.io/rm-free-plugins
If I could draw, my Game Jam title screen would be a Krampus sitting in Santa's chair, his long, blonde hair flowing in the wind, sipping on an Espresso, while snacking on cheddar popcorn, chewing on an orange pencil pensively, while completing a crossword puzzle. I guess it's a good thing I can't draw.

Forum statistics

Threads
136,782
Messages
1,269,926
Members
180,534
Latest member
yuki7744111
Top