Help - Search - Members - Calendar
Full Version: Projectile and AoE thru events
RPG RPG Revolution Forums > Game Engines > RPG Maker XP Discussion
Omega Coriel
OK I myself had a way to make an Event Based ABS with weapons.. however I need to implement these form of attacks and i need some help.

1. a simple projectile- nothing really to explain.. hits it's target and done.
2. a large Beam attack 3 steps wide
3. AoE with up to a 4 step radial effect
4. Projectile AoE with 8 step effect

A step in the right direction would be appreciated
Logan110
You're doing this all purely by events? You have a lot of work to do on this.

The Beam
All you need to do is get the Y or X of any target possible, depending on which way you shoot it. If anyone is within 1 x or 1 y of the player they get hit.

Self Aoe
Kinda the same thing. X and Y of things that can get hit. Are any of them within 4 x AND 4 y of the player.

Thrown AoE
Same deal as Self AoE but within X and Y of the location hit.

Projectile
Make an event and give it an X, Y. Collision detect with any targets it can hit.

Need anything else?
Omega Coriel
QUOTE (Logan110 @ Mar 9 2010, 11:37 AM) *
You're doing this all purely by events? You have a lot of work to do on this.

The Beam
All you need to do is get the Y or X of any target possible, depending on which way you shoot it. If anyone is within 1 x or 1 y of the player they get hit.

Self Aoe
Kinda the same thing. X and Y of things that can get hit. Are any of them within 4 x AND 4 y of the player.

Thrown AoE
Same deal as Self AoE but within X and Y of the location hit.

Projectile
Make an event and give it an X, Y. Collision detect with any targets it can hit.

Need anything else?

explain the beam a bit more.. and let s try to discuss how the range is going to work. Such as I was going to make a conditional branch fro the beam
If player is facing up
If target's Y=Player Y (this indicates its dead ahead)
the problem with this is that Even if the enemy is behind me target Y=Player Y so i need to see how to fix that as well XP i been trying to do this for ages
Unka Josh
You'll need a lot of conditional branches. For that beam, you'll also need to compare the Target X.

So:

Conditional Branch: Player X>Target X
==== Conditional Branch: Player Y=Target Y
========Show Animation (Target) Explosion
Omega Coriel
QUOTE (Unka Josh @ Mar 9 2010, 12:59 PM) *
You'll need a lot of conditional branches. For that beam, you'll also need to compare the Target X.

So:

Conditional Branch: Player X>Target X
==== Conditional Branch: Player Y=Target Y
========Show Animation (Target) Explosion

but the beam is 3 squares wide so X+1 and X-1 and Y+1 and y-1 also apply
Callista
You might want to consider an existing ABS or asking someone to script that for you, checking so many types of attacks with events for every enemy in every map will get very messy, very fast.
Omega Coriel
QUOTE (Callista @ Mar 9 2010, 01:33 PM) *
You might want to consider an existing ABS or asking someone to script that for you, checking so many types of attacks with events for every enemy in every map will get very messy, very fast.

i could but i have difficulty making animations for it since im not a great spriter
Logan110
Beam -
Player X Y
Target X Y
Player X = Player X - Target Y
Player Y = Player T - Target Y

If Player Direction Up
If Player X = 0, 1 , -1
If Player Y > 0
Target is Hit

If Player Direction Down
If Player X = 0, 1 , -1
If Player Y < 0
Target is Hit

If Player Direction Left
If Player Y = 0, 1 , -1
If Player X > 0
Target is Hit

If Player Direction Right
If Player Y = 0, 1 , -1
If Player X < 0
Target is Hit

I cant explain more right now I have to go to work. sad.gif I will when I get back though.
Omega Coriel
QUOTE (Logan110 @ Mar 9 2010, 02:49 PM) *
Beam -
Player X Y
Target X Y
Player X = Player X - Target Y
Player Y = Player T - Target Y

If Player Direction Up
If Player X = 0, 1 , -1
If Player Y > 0
Target is Hit

If Player Direction Down
If Player X = 0, 1 , -1
If Player Y < 0
Target is Hit

If Player Direction Left
If Player Y = 0, 1 , -1
If Player X > 0
Target is Hit

If Player Direction Right
If Player Y = 0, 1 , -1
If Player X < 0
Target is Hit

I cant explain more right now I have to go to work. sad.gif I will when I get back though.

