Hime’s Tileswap – Challenge Solution

In connection with a Friday Script feature on Hime’s tileswap script, I issued two challenges. The expert one will be in a dev blog post, coming soon. But let’s cover the other.

Intermediate Challenge

Brunhilde the Bruiser has a ground pound ability. When she activates it, she jumps into the air and lands with such shattering force, the very earth beneath her trembles and cracks. How can we make the ground itself split under Brunhilde’s might?

As we talked about a few weeks ago, we can use tileswap to create cracks in walls to conceal secret entrances. So what’s the difficulty with making a crack in the ground? The trick is to get the player’s position. Set up an event to call a common event.

Then, we need to build the common event. It needs to do two things:

I've left most of this untouched, but you can add text, costs, etc. as you like.

I’ve left most of this untouched, but you can add text, costs, etc. as you like.

1) Have our player jump in the air.

2) Create a crack in the ground under her feet when she lands.

The first step is easy. Just use Set Move Route, Jump, and don’t change the player’s position.

You can use jump with no parameters to give your character a little leap - it's great for cutscenes!

You can use jump with no parameters to give your character a little leap – it’s great for cutscenes! I’ve circled the cracked-tile to use, “A24.”

The second part requires calling pos_swap. Specifically, we want to place the tile at Layer 1 (above the ground, under a rock). We’ll use the crack tile in the standard RTP. It’s at A24, if you need a reference!

But before we call pos_swap, we need to know the correct x and y value, and the map. There are ways to do this if you’re scripting, but we can do it with events too. Just set three variables to your x, y, and map ID. After you do that, call pos_swap with those variables, and you’re set.

While in any other context we wouldn't bother assigning these numbers to local variables, this script call window is fickle at best. It's bad practice in the main script editor, and best practice here.

While in any other context we wouldn’t bother assigning these numbers to local variables, this script call window is fickle at best. It’s bad practice in the main script editor, and best practice here.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s