• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Line of Fire

Status
Not open for further replies.
Level 15
Joined
Jul 2, 2015
Messages
880
I've been thinking for a while, is it possible to make it that friendly ranged units could cause friendly fire? For example rifleman attacking an enemy but causing friendly fire due to friendly troops in front of them.

Is there a way to make something like this?
 
With a projectile system and triggered unit attack projectiles, yes. Without those, no. Rifleman attacks are specifically what you want to use for all your units in your map as it's the only hitscan (instant) ranged attack. Detect when a unit attacks another with a DDS, save the pre-mitigation damage dealt, prevent the damage dealt, launch a projectile from source to target that can impact all units, and attach both the source and the saved damage to this projectile. When it hits any unit, have the source damage that unit for the saved damage amount.
 
I'm not sure I understand what you're trying to achieve here. You want to deal damage to all units that stand in the line between the Attacking and the Attacked unit or you simply want to interrupt the attack if there is a friendly unit in that line so that you can reverse the damage to it instead?
 
I'm not sure I understand what you're trying to achieve here. You want to deal damage to all units that stand in the line between the Attacking and the Attacked unit or you simply want to interrupt the attack if there is a friendly unit in that line so that you can reverse the damage to it instead?
Deal all damage, and if its for example a bowman or archer they cant friendly fire (due to fire arc)
 
I can only think of two solutions : The easiest way and the hardest way. The easiest way is to use a custom ability that deals damage in a cone such as carrion swarm or breath of fire and order a dummy unit to cast it whenever the rifleman recieve the order to attack. The hardest way is to use triggers, basically what you need to do is to pick all units between the rifleman and the attacked unit and cause damage to them. There are plenty of threads here that explains how to make damage in a line.
 
With a projectile system and triggered unit attack projectiles, yes. Without those, no. Rifleman attacks are specifically what you want to use for all your units in your map as it's the only hitscan (instant) ranged attack. Detect when a unit attacks another with a DDS, save the pre-mitigation damage dealt, prevent the damage dealt, launch a projectile from source to target that can impact all units, and attach both the source and the saved damage to this projectile. When it hits any unit, have the source damage that unit for the saved damage amount.
This is the solution. With a projectile system in place it is not particularly difficult.
 
Status
Not open for further replies.
Back
Top