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,624
Reaction score
502
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,624
Reaction score
502
First Language
German
Primarily Uses
RMMV
I was just curious. Thanks for explaining, and good to hear that it works.
 

Latest Threads

Latest Profile Posts

Sometimes it works out to not do work on my game for a while. I ran through a playtest today and got about a page of things to fix or improve...
I got lot's o balancing to do lol... I think I'll redo my skills for the 3 party members for the 5th time lol. but I need them to be more distinct for balancing the RPS element system since fights are 1 on 1 with tagging.
Our latest Make a Game in MZ Stream is here! Today, we're going to create a complex switch puzzle, where flipping one switch also toggles the switches adjacent to it. Join now to see how it's done!

Here's a preview to an upcoming free track. Kind of a hybrid, Middle Eastern, orchestral thingy. Should be released pretty soon!

Time: duration regarded as belonging to the present life as distinct from the life to come or from eternity; finite duration.


1653085842103.png

Me against Time now. No second chances. No distractions. All or nothing. Whoever wins is the best fighter.

Forum statistics

Threads
121,982
Messages
1,145,661
Members
160,257
Latest member
Rakadu
Top