i look foward to it
Logan110
Ok well that last post should have explained how to do the beam. Though you have to edit it slightly if you dont want it to hit everyone on the map in that direction, and rather only the people on the screen.

The hardest part is going to make this work on every map without manually editing it. I can look into it and try to explain it or I could attempt to make it and send it over to you. Ive done something similar to this but it wasnt on every single map so I just used a parallel process event...
Unka Josh
Working on every map shouldn't be an issue-- Common Events. Just have a switch turned on by the game beginning/being in a "Combat Zone"/whatever.
Logan110
But you have to figure out what is a target and what isnt a target. I think it would be easier done with parallel processes on the map rather than making 1 common event with every single map and event that is a target. That would be a lot of useless code for the game to run on every single map with monsters.
Unka Josh
Well, you could copy-paste, but the fact is, it probably won't matter that much.

I can't see it working, based on my own experiments, with more than 3 or (absolute max)4 monsters. That's not a lot of targets.

(Why no more than 3 or (maybe) 4? Lag. Serious, massive lag.)
Logan110
It shouldnt lag, what were you doing? I just made a 5 v 5 npc fight last week and that barely lags at all. At first it did, but once i dropped the loop and manually did all the code it cleared right up. I figure that has to be harder on the game than this.
Omega Coriel
perhaps i can make a map full of events that telelport to my present map.. like a projectile
for the beam place 3 events in front of me that knows which way i am faceing and send them out and if the intersect any enemies to deal damage?
Logan110
It would be easier just to see who is in the path you are looking towards rather than make moving events with collision detection. There is no auto trigger of events hitting other events so you have to check X's and Y's of every event that they can hit.
Omega Coriel
ok.. i get what ur trying to say but i dontknow how to put this as an event
Logan110
Its difficult to event. tongue.gif Basically you need to initialize what is a target. Call the attack and check the positions of anything that is a target. Do your damage formula and remove the target if they are dead. It takes a bunch of events, switches and variables.
Omega Coriel
sooo.. Attack button pressed all events Check if they are in the X or Y of the attack.. on top of that have to check to see if they are behind you.. and if they meet the requirments then deal damage?
Logan110
Yea like the above post. You check to see what direction your facing first, then find out if the X and Y coords are within the range you want it to be.
Omega Coriel
ok so like this
<Attack>
Branch if Hero faces up
>Branch if Enemy X = Beam Midde X
>Branch if enemy Y= Beam Y
>Deal damage
>Else
>Branch if Enemy X= Beam left (X-1)
Branch if Enemy y= beam y
> Deal Damage
>Else
>Branch if Enemy X= Beam Right (X+1)
> Branch if Enemy Y= Beam Y
Deal Damage
Logan110
*Edit* I added it into code section so it would properly format.
You have to find out what the coordinates are in relation to the player.

CODE
Use Beam Event
Set Player X = Players Map X position
Set Player Y = Players Map Y position
Target 1 X = Target 1 Map X position
Target 1 Y = Target 1 Map Y position
Player X = Player X - Target 1 X
Player Y = Player Y - Target 1 Y

If Player Facing Up
   If Player X = 0, 1 , -1
       If Player Y > 0
          Deal Damage
      end
   end
end

If Player Facing Down
    If Player X = 0, 1 , -1
        If Player Y < 0
          Deal Damage
      end
   end
end

If Player Facing Left
    If Player Y = 0, 1 , -1
       If Player X > 0
          Deal Damage
      end
   end
end

If Player Facing Right
    If Player Y = 0, 1 , -1
       If Player X < 0
          Deal Damage
      end
   end
end


Repeat entire thing for every target that is alive.
btw for If Player X = 0, 1 , -1 can be done multiple ways.

Not using script conditional branch
If player x < 2
If player x > -2
end
end

Script
$game_variable[1] < 2 and $game_variable[1] > -2

Script way just takes away the multiple branches.
Omega Coriel
neato torpedo.. i will check this out when i can <3
Edit: this is how it will be right?
>Branch if Script: game_variable[1] < 2 and $game_variable[1] > -2
Logan110
Yea go into conditional branch, tab 4. In the script section you put this:
$game_variable[1] < 2 and $game_variable[1] > -2
Bellcross
And here I was contemplating if this could even be done or not. This will make things easier for me now that I don't have to figure it out myself.
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.