Joined
Jul 16, 2017
Messages
55
Reaction score
11
First Language
English
Primarily Uses
RMMV
Hi, I'm working on a project with a lot of jumping. I event each jump using XY coordinates but wanted to expand by jumping to a moving event.

If there's a way to do this with native eventing, that would be perfect. If not, I was wondering if someone could help me with a script or plugin.

Example video: In the video you first see simple event jumping. At the end of the video you see a moving event I'd like the character to be able to jump to. Technically he should be jumping to the tile directly above the event and then should follow the event back and forth as it moves (like he's riding it).

Thank you so much to anyone who's willing to help out!




 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
692
Reaction score
368
First Language
English
Primarily Uses
RMMV
You can use Control Variables to set two variables to the event's X and Y using $gameMap.event(eventID).x and .y
Then I think to jump to the coordinates in your variables I'd say use a plugin, Galv and Yanfly both have one. I'm sure there's a way to call the function, but I'm not seeing it with a quick search.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,366
Reaction score
1,777
First Language
EN
Primarily Uses
RMMZ
You could try something like this in a Script element in a move route:
JavaScript:
var ev = $gameMap.event(42); this.jump(ev.x - this.x, ev.y - 1 - this.y)
I think this'll jump to 1 tile above the current position of event ID 42, change the numbers as needed~

Alternatively in a Script command (outside of a move route):
JavaScript:
var ev = $gameMap.event(42);  // target character
var ch = $gamePlayer;         // character who will jump
ch.jump(ev.x - ch.x, ev.y - 1 - ch.y);

Complications for your specific situation:
  1. Moving target: ideally you'd want to know the landing location when the jump starts. Adjusting the target coordinates each frame mid-jump could cause a wiggly, unnatural-looking jump path. Not sure of the best solution there...

  2. Tile-based movement: internally the platform moves 1 whole tile, waits for the visual transition, moves another whole tile, etc. May require adjustment of jump times/speeds to land "properly"? I think that sort of thing would need a dedicated plugin.

  3. Synchronised forced movement (e.g. riding on a moving platform) is easy; no problem if this part is a cutscene. If you want to process user input during the ride, that's more difficult. One option is to activate an autorun event for the duration, with a loop that checks for input once per frame and reacts accordingly.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,881
Reaction score
1,355
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi!
@caethyril says almost everything you need to know.

As I can see in the video, made the player jump on a static event is easy, but when you have a moving event, that is more complicated.

Because even if you take the events X and Y and made the jump according to it, the event will move from the position and I believe the player will not jump at all or even jump and land in a tile that was not supposed to be passable.

You can adjust this by eventing, but I believe it is a little tricky because you will have to consider not only the mechanic stuff but the visual stuff too(the tile-based movement explanation above).

But maybe, you can get around with this with my plugins:

Jump System(MV & MZ)

Moving Platform - turn events into platforms (Not release to the public yet)
 
Joined
Jul 16, 2017
Messages
55
Reaction score
11
First Language
English
Primarily Uses
RMMV
You can use Control Variables to set two variables to the event's X and Y using $gameMap.event(eventID).x and .y
Then I think to jump to the coordinates in your variables I'd say use a plugin, Galv and Yanfly both have one. I'm sure there's a way to call the function, but I'm not seeing it with a quick search.
Thank you! I might check out those plugins. :)
 
Joined
Jul 16, 2017
Messages
55
Reaction score
11
First Language
English
Primarily Uses
RMMV
You could try something like this in a Script element in a move route:
JavaScript:
var ev = $gameMap.event(42); this.jump(ev.x - this.x, ev.y - 1 - this.y)
I think this'll jump to 1 tile above the current position of event ID 42, change the numbers as needed~

Alternatively in a Script command (outside of a move route):
JavaScript:
var ev = $gameMap.event(42);  // target character[/INDENT]
[INDENT]var ch = $gamePlayer;         // character who will jump[/INDENT]
[INDENT]ch.jump(ev.x - ch.x, ev.y - 1 - ch.y);

