- Joined
- Jun 21, 2018
- Messages
- 39
- Reaction score
- 16
- First Language
- BR Portuguese
- Primarily Uses
- RMVXA
My project is heavily based on SAS - Sapphire Action System. Recently, I've been looking for ways of implementing some sort of AoE attack. Take this video example, for instance:
What I wanted to do is make so that this attack hits in an 180 degree arc - so it hits in all directions except your back. Here's the code I use (it can be found at around line ~1450:
What this does is that whenever the player is executing a charged attack (switch 193 is ON) the new "collision" will kick in during the damage process, applying the "tx1", "ty2" etc locations to the array of positions that will receive the attack, checking for enemies in multiple positions. I admit that I simply don't quite understand what most of this means, I simply copied the "tx" and "ty" lines and added a number to the variable name, then multiplied the value: the result is shown in the video.
I'd like to receive some guidance regarding where I should start looking for solutions and what most of this code actually means.
If you're a coder and feel interested in the project, I'm looking for scripters to hop in and help us. Currently we're a team of two, with the other member working as the artist and me dealing with the technical aspect of the work. Of course, design debates are common between us and a third opinion would be welcome.
Thanks in advance!
What I wanted to do is make so that this attack hits in an 180 degree arc - so it hits in all directions except your back. Here's the code I use (it can be found at around line ~1450:
Ruby:
if $game_switches[193]
tx = @px + Sapphire_Core::Weapon_Range[@direction][0]
ty = @py + Sapphire_Core::Weapon_Range[@direction][1]
tx1 = @px + Sapphire_Core::Weapon_Range[@direction][0] * 2
ty1 = @py + Sapphire_Core::Weapon_Range[@direction][1] * 2
tx2 = @px + Sapphire_Core::Weapon_Range[@direction][0] * 3
ty2 = @py + Sapphire_Core::Weapon_Range[@direction][1] * 3
else
tx = @px + Sapphire_Core::Weapon_Range[@direction][0]
ty = @py + Sapphire_Core::Weapon_Range[@direction][1]
tx1 = @px + Sapphire_Core::Weapon_Range[@direction][0]
ty1 = @py + Sapphire_Core::Weapon_Range[@direction][1]
tx2 = @px + Sapphire_Core::Weapon_Range[@direction][0]
ty2 = @py + Sapphire_Core::Weapon_Range[@direction][1]
end
for char in $game_map.enemies
if char.pixel_range?(tx,ty) or char.pixel_range?(tx1,ty1) or char.pixel_range?(tx2,ty2)
I'd like to receive some guidance regarding where I should start looking for solutions and what most of this code actually means.
If you're a coder and feel interested in the project, I'm looking for scripters to hop in and help us. Currently we're a team of two, with the other member working as the artist and me dealing with the technical aspect of the work. Of course, design debates are common between us and a third opinion would be welcome.
Thanks in advance!
