Help - Search - Members - Calendar
Full Version: Shooting system problem
RPG RPG Revolution Forums > Game Engines > RPG Maker 2000 / 2003
Dose
Hello everyone, it's been a while since I have used RPG maker 2003 and I am a little rusty so I need some help please. I was never very good at making ABS but I have put on in my game just for a small part. I am using a basic ABS shooting system where the hero shoots planes while they shoot back at him. It's very basic using the normal X,Y coordinate shooting system where you use "Key input processing" to check if shift (which is the fire key) is pressed then teleporting an event in front of the hero and send it forward. I am using variables to see if the enemies X,Y coordinates are the same is as the projectile. I use conditional branches to check if the coordinates (stored in variables) of the projectile is the same as the enemy. For example, "branch if projectile Y is equal to enemy 1 Y." When you shoot a plane it flashes red then runs away. The problem is that if the projectile passes by the enemy it will still count as it hitting them and the enemy flashes red. Does anyone have any thoughts why that would happen? I apologize if that isn't clear enough. If necessary I can post a screen shot.

Thanks laugh.gif

Dose
Zinx10
I can see why, but may I take a look at the code? I can probably detect your problem. From what it sounds, it sounds as if the X/Y Coordinates are matching as if the conditional branch each for X and Y are not together, but separate. Basically, just let me examine the code.
Dose
Hey Zinx thanks for helping out. Here are some screen shots of the code. If this isn't good enough I can send you the code in a text document or something. What you said about it checking the x,y coordinate separately made sense. How do I fix that?
Event 1- Finding out every event/hero's coordinates.


Finding hero's x,y coordinates and shooting weapon event


Event 3-Finding out if the enemy's x,y coordinates match up with the weapons


Once again thanks for the help. Also I like your avatar, I loved legend of legaia, great game.
Ty
Zinx_therpgmaker was right, you are doing two separate checks to determine if the bullet hits the enemy. Look closely at the 'Event-3' screenshot. For the first conditional branch, you check to see if the bullet's Y value is the same as the Enemy Y value, if the Y value is the same; it counts as a hit WITHOUT checking the X value. The same applies for the X check, if the Y is not the same but the X check is, it counts as a hit.

So in order to fix it, you will have to merge your checks together. So it should look something like this:
If Bullet Y is equal to Enemy Y
if Bullet X is equal to Enemy X
Hit the enemy

So that basically says this: if bullet_y == enemy1_y AND bullet_x == enemy_1_x, which will give you an exact point on the map.
Dose
Yeah when Zinx gave me that advice I had a feeling that I had to do that. I did it just now and it worked. Thanks for the help you two.
Zinx10
No problem. smile.gif
Also, thanks for the avatar compliment. I haven't really played the game, but from what I have played, it was amazing!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.