Group: Member
Posts: 84
Type: Event Designer
RM Skill: Skilled
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.
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.
__________________________
My Games
Phelxyre: Time Unbound (Current Project)
Game Thread A game where you start in the future, but you go to the past, to make things right, hopefully.
The Hidden World
Game Thread An Arcade-style game where you must go through various puzzles to see if you go home.
Here are all the things I Support (They Include Links!)
Group: Member
Posts: 84
Type: Event Designer
RM Skill: Skilled
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.
Group: +Gold Member
Posts: 1,007
Type: Scripter
RM Skill: Undisclosed
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.