ANIDANNY'S PROFILE
AniDanny
0
Search
Attempting to make a teleport mechanic (RMXP)
I want to add a typical "jump" mechanic to my game. Press button, move two squares forward (if that's an acceptable move).
I don't know how to make scripts, so I've been trying this as a common event (similar to a "running" common event I've seen: press button, increase player's move speed; else regular move speed).
I initially tried to make it "can teleport over terrain tag 1 or 2 tiles, and can land on terrain tag 0 or 2 tiles" : making it so that 1 was the "gap" that's okay to cross over, 2 are special tiles that can be landed on, and 0 are general tiles that the player can walk on.
This didn't work, as the player would often land on a non-walkable tile. I eventually decided to scrap this in favor of two separate mechanics: a common event to teleport on regular, walkable land, and specific events placed next to gaps to teleport the player across those.
I don't know how to take post images, so I'll post this as psuedo-code to make it easier to follow. For the common event (teleport up):
If Z is pressed
... and if the player is facing up
... and if the terrain is type 0 (can be walked on)
...... wait 10, move player (through, up)
...... if terrain is type 0
......... wait 10, move player (through, up)
......... if terrain is type 0
............ teleport succeeds
......... else move (down, down)
...... else move (down)
And for the events that are placed, rather than run parallel to the game:
If Z is pressed
... and if player is facing up
... and if player is standing on this event tile
...... move (up, up)
I've tried several variations on these, adding both "wait 10" and "move: player: wait 10" to various points during the events, in hopes of not having the game break due to button mashing. What is currently happening seems to be that the game doesn't wait for the event to run completely before allowing another button input. So if the player mashes Z, the game reads "move (up, up)" "move (up, up)" "move (up, up), check terrain, not good terrain, move (down, down)." Which leads to the problem of potentially being four tiles beyond where the player should be allowed (standing over an abyss, inside a wall, etc).
What I need is some way to say "while this event is going on, ignore all commands given by the player". Or some other way of setting up the teleport system that will result in this outcome. Craze told me that Great Red Spirit might be able to help, but if anyone else knows how to fix this, feel free to give some input. If there's anything I need to go into more detail on, please let me know. Thanks!
I don't know how to make scripts, so I've been trying this as a common event (similar to a "running" common event I've seen: press button, increase player's move speed; else regular move speed).
I initially tried to make it "can teleport over terrain tag 1 or 2 tiles, and can land on terrain tag 0 or 2 tiles" : making it so that 1 was the "gap" that's okay to cross over, 2 are special tiles that can be landed on, and 0 are general tiles that the player can walk on.
This didn't work, as the player would often land on a non-walkable tile. I eventually decided to scrap this in favor of two separate mechanics: a common event to teleport on regular, walkable land, and specific events placed next to gaps to teleport the player across those.
I don't know how to take post images, so I'll post this as psuedo-code to make it easier to follow. For the common event (teleport up):
If Z is pressed
... and if the player is facing up
... and if the terrain is type 0 (can be walked on)
...... wait 10, move player (through, up)
...... if terrain is type 0
......... wait 10, move player (through, up)
......... if terrain is type 0
............ teleport succeeds
......... else move (down, down)
...... else move (down)
And for the events that are placed, rather than run parallel to the game:
If Z is pressed
... and if player is facing up
... and if player is standing on this event tile
...... move (up, up)
I've tried several variations on these, adding both "wait 10" and "move: player: wait 10" to various points during the events, in hopes of not having the game break due to button mashing. What is currently happening seems to be that the game doesn't wait for the event to run completely before allowing another button input. So if the player mashes Z, the game reads "move (up, up)" "move (up, up)" "move (up, up), check terrain, not good terrain, move (down, down)." Which leads to the problem of potentially being four tiles beyond where the player should be allowed (standing over an abyss, inside a wall, etc).
What I need is some way to say "while this event is going on, ignore all commands given by the player". Or some other way of setting up the teleport system that will result in this outcome. Craze told me that Great Red Spirit might be able to help, but if anyone else knows how to fix this, feel free to give some input. If there's anything I need to go into more detail on, please let me know. Thanks!
Pages:
1