Complications for your specific situation:
  1. Moving target: ideally you'd want to know the landing location when the jump starts. Adjusting the target coordinates each frame mid-jump could cause a wiggly, unnatural-looking jump path. Not sure of the best solution there...

  2. Tile-based movement: internally the platform moves 1 whole tile, waits for the visual transition, moves another whole tile, etc. May require adjustment of jump times/speeds to land "properly"? I think that sort of thing would need a dedicated plugin.

  3. Synchronised forced movement (e.g. riding on a moving platform) is easy; no problem if this part is a cutscene. If you want to process user input during the ride, that's more difficult. One option is to activate an autorun event for the duration, with a loop that checks for input once per frame and reacts accordingly.
Thank you for taking the time to set all this out. :)

I think #3 is the one I want to take a look at. Would you be willing to explain how to create a loop that checks for input once per frame? I'm a noob with this sort of thing.

Thanks again!
 
Joined
Jul 16, 2017
Messages
55
Reaction score
11
First Language
English
Primarily Uses
RMMV
Hi!
@caethyril says almost everything you need to know.

As I can see in the video, made the player jump on a static event is easy, but when you have a moving event, that is more complicated.

Because even if you take the events X and Y and made the jump according to it, the event will move from the position and I believe the player will not jump at all or even jump and land in a tile that was not supposed to be passable.

You can adjust this by eventing, but I believe it is a little tricky because you will have to consider not only the mechanic stuff but the visual stuff too(the tile-based movement explanation above).

But maybe, you can get around with this with my plugins:

Jump System(MV & MZ)

Moving Platform - turn events into platforms (Not release to the public yet)
Thanks so much, I'll check out your plug-in, I'm always in the market for a cool new plugin. :)
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
692
Reaction score
368
First Language
English
Primarily Uses
RMMV
Just as a suggestion, it's really annoying to others to have such a huge picture in your signature. It takes up a lot of the screen and it's visually distracting when trying to read your posts.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,366
Reaction score
1,777
First Language
EN
Primarily Uses
RMMZ
Would you be willing to explain how to create a loop that checks for input once per frame?
The logic is most often used for QTEs, "quick time events", e.g. press a button at a specific time and/or button-mash in a set time interval. Here are some related links:
I made a little demo to illustrate [a Dead by Daylight style QTE] here, in case you're interested: timedInputDemo.zip (Google Drive) [2.5 MB]
This kind of event may seem daunting for a beginner...remember to stick to the structure (loop: check for input, respond, wait for next frame) and you should be OK~

If you get stuck, I recommend starting a new thread for help with that.

Edit: also, yea, I just turned on signatures to check and you should probably trim or [spoiler]img[/spoiler] that image. :kaoback:
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,861
Reaction score
14,512
First Language
English
Primarily Uses
RMMV

@The Prismed Reaper , please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.



If you want to quote multiple people, you can either use the +Quote button in the lower right of their posts, or start to enter a reply then select the text you wish to quote and hit the Reply button again (it'll paste the quote into your current post), or simply tag them like this @The Prismed Reaper - there is no need to quote their entire post when you reply.

Also, your signature image is way too large. Could you please reduce it to no more than 220px high?


6. Do NOT have a signature larger than 800x220 pixels. You may use spoilers to keep your signature smaller than this. Spoiler tags are included in the final size of the signature.
 
Joined
Jul 16, 2017
Messages
55
Reaction score
11
First Language
English
Primarily Uses
RMMV
Just as a suggestion, it's really annoying to others to have such a huge picture in your signature. It takes up a lot of the screen and it's visually distracting when trying to read your posts.
Thanks, I didn't realize.

@Shaz Sorry about that. Thanks.
@caethyril Thanks again, I'll look into all that. :)

 

Latest Threads

Latest Posts

Latest Profile Posts

Of course, so, someone had covid at work today and I was exposed to them, so, I'm stuck at home for...TWO WEEKS!
oh god I'm going to die
AAAAAAAAi.png
Kind of relieved that I had medibang installed when I need to edit Sprite I was about to download gimp but I remember I had medibang installed lol
Voting for the first round of the Map Madness Tournament is now live! Vote for your favorite in each matchup!

Forum statistics

Threads
110,368
Messages
1,052,659
Members
143,402
Latest member
IBanana
Top