Recently, I needed a Moving Platform for my game. Earlier, I got it working perfecto! Then I was suggested by Falcon to make a tutorial, and now I'm making it :lol:
Ingredients:Four variables
Basic knowledge of RMXP
Stages:1. First make four variables to be prepared.
[spoiler](https://rmrk.net/proxy.php?request=http%3A%2F%2Fi4.photobucket.com%2Falbums%2Fy144%2FArmy100%2FTutorial%2520Images%2FTutorial1.png&hash=57f73d6acf8e0c5b1247e80cfa43e215ede279b6)[/spoiler]
Without these, this entire tutorial will be for nothin...
2. To start, make a brand new Event. Then make another page by pressing the 'New Event Page' at the top of the event thing. Also, make them both parallel process. Before you finish, make the second page have a condition of Self Switch A or somethin like that.
3. These next few instructions will be for the first page.
A. Put into the event something like...
Quote@> Control Variables: [XXX: Player X] = Player's Map X
@> Control Variables: [YYY: Player Y] = Player's Map Y
@> Control Variables: [XYZ: Platform X] = this Event's Map X
@> Control Variables: [ZZZ: Platform Y] = this Event's Map Y
4. Make a conditional branch about whether the 'Players X' variable is equal to that of 'Platform X'. There should be no 'else' in this branch. Then into it make another conditional branch inside the first one, but this one should have a 'else'.
B. Into the first part of the conditional branch add somethin like (First bit is rather pointless) ---
[spoiler]
Quote@>Wait for moves completion
@>Set move route: Player
Through on
Through off
@>Wait for moves completion
@>Set move route: This event
Through on
Move down
Move down
Move down
Move down
Through off
@>Set move route: Player
Move animation off
Change speed 3
Through on
Move down x4
Change speed 4
Move animation on
Through off
@>Wait for moves completion
@>Wait 20frames
@>Control self-switch A on
[/spoiler]
5. In the 'else' on the conditional branch add ---
[spoiler]
Quote@> Set move route: This event
Through on
Move down x4
Through off
@>Wait for moves completion
@>Wait: 20 frames
@>Control self switch A on
[/spoiler]
Your result should be somethin like -
[spoiler](https://rmrk.net/proxy.php?request=http%3A%2F%2Fi4.photobucket.com%2Falbums%2Fy144%2FArmy100%2FExamples%2FPage1Working.png&hash=d6b997a5e6970affd83fc143c0d6b3a17133ed89)[/spoiler]
With these added you should be able to get the moving platform to move downwards four times, with or without the player on it. In order to get it to go backwards, just re-add everything again but change everything with says 'Move down' into 'Move up'... Oh and put it on the next page, so that something doesnt happen and screw it up. This is somethin like makin it look like -
[spoiler](https://rmrk.net/proxy.php?request=http%3A%2F%2Fi4.photobucket.com%2Falbums%2Fy144%2FArmy100%2FExamples%2FPage2Working.png&hash=a0927515d544a75d2b76baadc9e0a0cf17b0377b)[/spoiler]
Credits -
Me
Aliensoldier
Modern Algebra
If weren't for these people this wouldnt be here.
Found bugs - Non moving. Read the third post in order to see this bug and fix it.
Looks good. +rep
While toying around with my own platform, I found a really annoying bug :police:
When you arent on the platforms X or Y lines, then it work move. So you have to make the first conditional branch have an else, then you into that, you add the part which allows it to move around without the player on it by c & p. :bean:
Quote from: Halestorm5 on March 30, 2008, 05:42:40 PM
While toying around with my own platform, I found a really annoying bug :police:
When you arent on the platforms X or Y lines, then it work move. So you have to make the first conditional branch have an else, then you into that, you add the part which allows it to move around without the player on it by c & p. :bean:
So what exactly do I add in the first else?
Quote@> Set move route: This event
Through on
Move down x4
Through off
@>Wait for moves completion
@>Wait: 20 frames
@>Control self switch A on/off
Thats what u put into the first else ;D
While it seems pretty good, the size seems bad. I doubt you'd actually need 4 switches, to say the truth, but I haven't excactly looked too much into detail on this one. It's a great tutorial. How about when using large platforms using more than one square?