Alarkus

Veteran
Veteran
Joined
Oct 15, 2016
Messages
95
Reaction score
42
First Language
English
Primarily Uses
RMVXA
Hi. I'm trying to make it so an event can jump to a player via a script call to achieve a "projectile" effect and I'm having some issues.
I managed to make it so the event jumps to variables containing the players X and Y, but the event jumps way off screen for some reason. Not sure what I'm doing wrong.
Here's what I attempted to use.
jump($game_variables[12],$game_variables[13])
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,626
Reaction score
505
First Language
German
Primarily Uses
RMMV
When and were do you assign values to that Variables 12 and 13?

If this is for a Projectile, why not using the Eventcommand "Set Event Location"?
It would Teleport that Event directly to that position without jumping over the Map.

This Thread could be very Helpful:

In your case this should Teleport EventID1 to the Position of the Player.

$game_map.events[1].moveto($game_player.x, $game_player.y)

for the Jump with Eventid1 jump to Player it would be:

jump($game_player.x - $game_map.events[1].x, $game_player.y - $game_map.events[1].y)

and here Edited so it uses the target chosen in the Moveroute Command:

jump($game_player.x - $game_map.events[self.id].x, $game_player.y - $game_map.events[self.id].y)
 
Last edited:

Alarkus

Veteran
Veteran
Joined
Oct 15, 2016
Messages
95
Reaction score
42
First Language
English
Primarily Uses
RMVXA
When and were do you assign values to that Variables 12 and 13?

If this is for a Projectile, why not using the Eventcommand "Set Event Location"?
It would Teleport that Event directly to that position without jumping over the Map.

This Thread could be very Helpful:

In your case this should Teleport EventID1 to the Position of the Player.

$game_map.events[1].moveto($game_player.x, $game_player.y)

for the Jump with Eventid1 jump to Player it would be:

jump($game_player.x - $game_map.events[1].x, $game_player.y - $game_map.events[1].y)

and here Edited so it uses the target chosen in the Moveroute Command:

jump($game_player.x - $game_map.events[self.id].x, $game_player.y - $game_map.events[self.id].y)
Well, the reason I wanted to use the jump feature is because a transfer would be instantaneous, without any time for the player to move out of the way. With the jump there's a few frames before it gets to the player, so it better gives the illusion of say, a grenade or energy ball coming at the player without the awkwardness of 4 direction movement.
What you wrote seems to be working though, so thanks!
 
  • Like
Reactions: Bex

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,626
Reaction score
505
First Language
German
Primarily Uses
RMMV
I was just curious. Thanks for explaining, and good to hear that it works.
 

Latest Threads

Latest Posts

Latest Profile Posts

So the Fire alarm went off 3 times in less then a half hour on my building. But my cat is so use to it going off he doesn't even run behind the couch anymore. He is just like, "This again?"
It has been brought to my attention that the name of my main robot protagonist in bio-Synthetica (R3-M1) is a Star Wars character LOL Woops. Always Google search names. The new name of my robot is now K0-R1. :kaophew:
I'm considering making my own battlers from scratch, it seems like a daunting task, but I like the look of it so much...A_Miriam3.png
I picked up running again after a long time and managed to get from 2.25km to 7km in two weeks :3 Time to get rid of those covid kilos!
Have you ever wondered what the lives of the NPC's are like in your hero's story? Come an find out with us as we play, "A Story Beside" by Wayward Prophet :LZSexcite:

Forum statistics

Threads
122,094
Messages
1,146,465
Members
160,384
Latest member
SoBro
Top