Jump to content
Oldman

Zelda style dungeon puzzle blocks

Recommended Posts

In this tutorial we'll be making an event, which looks like a crate/block, that you can pull, push, and climb over to get to new locations.  To cut down on our event scripting we're also going to use region ID's to determine where your character can climb on their box (this helps prevent you from getting stuck in walls).

 

First, create an event.

 

Next, pick your graphic - I use a crate, but you can use whatever you want (including the corpses of dead enemies)

 

Make the priority the same as characters so that you don't walk through your stepping stool.  The trigger is the action button.  Uncheck the "Walking Anim." box if it's selected.  Also, set the move speed of the event to normal, otherwise it'll look wonky when things start to move around.  (Note: when you set your move routes be sure to check the "Skip if cannot move" box or the game will lock up when you hit a wall.)

 

Now we're going to go into the contents:

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

 

@>Show Choices: Push, Pull, Climb

 :    When [Push]

      @>Play SE: 'Earth1', 50, 100

      @>Wait: 10 frame(s)

      @>Set Move Route: This event (skip)

                                      : $>Turn away from Player

                                      : $>Move away from Player

      @>Set Move Route: Player (skip)

                                      : $>1 Step Forward

      @>

:     When [Pull]

      @>Play SE: 'Earth1', 50, 100

      @>Wait: 10 frame(s)

      @>Set Move Route: Player (skip)

                                      : $>1 Step Backward

      @>Set Move Route: This event (skip)

                                      : $>Turn toward Player

                                      : $>Move toward Player

      @>

:     When [Climb]

      @>Control Variables: [0001] = This event's Map X

      @>Control Variables: [0002] = This event's Map Y

      @>Get Location Info: [0003], Region ID, (X loc of region you want, Y loc of region you want)

      @>Get Location Info: [0004], Region ID, Variable [0001][0002]

      @>Conditional Branch: Variable [0003] == Variable [0004]

            @>Conditional Branch: Player is Facing Up

                  @>Set Move Route: Player (skip,wait)

                                                  : $>Jump: +0,-3

                  @>

             :    Else

                  @>Text: -,-, Normal, Bottom

                   :           : You can't climb from this direction.

                  @>

             :     Branch End

            @>

        :    Else

             @>Text: -,-, Normal, Bottom

              :           : Can't climb here.

             @>

        :    Branch End

       @>

  :     Branch End

 @>Exit Event Processing

 @>

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

 

This is a little more advanced, so if you're brand new to Ruby you'll need to check out where to go to get the options you're looking for on the variables.  If you have any questions just post them here and someone's likely to get to you soon.  Also, this is a very basic version of this event.

 

You can expand this event to include the ability to jump from multiple directions based on different regions you've set on the map.  Play around with this and you'll be setting up Zelda style dungeon puzzles in no time.  Have fun!

 

PS: Thanks to Cap'n for helping me figure out how to do the Event Variable storage! (See here if you have troubles: http://www.rpgmakervxace.net/topic/12357-storing-event-x-y-to-variables/)

Edited by Oldman

Share this post


Link to post
Share on other sites

Yes i tried it like this before i found your tutorial. I solved the problem with

the Followers with the option "walk together" and then, after the move event of the boulder, regroup. Although it looks a bit weird it works...

Edited by Snake

Share this post


Link to post
Share on other sites

Cool, thanks! 

 

Another issue cropped up during alpha testing of my game.  It turns out that if the player tries to do a jump in an unsupported region that they sometimes get the deny message and then the script goes dead for some reason.  I tried to recreate the bug and it turns out if they try to climb the block from an unsupported direction in an unsupported region the script goes dead and you can't interact with it anymore.

 

I'm not sure why it does this just yet.

Edited by Oldman

Share this post


Link to post
Share on other sites

Not sure why but this isn't working for me. I'm new to this stuff and was wondering if anyone could help me troubleshoot.

 

Using the example provided I think the problem occurs with the Get Location Info lines.

 

But let's start with my problem. I set the event as described but, when I select "climb" it always returns true. After a biut of troubleshooting I found that, no matter what, the following argument always returns true

 

      @>Conditional Branch: Variable [0003] == Variable [0004]

 

So I ran it again and used F9 to bring up the debug window. Looking at the variables it seems 0001 and 0002 were correct for the X, Y coords of the event but 0003 and 0004 both returned the value 0

 

      @>Control Variables: [0001] = This event's Map X

      @>Control Variables: [0002] = This event's Map Y

      @>Get Location Info: [0003], Region ID, (X loc of region you want, Y loc of region you want)

      @>Get Location Info: [0004], Region ID, Variable [0001][0002]

 

So, technically, the code is working as the conditional branch checks to see if 0003 and 0004 are the same.

 

I just don't understand what I'm doing wrong with the Get Location Info things

 

DnMYqFR.jpg

 

zAIZhfX.jpg

 

84FKjyW.jpg

Share this post


Link to post
Share on other sites

@Tankenspank - I imagine it would help if the second 'get location info' in your project was not set to the same variable as the first.  After all, the tutorial references four different variables (two for coordinates and two for location info).

 

@Oldman - I couldn't come up with a definitive solution to your problem, but I don't think your inclusion of Exit Event Processing is necessary.  Since the event is action button-triggered, I'm fairly certain the program stops processing the event automatically when it reaches the end of the command list unless the list is in a loop or something (though why it would be is beyond me).

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×