Special Movements: Walking on Diagonal Stairs
hiddenone
by
hiddenone
on
January 18, 2022
January 18, 2022

Special Movements: Walking on Diagonal Stairs

Special Movements: Walking on Diagonal Stairs
by

hiddenone

on

January 18, 2022

Do you want to include some side view stairs or slopes on your maps but aren’t sure how to let your players use them? Let’s take some time today to see how we can use events to make the most of these stairs.

I’ll be using Avery’s side view stairs for this tutorial, but use whatever tiles work best for your map. With our tiles picked, we can add some staircases to our maps… And realize right away that there are a lot of tiles involved. How do we know where our player should walk?

It’s a lot easier to see where to go when you overlay the map with a tile grid, such as when you’re in the events editing mode. With a grid over the stairs, you can see where our player needs to walk diagonally to stay on the stairs and where they should walk normally again.

And if it’s still tough to figure out, make sure to use the preview option in the move route!

Now that we have a general idea of what needs to happen, how do we get our player to walk up or down the stairs? We have two options: forced movement and giving control to the player. Let’s look at the easier option first, force movement.

Forced Movement

To force our player to use the stairs properly we’ll need at least two events, one to walk up the stairs and one to walk down them. The main setup is the same for both, with the Priority set to ‘below characters’ and the Trigger set to ‘player touch’ so that as soon as our player steps onto the event a move route will force them to use the stairs.

To move up the stairs we’ll need to move Upper Right twice and then Right once.

And our move route to walk down the stairs is moving Lower Left twice and then Left once.

With our events made, we can copy-paste them onto the rest of the stair tiles so that our player can walk on the stairs no matter their approach. If we were going to have a lot of staircases that are the same size we could even set up common events for walking on the stairs where the direction our player is facing will affect if they’re walking up or down the stairs, but that’s not necessary for this example.

All that’s left is to playtest and make sure we can move properly on the stairs.

Now, forced movement is great for short staircases or slopes, but what if we had a really long staircase and our player realized halfway up that they left something behind? They would need to finish going up and then turn around to move the whole way back down the stairs. So why not give our player control over their stair-walking?

Player Control

To give our player control, we’ll need to change what the Left and Right buttons do when they are pressed on the stairs. For this example, let’s make pushing the Left button force the player to move to the Upper Left via a move route and the Right button move Lower Right. An autorun event will let us do that, but we’ll also need to let it know when it should activate so we don’t have our player walking diagonally around the rest of the map.

While we could use events like our forced movement ones to activate the stair autorun, for this example let’s use regions and a parallel process. We’ll mark the top and bottom of the staircase with two different regions, 10 and 11 in this case. These regions will help us tell our event when our player is stepping onto the stairs and when they’re stepping off them.

Our control event for this needs its first page’s Trigger set to ‘parallel’, with two conditional branches to see if our player is standing on one of our chosen regions and a short wait. We could have the event set a variable to the region our player is standing on with the ‘get location info’ command and then have the conditional branches check if that variable equals 10 or 11, for this event let’s use the script call $gamePlayer.regionId() == n in our conditional branches instead. If our player is standing in either region, it’ll turn the self-switch A On which will activate our second page.

Our second page is set to ‘autorun’, so that our player can only move how we want them to. A conditional branch for both when the Left button is pressed and when the Right button is pressed can let us replace that movement with a diagonal move route, but we need to nest  another conditional branch into those conditional branches. After all, if we don’t have a way to check if our player is standing on one of our regions there’s no way for our event to know when our player is done moving diagonally.

Since region 10 is the one on the left side of our stairs, we need to nest a conditional branch to check for that region in the Left button conditional branch. If our player is standing on region 10 and is pressing left, then they’re stepping off of the stairs and we need to turn self-switch A Off. If our player isn’t standing on region 10, then they are still moving on the stairs so they need to move diagonally. Then we just need a similar setup to check if they are trying to move right while on region 11, and our event should be good to go.

With our event and map ready, we can playtest and make sure it’s all working properly. If we wanted to include multiple staircases that go in both directions we could use another set of regions to activate a third page where the directions are changed to keep our player on the stairs.

With that, now we can add diagonal movement to slopes and stairs to our games! Are there any other ways you could see using this in your games?

Recommended Posts