Detection from what angle unit is hit/uncovering invisible units

SarChasm

New Member
Reaction score
15
Two issues:

1. How can I make it so that bonus damage will be dealt if a unit attacks another unit from the sides or the back?
ie: a party of archers ambush a marching army from the back, dealing massive damage, as opposed to those same archers hitting them from the front, not dealing quite as much.

2. Say we have Player 1 and Player 2. Player 2 has invisible units (skill based off Night Elf Hide) scattered around. Player 1 suspects Player 2 has hidden units, so he sends a scout. When this scout comes within X distance of an invisible unit, the invisible unit and all other invisible units owned by Player 2 that are Y distance from the originally found invisible unit are all revealed for Z seconds.
 

Giantpanda

New Member
Reaction score
1
1. Make 2 different unit types is a simple solution. Archers who attack from behind have higher base damage. Or if a unit attacks inside a region deal extra damage or something along those lines. If it's an ability like Rikimaru's backstab i dont know.

2. Create dummy units who can see invisible units at the postition of the invis units. Use something like: Pick units within X, create a dummy unit for each unit, destroy dummy unit.
 

Chewbalka

New Member
Reaction score
14
1. Make 2 different unit types is a simple solution. Archers who attack from behind have higher base damage. Or if a unit attacks inside a region deal extra damage or something along those lines. If it's an ability like Rikimaru's backstab i dont know.


to many regons, plus units can turn around.
 

SarChasm

New Member
Reaction score
15
1. Yes it is like Rikimaru's backstab ability. I have no clue what you were talking about there with the whole 2 unit types thing, sorry.

2. So what you're saying is:
When a unit comes within X of invisible unit, dummy unit with true sight is made.
 

the_ideal

user title
Reaction score
61
For number 2, creating a dummy and ordering it to cast reveal or dust of appearance works too.

For number 1, you know there's a way to get the facing angle of a unit, right? So just compare the facing angles: if the facing angles are the same, or close, that means the archer is attacking from behind. So say if AbsoluteValue[Facing Angle of (Attacked Unit) - Facing Angle of (Attacking Unit)] > 45, deal extra damage.

If you need more help, just post.
 

SarChasm

New Member
Reaction score
15
Ack problem. Finally got around to testing this. It works mostly fine, except I need a better way to do the actual bonus damage part. Right now, I'm using the action "Unit - Cause (unit) to damage (unit) dealing (real) damage of attack type (type) and damage type (type)"

The problem is, this damage sets in before the attacking unit even lands the shot. As soon as the attack animation starts, the extra damage is dealt, meaning if you were good enough at micro-ing, you could issue an attack order, and just keep canceling it, rapidly killing the enemy by animation canceling.

So I just need a better way to deal bonus damage instead of that action I'm currently using.
 

SarChasm

New Member
Reaction score
15
Thanks for the code, but I have absolutely no clue how JASS works. Should I just use the custom script action thing to put that in?
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
There is a GUI backstab made. And to put that in create a triger convert to custom script and paste that in
 

SarChasm

New Member
Reaction score
15
Okay, this is how I have it so far.

Trigger:
  • Backstabbing
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Abs(((Facing of (Attacked unit)) - (Facing of (Attacking unit))))) Less than or equal to 45.00
      • ((Attacked unit) is A structure) Equal to False
    • Actions
      • Unit - Cause (Attacking unit) to damage (Attacked unit), dealing (Real((Point-value of (Attacking unit)))) damage of attack type Chaos and damage type Normal


I tried CNP'ing that code, but it didn't work. I really have no clue what I'm doing.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Then go to epic war and search for backstab its GUI
 

SarChasm

New Member
Reaction score
15
No dice. This is the trigger.

Trigger:
  • Backstab
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Backstab for (Attacking unit)) Greater than 0
      • Or - Any (Conditions) are true
        • Conditions
          • (Angle from (Position of (Attacking unit)) to (Position of (Attacked unit))) Greater than or equal to ((Facing of (Attacked unit)) - 160.00)
          • (Angle from (Position of (Attacking unit)) to (Position of (Attacked unit))) Less than or equal to ((Facing of (Attacked unit)) - 200.00)
    • Actions
      • Special Effect - Destroy BackstabEffect
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ((Attacked unit) is A structure) Equal to False
              • ((Attacked unit) is Mechanical) Equal to False
              • ((Attacked unit) is Magic Immune) Equal to False
        • Then - Actions
          • Special Effect - Create a special effect attached to the chest of (Attacked unit) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
          • Set BackstabEffect = (Last created special effect)
          • Unit - Cause (Attacking unit) to damage (Attacked unit), dealing ((0.25 x (Real((Level of Backstab for (Attacking unit))))) x (Real((Agility of (Attacking unit) (Include bonuses))))) damage of attack type Chaos and damage type Force
        • Else - Actions
          • Do nothing


As you can see, it's pretty much the same idea as mine, just with a lot more bells and whistles. It's based off an ability, and has a special effect, however, the problem still persists.

I tried changing the Stealth Assassin's range to 500, and projectile speed to something really slow. The backstab damage still kicks in before the projectile even hits the guy.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Wel the event starts when the animation starts so thats why its so early
 

SarChasm

New Member
Reaction score
15
Well I can't do that, the time it takes for a missile to hit an opponent will vary depending on the missile speed and distance from attacked unit.

From the looks of it, I'm going to have to use an entirely different approach.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Maby instead of doing the damge ad and remove a 100% chance critical strike
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top