Hello, there! I've created a relatively simple jumping system using events, but I'm hitting a bit of a snag in regards to functionality.
The system works as follows: the player can use the action button to jump over a single-space gap. There are two events involved in a jump: one 'Below Character, player touch' event that binds a variable specifying which direction the player will jump (this event is on the ground right next to a gap); the other event is 'Same as Character, action button' that initiates the jump based on the variable set by the previous event (this event is on the gap itself, so when the player 'examines' the gap, the player will jump over said gap).
The problem, is that any gap can be jumped across from both sides, but the variable-setting event on the other side doesn't activate when the player lands (I'm assuming this is because the player is moved by an event rather than player input). Is there any way to remedy this? Am I missing something painfully obvious?
Thanks in advance.
If you post a screenshot of your event (all pages, and the whole page, not just the command section) it might be easier to spot the issue.
When I've done jumps I've just used the 'Jump' command from the Set Move Route in the event command menu. I've usually set it up something like this:
On the tile where I want the jump to occur:
Set to player touch
Set Move route: Jump: with the x and y coordinates one tile more than the size of the gap
I choose to do it one tile more for the same reasons I do transfer events so that the player is one tile 'ahead' of where they would return.
To return I use an identical event, except the x and y are now back on the first side of the gap.
No variables, no complications, because the Jump command takes the player to the correct tile irrespective of which way the player was facing when they stepped on the tile.
It doesn't have to be player touch, it could be action button as per your existing setup.
I think what he means is:
When you use an evented move-route to move the player ONTO another tile, it does not run that tile's event. (which player-touch doesn't run, and I think event-touch doesn't run either)
Your "one-extra-tile-ahead" thing might not be likable for him, depending on his maps.
Well, why would you want it to run when that tile's event is the command to take you back over the gap? You'd be stuck in an endless loop. That's the bit i couldn't get my head around.
Using the standard 'Jump' command you could land the player on the first tile if you want, nothing to stop you if that is your preference.
Thanks for the replies.
I can't post screenshots at the moment, but maybe this will help:
X Y Z
X represents the passable tile to the left of the 1-tile gap, Y represents the gap, and Z represents the passable tile to the right of the gap. Stepping on X sets 'Jump Variable' to 1; examining (pressing the action button on) Y activates a conditional branch that jumps the player two tiles to the right (landing on Z) if 'Jump Variable' is 1. Obviously, the player will jump to Z. Stepping on Z SHOULD set 'Jump Variable' to 2, therefore examining Y (the gap) will activate a conditional branch that jumps the player two tiles to the left (back to X) if 'Jump Variable' is 2.
The problem is, Z doesn't change the 'Jump Variable' number when the player lands on the Z tile. As a result, turning directly back to Y and examining it jumps the player two tiles to the right (instead of two tiles to the left) which is a huge problem. I wanted the player to press a button to jump because I feel it's more immersive that way, and so I created this little system for that purpose. I can't just put a single 'Below Player, action button' event on X or Z (nixing the event on Y) because the player could be looking away from the gap and still be able to initiate the jump sequence, which would be detrimental to the immersion I'm trying to create.
Does that make more sense?
EDIT: I hadn't even considered using the 'Event Touch' setting instead of 'Player Touch'. I'm away from my laptop right now, but I'll try switching the touch-type first and foremost.
I still think you are making this way more complicated than it needs to be. You can achieve all you want using the 'Jump' command in the Set Move Route command in the event editor. All it needs is one simple command.
Yes you're making this more complicated than it needs to be. You can do this with a single event on the gap.
Make a conditional branch - If player is facing left, then move route jump (-2, 0) else move route jump (+2, 0)
If you want some indicators on the ground, you can make a custom sprite 96x32 pixels wide OR just use two events instead without one in the gap. If you go with two events, just make it "below player" and "action button" and it should still activate if the player is ontop of the tile when they press the action button. In this case, just have them jump over to the opposite side. If you don't want them to be facing the wrong direction, just make another conditional branch checking which direction they're facing.
I've been using 'Move Route'; regardless, I didn't realize you could set a conditional branch that checks which direction the player is facing... I'll give that a shot. Thanks for the suggestions!