The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: Pokey on February 17, 2011, 05:29:37 AM

Title: [RMXP]Puzzle problem
Post by: Pokey on February 17, 2011, 05:29:37 AM
I'm trying to make a small puzzle in which the hero has to move 4 boxes to any of the 4 slots to unlock the door. Somehow, its just not working. I've added the system in a map and uploaded it. Can anybody tell me why it's not working?
Title: Re: [RMXP]Puzzle problem
Post by: Zeriab on February 17, 2011, 07:46:51 AM
I cannot say for certain what the problem is since you have cleaned out the common event you used. (I do assume you have made the boulders move :P)

If the places cannot move around and you have terrain tags to spare then using those is often the easiest way to accomplish what you want. Look at my Boulder Pushing Example (http://www.mediafire.com/?nwmmixywm0n) to see how to use terrain tags to implement a solution.

Looking at what you gave me I would highly suggest to simplify and clean up the system as you'll often figure out the problem that way. I also suggest using the in game debug menu (Press F9 while on a map) to see if the switches turn on and off as expected.
Since you have split the calculations into several parallel processes I suggest that you use this to your advantage. Look at the attached file where I have cleaned up your events. I have made your conditional switches much easier to understand and accidentally fixed the switch problem present.

Understand that when you have multiple pages in an event the game always goes for the page with the highest number. If the conditions for that page is not met it goes to the next highest number.
Can you see the problem with your door event?

Finally I have added a 1 wait frame to each parallel event except one. Find that one and add it yourself.
The reason is that parallel processes are normally processed 3 times every 2 frames. By adding a single frame wait I cut that in half or down to a third (I don't remember)
Except in very rare circumstances the difference is not noticeable to the player, but with heavy events not adding the 1 frame wait can add a heavy toll on cpu time which can translate into lag for the player. I advice doing this for parallel processes whenever possible.
In this case you probably can use say 4 or 5 frames waits without a problem since it's just in charge of unlocking the door.

*hugs*
Title: Re: [RMXP]Puzzle problem
Post by: Pokey on February 17, 2011, 09:08:38 AM
oops sorry!
when i copied the events, i forgot to copy the common event :-[
Thanks!
[edit]:Hey, its working!
stupid me, instead of putting move away from player, i added a whole set of conditions(player facing direction) to my common event...
Anyways Thanks again!
[edit 2(sorry :P)] i also found a way to reduce processing. since the places dont move, i should have made an autorun, set them, and exited processing