Snowboarding Game - Conditional branch comparing Player Y to Event's Y, BUT -1!!! =O

I bet this is so easy for you guys, but I'm rubbish!

So all I really need to do is achieve this (for now). If Event ID's Y = Player's (Y minus 1) do things. Surely there's a really simple line of code to do this.

1742141420542.png


When this fails I'll cry.

Here's a really longwinded video explaining exactly what I'm doing & why.
I didn't deepdive in what you have there, and how it works, but the easiest way would be:

Right before the conditional branch, load the heroY value into a new variable, reduce it by 1 and use that in your conditional branch.

1742143345532.png
Right before the conditional branch, load the heroY value into a new variable, reduce it by 1 and use that in your conditional branch.
OHHHHHH MY GOD!!! I MEANT +Y!!!!!!!! NOT -Y!!!! NOW I'M COMPLETELY SCREWED!!!

obviously kidding, that was a breeze!! Let's pray this works! Thanks!


Ahh gosh darn it! That doesn't work, I'm pretty sure that it's because this all done in a parallel process & so it has to be a scripted condition within the conditional branch. grrrrr...

it has to go here...
1742147082145.png
You can try this.

JavaScript:
$gameVariables.value(33) - 1 === $gameVariables.value(64)
If you're using my example from your other post, you can change the obstacle check to
Spoiler: Controlling Event
SnowboardController_BigEvents.JPG

So it's kind of weird because the sprites are drawn from the center bottom tile outward and upward. So my test big events are 5 tiles by 5 tiles. Meaning we need to extend our obstacle's collision 2 to the left (-) and 2 to the right (+) and compare to see if it is between the two. The Y is different since it starts at the bottom most tile and going upward is negative. So we need to see if it's less than or equal too our obstacle's Y but greater than or equal to our obstacle's Y - 4.

Spoiler: Crude Representation
SnowboardBigEvent.JPG

Hope it helps, good luck!
Meaning we need to extend our obstacle's collision

Spoiler: Crude Representation

Hope it helps, good luck!

I'm pretty sure I actually understand what you're saying here (check me out learning!). The issue is that the overlap of the player's coordinates can't overlap with the event's coordinates. This is because I'm extending the hitbox downwards to create regular* collision with vertical walls of the various landmasses. Your method uses "through" which allows the player to pass through those vertical hitboxes. I believe if I hit that from the side, it will still bounce the player up the screen. Will it not?
Yes, they are all set to through but touching the event's boundaries in any way will "hurt" the player and knock them back. To the player it happens so fast it appears they are crashing into the event. Pretty sure crashing into an object sideways on a snowboard would still result in a crash, lol.
You can try this.

JavaScript:
$gameVariables.value(33) - 1 === $gameVariables.value(64)
From what little knowledge I have, that is just comparing the two variables, so it wouldn't tell the conditional branch to calculate from Y+1, it would would just set the two as equal. So ummm... I mean it doesn't work in the way I was hoping. My only thought is maybe I could continuously update the offset Y with each movement of the player. A little lost.
From what little knowledge I have, that is just comparing the two variables, so it wouldn't tell the conditional branch to calculate from Y+1, it would would just set the two as equal. So ummm... I mean it doesn't work in the way I was hoping. My only thought is maybe I could continuously update the offset Y with each movement of the player. A little lost.
soon, Slaughty and the others create your game =)

but while it works, you need to understand the knowledge, as you might
doing something wrong, but slaughtly ways works, as it is also very easy to adjust.
Yes, they are all set to through but touching the event's boundaries in any way will "hurt" the player and knock them back. To the player it happens so fast it appears they are crashing into the event. Pretty sure crashing into an object sideways on a snowboard would still result in a crash, lol.
Sure, but if there's an obstacle behind them, it will crash into that too and that would continue forcing him back over and over. If he hits it four times that's essentially game over.
1742150265405.png


Also, it's just not what I'm after. Sorry to be picky, but y'know pursuing the vision and all that stuff!

Your help was epic in the previous correspondence. I learned a ton from it!

(edit) After thought: The bounce back may not be an issue if the bounce is always slower than the scrolling events... hmmmm. Not my preference, but if all else fails.
From what little knowledge I have, that is just comparing the two variables, so it wouldn't tell the conditional branch to calculate from Y+1, it would would just set the two as equal.
Used in a conditional branch, it'll return true, if the value of var33, reduced by 1, is the same as the value in var64. Change "-" to "+" if you need +1 instead. But I can't tell if this will solve your issue in the first place.
soon, Slaughty and the others create your game =)

