Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[VX] Having trouble using events for a simple puzzle

Alright, this is one of those simple "move the boulder" puzzles.  Basically, you move a boulder onto a switch, which holds the door open.  If you attempt to stand on the switch yourself, the door will remain open only for as long as you're on the switch; then it closes.

I figured out how to make the boulder event so that when the player presses the key, the boulder will move away from him.  I also figured out how to do the switch, insofar that it closes the door if the player leaves the switch, but keeps it open as long as the player stands on it.  However, every time I try to push the boulder onto the switch, the game freezes.  Probably something to do with one event trying to get on top of the other.  So how am I supposed to do this?
 

Kraft

Sponsor

use variables to check if the boulder is on the the correct place.

If so, then flag the switches.

Same thing with the player... use 2 variables (1 for the hero X and one for the Hero Y) and have then check the players position.  If they are on the spot where the switch it, then flip the switches in the door event.  If not, then flip them off...

I made a game for the game academy that has one of those in it... would you like me to link it to you?  (it is RMXP, but you can still see how it works)

~Kraft
 
Yeah, I'd like to check your game out.  I'm so rusty using RPGMaker events.  I actually tried to do this using variables, but I still ran into the same problem; the game crashed whenever I tried to move the boulder event onto the switch.
 
I'd advise my Eventer's Toolbox, found in my signature, for this type of puzzles.

If you don't check "Skip If Cannot Move" when setting move route commands, the game will freeze if the move is impossible. Checking it will prevent the game from freezing, but the rock still won't move onto the switch.

To solve this, grab my toolbox below. After you have it set up, for the rock event, and before the movement, check if the rock is adjacent to the switch, and if it is, turn Through on so it can go onto the switch.
 
First of all, Kraft, fun little game you got there :)

It's helped me along quite a bit, but now I have a very strange problem.  The whole boulder thing works perfectly; the door opens if the boulder is kept on the switch, and closes if it's moved off.  However, for some reason, nothing happens when the player stands on the switch.  I have an identical parallel process running that checks the player's X and Y coordinates and it flags switches in the same ways as the one that checks the boulder's.  However, nothing happens when the player steps on the switch.  I'm thoroughly confused as to why this is, since both events do the exact same thing; the only difference is that one checks the boulder event's coordinates and the other checks the player's.

Hevendor, that looks like a handy script.  Perhaps I'll try it out tomorrow.
 
punched2death":jiwarbhp said:
I think, If I'm correct, alongside the boulder X Y positions, you'll also have to record the Player's X Y positions.
I may be wrong, but that is just an idea.

Yes, I'm doing that already.  I have a single event with the following four lines of code set as a parallel process:

Code:
Control Variables: [0001] = Player's Map X
Control Variables: [0002] = Player's Map Y
Control Variables: [0003] = [Boulder1]'s Map X
Control Variables: [0004] = [Boulder1]'s Map Y

Both the hero's and the boulder's coordinates are being "recorded" at the same time. 
 
You're probably using the same switch for the boulder and the player. If the player is on, switch EXAMPLE is turned on and the door opens. If the boulder is on, EXAMPLE is turned on and the door opens. But if the boulder if off the switch, EXAMPLE is turned off, so even if the player is standing on the correct spot, your parallel will still be checking for the boulder's coords., and since it's not on the right spot, the door is closed.
 
Hevendor":2fh1kndv said:
You're probably using the same switch for the boulder and the player. If the player is on, switch EXAMPLE is turned on and the door opens. If the boulder is on, EXAMPLE is turned on and the door opens. But if the boulder if off the switch, EXAMPLE is turned off, so even if the player is standing on the correct spot, your parallel will still be checking for the boulder's coords., and since it's not on the right spot, the door is closed.

Then why doesn't it work the other way around, too?  Since the player's coordinates also activate the switch, why is it that even if the player's coordinates are wrong, the boulder event can still activate it?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top