playMaker

Author Topic: Tips for Splash Damage?  (Read 2647 times)

coneilll89

  • Playmaker Newbie
  • *
  • Posts: 5
Tips for Splash Damage?
« on: April 24, 2013, 07:02:43 PM »
Hello,

I'm trying to create an attack with some splash damage in a 2D sidescroller. Initially, I was going to attach a trigger to each enemy to detect if the projectile (a cannonball) came close to the enemy. I quickly realized this approach had several problems.

I'm guessing it's better to create a trigger when the projectile contacts a target (and thus explodes), but I'm not sure exactly how that would work, how to use that to determine how far an enemy is from the center of the explosion, or if there is an altogether better solution that I'm overlooking. Any advice is very appreciated! Thanks

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Tips for Splash Damage?
« Reply #1 on: April 24, 2013, 07:15:02 PM »
There is a "send Event to Gameobjects within Radius" action (might have to search for it on the forum) Use that to send an even to take damage to enemy from the position of the impact. Also you COULD set the radius based on ammo types or collision angle etc for more variation.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Tips for Splash Damage?
« Reply #2 on: April 24, 2013, 08:10:54 PM »
Use the above suggestion and also get, store and use the distance from the unit to the point of impact as a subtract number for the damage. You'll need to do some math to add it up per unit.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

coneilll89

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Tips for Splash Damage?
« Reply #3 on: April 24, 2013, 08:35:16 PM »
Thank you both for your help! I'm searching but I can't seem to find the "Send Event to Game Objects within Radius" action you mentioned. I did come across the "Find Game Object" action while sifting through posts. I might be able to use that, if each time a cannonball exploded, I created an empty game object at that spot, had all onscreen enemies get their distance from that empty object and do the math to reduce their health accordingly, and then destroy the empty object. Is this similar to what you were saying?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Tips for Splash Damage?
« Reply #4 on: April 24, 2013, 09:00:31 PM »
Thank you both for your help! I'm searching but I can't seem to find the "Send Event to Game Objects within Radius" action you mentioned. I did come across the "Find Game Object" action while sifting through posts. I might be able to use that, if each time a cannonball exploded, I created an empty game object at that spot, had all onscreen enemies get their distance from that empty object and do the math to reduce their health accordingly, and then destroy the empty object. Is this similar to what you were saying?

Yes, but you could use a collider trigger at the explosion to collect the colliders(enemies that were hit in the radius) then store them and send the event and math to those objects.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D