Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Shooting system problem, Probably a simple fix but I suck with ABS
Dose
post Jul 17 2011, 08:31 PM
Post #1


Level 6
Group Icon

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.

Thanks laugh.gif

Dose
Go to the top of the page
 
+Quote Post
   
Zinx10
post Jul 18 2011, 07:43 AM
Post #2


Master of Darkness
Group Icon

Group: Revolutionary
Posts: 1,194
Type: Developer
RM Skill: Advanced
Rev Points: 5




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!)




Go to the top of the page
 
+Quote Post
   
Dose
post Jul 18 2011, 10:03 PM
Post #3


Level 6
Group Icon

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.
Go to the top of the page
 
+Quote Post
   
Ty
post Jul 18 2011, 10:53 PM
Post #4


Level 38
Group Icon

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.


__________________________
My Script Demo link broken? Looking for old scripts? Go here:
http://synthesize.4shared.com
Go to the top of the page
 
+Quote Post
   
Dose
post Jul 19 2011, 09:51 PM
Post #5


Level 6
Group Icon

Group: Member
Posts: 84
Type: Event Designer
RM Skill: Skilled




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.
Go to the top of the page
 
+Quote Post
   
Zinx10
post Jul 19 2011, 10:10 PM
Post #6


Master of Darkness
Group Icon

Group: Revolutionary
Posts: 1,194
Type: Developer
RM Skill: Advanced
Rev Points: 5




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 post has been edited by Zinx_therpgmaker: Jul 19 2011, 10:12 PM


__________________________
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!)




Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 20th May 2013 - 11:08 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker