Shooting game jump event and tracking it's x pos relative to target

Long Lost Hero

Veteran
Veteran
Joined
Feb 6, 2015
Messages
38
Reaction score
6
First Language
English
Primarily Uses
Ok, I'm back and I am making a little shooting minigame. It's pretty simple, right now I just have an event of a cannon pointed up at an event of a monster that walks down toward the player. The player stands behind the cannon and the action button starts the shot. In front of the cannon is the cannonball Event activated by a switch (from the cannon event). I tried using the movement route command but it moves the cannonball too slow even when I set the speed to x4 fast. I found the Jump moves at the speed I wanted so I have the cannonball Jump: 0,-6 so it jumps up toward the monster.

In the monster event I have 4 variables tracked. The cannonballs screen x & screen y and the monsters events screen x & screen y. As well as the movement of the monster stepping slowly toward the player. When the x & y match, there's an animation and the cannonball switches off and returns to it's spot in front of the cannon, ready to fire again.

The problem is, as long as the monster stays at 6 tiles up from the cannon it works. As soon as he moves 1 tile closer the cannonball fires past it and messes the whole thing up. I think it has to do with the jump because when I just use the move up in the command it works fine. Just too slowly.

Is there a way to track the x & y of the Jumping event? Or is there a way to track the difference in distance from the cannonball and the monster and set the Jump command with that variable? So it always jumps just as far as it needs to.

Is there a better way to do this I'm not seeing?

I plan on having more monsters that walk randomly around or toward the player and the cannon can shoot at each one. But I need to get this to work right with just a basic setup first.
 
Last edited by a moderator:

Susan

Veteran
Veteran
Joined
Sep 1, 2014
Messages
2,748
Reaction score
8,346
First Language
No idea...
Primarily Uses
RMMV
I'm not too sure about how you have evented movement of the monsters, and the cannonball event.

In regards to the cannonball event, perhaps you can try creating different conditional branches that track the monsters 'y' coordinates separately, and results in the cannonball firing towards the related 'y' coordinates.
 

Long Lost Hero

Veteran
Veteran
Joined
Feb 6, 2015
Messages
38
Reaction score
6
First Language
English
Primarily Uses
That's what I need to know how to do I think. Is there a scriptcall for the jump command that can referance a variable(s)? The variable will be the monsters co-ords so the Jump will jump right to that (if its within proper firing range that is, but I have to script that after). I dunno what it is though.

newCommand.parameters = ["Jump, $game_map.events[id].x, $game_map.events[id].y"] or something?
 
Last edited by a moderator:

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Speed is not all you have to increase^^

Frequencie must also be increased.

Than your Cannon Ball should be realy fast.

(If that not enough than, there is RGSS3 command to increase speed/and maybe Frequencie of Event further more.
 

Long Lost Hero

Veteran
Veteran
Joined
Feb 6, 2015
Messages
38
Reaction score
6
First Language
English
Primarily Uses
Speed is not all you have to increase^^

Frequencie must also be increased.

Than your Cannon Ball should be realy fast.

(If that not enough than, there is RGSS3 command to increase speed/and maybe Frequencie of Event further more.
Nope it's not fast enough. What's the RGSS3 script?
 

Susan

Veteran
Veteran
Joined
Sep 1, 2014
Messages
2,748
Reaction score
8,346
First Language
No idea...
Primarily Uses
RMMV
I'm not too sure if events' coordinates can be referenced directly in a 'Set Move Route' script call.

The script call for changing movement speed is:

@move_speed = n

where 'n' is the speed variable.

Omit the 'Jump' command and try setting 'n' to 7 and above.
 

Long Lost Hero

Veteran
Veteran
Joined
Feb 6, 2015
Messages
38
Reaction score
6
First Language
English
Primarily Uses
Hmm. Ok thanks but once I set it higher than 9 it still goes slow and the event goes through its walking or stepping phase which looks weird. Even if I set the Direction fix on.  Seems setting it too high breaks it.

Looks like I will have to accept the slowness and set the movement to go up multiple times to the top of the screen instead of autorun with just 1 move up command. That's odd.
 

Susan

Veteran
Veteran
Joined
Sep 1, 2014
Messages
2,748
Reaction score
8,346
First Language
No idea...
Primarily Uses
RMMV
As I said before, I'm not sure as to how you're setting up your events.

Even setting the movement speed to 7 seem to provide a speed equivalent to the jump command.

As for the stepping/walking animation, it's easy to fix. Just make sure that the relevant part of your spritesheet consist of only that one sprite, instead of multiple variations of it.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
Yes, you can script a jump to jump to an event's position. Okay, this sounded weird. :D

Read this topic:

http://forums.rpgmakerweb.com/index.php?/topic/25759-script-call-collection-for-vxace/?p=247427

Scroll to the Set Move Route section and try to make a working move route with script calls.

You can reference and event's position with $game_map.events[id].x and $game_map.events[id].y, just like how you wrote above.

And while you are reading that topic, bookmark it, it is very useful. :)
 

Long Lost Hero

Veteran
Veteran
Joined
Feb 6, 2015
Messages
38
Reaction score
6
First Language
English
Primarily Uses
# Single Action

newCommand.code = moveCode # See List in Game_Character Default Script

newCommand.parameters = [""] # This refers to Jump, Wait, Switch On, Switch Off, Change Speed,

# Change Frequency, Change Graphic, Change Opacity, Play SE and Script.

newRoute.list.insert(0,newCommand.clone)
Do I use newCommand.parameters = [""]? I have no idea what to put in the "" everything I try results in errors. Can someone provide an example please?
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
I just remembered Vlue's Evening: Fine Tuning script, which makes your issue look like it is not an issue at all. :D


That script comes with a move route script call which looks like this:

jumpto(x,y)That will make the player/event jump to the specified co-ordinate on the map.
Add $game_map.events[id].x and $game_map.events[id].y for the X and Y position and you are good to go. :)
 

Long Lost Hero

Veteran
Veteran
Joined
Feb 6, 2015
Messages
38
Reaction score
6
First Language
English
Primarily Uses
Thanks, I got the script I'll check it out. I guess the command is used in the script because it doesn't work (undefined method) with the default scripts. I wanted to avoid using scripts due to incompatabilities and stick with events but I dunno if its possible.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top