QUOTE (Malexos @ Aug 4 2010, 03:34 PM)
“Good job with the tutorial, but There’s a way you can do this with just one event…
Okay, so I lied. This needs two events to control the ice-sliding, but you also have to have obstacles, right? (But the bright side is you won’t need events on every square- or any square that you’re stepping on, for that matter.)
I HIGHLY RECOMMEND (HINT HINT HINT) That you download the demo. Please. If at the end of this tutorial you have a question, it’s probably because you didn’t play and look through the demo. If you have a question and you’ve played the demo, by all means, ask.
Demo Link
Note for the demo: If you want to finish the puzzle, you’re going to have to use Psynergy. Use Psynergy by pressing the “S” key. This will move certain objects as long as they’re one space away from you.
Okay! On with the tutorial!
Ice Sliding Puzzles
The first thing you need to do when making an ice-sliding puzzle is create your basic outline. For my method, it is highly recommended that you use a rectangle/square, like so:

Next, you have to make the puzzle. As in, add obstructions that your player will have to skillfully use to slide about the room until they reach the other side. When I was working on Mr. Peebles and the Olympics, I was rushed for time. So instead of being creative, I copied the puzzle right out of Pokemon GSC (But I DID add a twist involving Psynergy and a Snowman.
)


THINGS TO REMEMBER WHEN MAKING YOUR PUZZLE:
1. While we all like a challenge, but if you make your puzzle TOO challenging, (i.e. 500 possible routes) the player may get frustrated/lose interest
2. Make sure there’s ALWAYS a way out if your player gets stuck.
Now that you’ve got your puzzle created, it’s time for the real reason why you’re reading this: the Events.
Firstly, you’ll need an event to track the movement of your character to see when they enter your ice-sliding area. (This will be easy-peasy if you made it a sqwectangle like I specifically told you to at the beginning.)
In order to do this, you’ll need to get the coordinate-range of your area. Go into the map editor in event mode, and click on the square on the top-left corner of your area. The coordinate should appear at the bottom of the map editor, like this.
Repeat until you have the following for your area:
Lowest X/Y Value
Highest X/Y Value
Now that you have your values, plug them in to the following script call:
get_character(-1).x.between?(Lowest X value, Highest X value) && get_character(-1).y.between?(Lowest Y value, Highest Y value)
~o~o~O~o~o~
Here’s where it gets complicated. I’d much prefer it if you’d simply play the demo but if you’re one of those people who don’t like to take the time to download, I’ll do my best to explain.
1. Create a new event on your map. This is the event that will track your player’s movement. Set the event trigger to “Parallel Process” . Now use the LABEL command to create a label named “Start“.
2. Create a conditional branch with the code I gave you not too long ago.
3. Under that conditional branch, create a “Wait” set for 1 frame. One. Un. Ein. Uno. Il. Ichi. Hanna. This is done so that the engine has time to think. For one reason or another, the event will not work at all if you do not include the wait.
4. Under that wait, create another conditional branch. Set the condition for “Player Facing Up”. This, of course, checks to see if the player is facing up.
5. Under that conditional branch, turn a switch on. This can be any switch, but label it so you know you’re using it exclusively for the ice slide. You can reuse this switch for different ice puzzles only if you have one puzzle per map. If you have more than one ice sliding puzzle on any given map, you’ll need to use multiple switches.
6. [OPTIONAL] If you want, you can turn up your players speed here, so it looks like they’re sliding faster than they would normally walk. This is optional.
7. This part is not optional. It won’t affect the event if you don’t have it in place, but it’ll look pretty stupid if you don’t have it: turn the player’s walking animation off.
8. Create a label named “Up”.
9. Set the player’s move route to Move up (x1). Check skip if cannot move, and wait for completion.
10. Create yet another conditional branch to check to see if your Slide switch is off
11. Under that conditional branch, change your player’s speed back if you changed it, and turn the walking animation back on.
12. Now create a “Jump to label” command, to jump to the Start label you made earlier.
13. Go to under the “Else” (hereafter referred to as ”The Exception”) for that conditional branch, and create a Jump to label command to jump back to the Up label.
14. Repeat this process for all four directions, and add them under the exception for the conditional branch that checks for direction.
Your event should look like this when you’re done. (Click to see it 100%)

Okay, now for the REALLY COMPLICATED part. (Again, I implore you to download the demo)
This new part ensures that your player stops when they hit a wall.
1. Create a new event.
(If you’re using Woratana’s Extra Move speed script like I am, you will need a blank page before the page you’ll be working on, because the script cannot handle events not ‘existing’ for some reason >_>)
2. Set the conditions to “Switch [Slide Switch] is ON”.
3. Create a conditional branch with the area code I gave you so many lines ago.
4. Under that conditional branch, create another conditional branch that has the following code:
get_character(-1).y == Lowest Y Value
This will check to see if your player hit the upper wall.
5. Under that branch, check to see if the player is facing up; after all, we don’t want the player to stop if they’re sliding along the upper wall, do we?
6. Under that conditional branch, turn your slide switch off
7. Under ”else” for that conditional branch, do the same thing for every wall of your area.
-o-o-o-o-o-o-o-o-o-o-o-
CREATING OBSTACLES
Now for a really simple part
You have your obstacles, yes? Well create an event in place of them:
1. Set the event’s priority to “Same as characters”, and the trigger to “Player touch”
2. In the event’s code, create a command that turns your Slide switch off
3. That’s all!
That event will simply stop your player in it’s tracks so that it’s forced to change directions.
If you haven’t gotten the hint yet, I really want you to DOWNLOAD THE DEMO. So please do before you ask me a question that can easily be solved by looking at the demo.
(For anyone who happens to read this before I upload the demo, I’m uploading it now so be patient…)