but while it works, you need to understand the knowledge, as you might
doing something wrong, but slaughtly ways works, as it is also very easy to adjust.
Slaughty and Bass2Yang have been absolutely fantastic. I've never gotten so much support on a problem or asked so many questions in rapid succession. However, Slaughty has just said plainly that his method results in behaviours that are problematic in my situation. I'm far from simply copying and pasting. I assure you!

Used in a conditional branch, it'll return true, if the value of var33, reduced by 1, is the same as the value in var64. Change "-" to "+" if you need +1 instead. But I can't tell if this will solve your issue in the first place.
Yes I understand fully, that's what I figured. You have written it more eloquently. The thing is, this is all being done in a constantly updating parallel process. So rather than it saying compare Var64 to Var33 (which has already been reduced by 1) it has to say add 1 to Var33 and then compare. Does that make sense?

I'm thinking the other option is to continually update Var64 to Var64 +1 as the player moves. So that might be an option. Hmmmm... I'm off to go try something!

You've given me an idea! Thanks!
I have a completely different approach if you're up for it. Instead of using the scrolling parallax, it's a very long map. In my test I just did a 51 tile high map, not sure how long you need yours. We're basically "faking" the player input and moving the player with an autorun event. Using multiple different regions we can set how far back we want the player to jump to. So in my example, region 1 will jump the player up three tiles and region 2 will jump the player up 6 tiles. You could scale this however you need.

To be honest, this may be a better setup for weird/odd shapes and you could use your tileset instead of making a bunch of events.🙂

Spoiler: Map Setup
AltSnowboard_Map_1.JPG

AltSnowboard_Map_2.JPG
I guess the thing to note here is that the end is marked as region 5 so we know to end the game. Obstacles are marked either in Region 1 or 2. You can use as many as needed.
We'll also use a controlling Event like before, but this time it is an Autorun.
Spoiler: Controlling Event 1st Page
Setup our Player & Variables
AltSnowboard_ControllerPg1.JPG
Spoiler: Controlling Event 2nd Page
The "Brains"
AltSnowboard_ControllerPg2_1.JPG

AltSnowboard_ControllerPg2_2.JPG

AltSnowboard_ControllerPg2_3.JPG

AltSnowboard_ControllerPg2_4.JPG
The third page is just blank with a condition of SelfSwitch B so the Autorun stops when we reach the goal.
I have a completely different approach if you're up for it.
Damn dude! You are crazy fast (How in the heck?!?). Yeah, maybe. I was avoiding the option because I hoped my course would massively exceed 256 tiles (The RMMZ max). I was also hoping to put pursuers on the map... hmmmmm...

This would be a hardcore fallback option & it feels a shame, especially when my current question is as simple as "how do you add a conditional branch with a script that says "If player's Y+1 = Event's Y"". In my imagination this seems like something any decent coder could do effortlessly. I figured one of you would respond with, "here dummy" & fart out the script as if ain't no thang.

I can see numerous advantages of trying this new approach. Maybe I picked the wrong avenue to begin with. You are clearly a boss at this, the skills are evident!

I'm really tired, my head is a shed, so I'll have to review your new approach tomorrow. Gotta... go.. to...zzzzzzzzzzzzzzzzzzzzzz


Dude!!! You have just answered the first question that I ever asked on this topic!!

1742207667283.png


I can't believe it!! I've gone down this crazy rabbit hole for more than a week and half! And now, there it is!! OH MY GOD!

I'm leaping ahead now because my imagination is bubbling like crazy. But, I was thinking about seamless transitions between different maps. Actually, never mind, I'll save that hurdle for when I reach it.
Just saw this post haha. I thought you only had one post so I missed this part of your question from your first post.
Just saw this post haha. I thought you only had one post so I missed this part of your question from your first post.
Dude, don't even worry about it. I've started over half a dozen threads in less than two weeks trying to crack this nut. Slaughty's alternative method has so much potential. It's a total game changer (literally).

I have a completely different approach if you're up for it.
DUUUUUUUUUUUUDE!!!! WATCH THIS! You have no idea, what... just watch it!!

Dude, don't even worry about it. I've started over half a dozen threads in less than two weeks trying to crack this nut. Slaughty's alternative method has so much potential. It's a total game changer (literally).


DUUUUUUUUUUUUDE!!!! WATCH THIS! You have no idea, what... just watch it!!


I understand now - very cool! I think I have an old prototype of SkiFree with Harold somewhere lol.
This thread is closed at OP’s request. If you need it reopened, report it to let us know. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/snowboarding-game-conditional-branch-comparing-player-y-to-events-y-but-1-o.176285/