NIFTY NIBBLES - ICE SLIDE

How do I make myself slide along the ice?

NIFTY NIBBLES
A collection of small, basic mini-tutorials for those who're new and old to RM2K3.
This first 'NN' is about making an ice slide.


Ice Slide
Ah, ice sliding. Well all love trying to find a way across that very slippery ice to get to that last treasure chest, bouncing off rocks and trying not to slide right past it. It doesn't look too hard to pull off in a game, right?
Right!
Because thanks to your friend Mr. Terrain ID, you too can feature a sliding puzzle in your game!
How?
Well, let's take a look-see below...


To create an ice slide you will need to know how to use forks, variables and the Terrain ID. If you do not know how to use a variable or set Terrain ID, check the help file. If you don't know how to use forks... I hope you have some chopsticks ready.

Setting Up
The first thing that you'll want to do is open your 'Terrain' tab in the database and add a new terrain. Call it 'Ice', 'Sliding' or whatever the hell you want. Now, remember what number it is, okay? Good!

Still in the database, head to the 'tileset' tab and find the tileset for the map that you want to have an ice slide. To the far right of the screen you should be able to see the terrain list. Click on the 'Ice/Sliding/whatever' terrain, then click on the tile that you want to be able to slide whilst on. Congratulations! You've reached the 1/4 point of this tutorial.

Now, you can do this two ways from here-on out. If you are going to have a lot of Ice Slide puzzles and don't have much in the Common Event area you can make a new Common Event (easier). If you have a lot of Common Events, or only want to make a few Ice Slide puzzles create a new event on the puzzle map.

Choice made? Alright. The process only differs slightly in either case.
COMMON EVENT: Make a new Common Event called 'Ice Slide'. Make it a parallel process that begins when a switch (Ice ON) is turned on.
MAP EVENT: Create a new event on the map. Set it to Parallel process.

That should do it for the differences. Now that that's all set up, let's 'code'!

'Coding'
First we want to check if the hero is standing on ice. Pretty easy.
Create two variables. One called "Hero X", the other "Hero Y". Set them both to check on... yep, you got it! The heroes X and Y positions.
Now, on the second page of commands you'll find one called 'Store Terrain ID'. Guess what this baby does. ^.^
Make it reference your 'Hero X' and 'Hero Y' variables. This will check to see what terrain your hero is standing on... but wait! We're not finished yet. You need to name your new variable. Let's call it 'Hero Terrain'.
Create a fork condition, checking to see if the variable 'Hero Terrain' is equal to... what? Hm. How about that number I told you to remember? The Terrain ID. Hope you didn't forget it.
Now we have a fork condition that will check to see if we are standing on ice. If we are, you can input a move event that will move your hero forward. Wow, that was easy.
Oh, hold up! There's just one more thing to do. Under the fork add a 'Wait 0.0' command. This will help avoid lag.

Now, get out there and give it a go!


Image


Notes
No forks were harmed during the making of the tutorial.
Now taking requests. Anything basic, small and miniature (except ponies... and leprechauns) will be considered.

Posts

Pages: 1
Nice little tutorial. :) This'll come in handy if I ever need such a system.
Is there any reason you can't just make an event on each tile of ice that activates on Touch Hero with a single command: Move Hero Forward? Sure, it makes for a lot of map events, but I find that I'd take anything over a recurring parallel process.
Just the little fact that sometimes they tend to glitch and look a bit choppy. And if you're going to be using a lot of ice sliding puzzles it's more economic to use just the one event than a whole lot of them.
can I translate it into Polish? It could help people from my country.
Sure, go right ahead. ^.^ If it helps people, it'll be doing it's job.
Wow, I used a common event for an ice puzzle I just made, but I made it by turning on a switch at certain points on the map instead of using a different terrain. This would have made things even easier.

EDIT: Actually, my puzzle has an important element that this simpler solution doesn't account for, so I didn't waste as much time as I thought :)

2nd EDIT: ACTUALLY, this solution WILL makes things somewhat simpler and still work for me after making some slight adjustments.
Pages: 1