Detecting attack range?

komapatient

New Member
Reaction score
10
Hi,

Is there any way to detect the attack range of an unit?

I want to reconfigure melee maps in a way that when a melee unit (AR =< 100) attacks a ranged unit, the ranged unit is forced to use a melee attack.

I first intended to create copies of units (a normal ranged archer and a dummy melee version of her e.g.) and simply replace them but now I feel like it would be more comfortable when I could stay with the original units and design a special melee attack via attack 2 for them! I felt like this because I don't want to exchange heroes with the exact items everytime, losing rallye points on units etc.

Well I guess there is a trigger to determine the range - but what I need is to bind the attacking unit to force to melee attack until the offender acquires a new target. I could use the custom value of unit integer to define an attack mode but I'm still not sure about detecting how long the unit is targeted by a melee attacker.

Any idea how to start this?
 

DiFm

New Member
Reaction score
35
Make ranged Have attack 2 then add an invisible buff to melee units that when a ranged unit has buff you can use an uppgrade that only enables attack 2 then when unit no longer has buff enable attack 1
 

komapatient

New Member
Reaction score
10
Make ranged Have attack 2 then add an invisible buff to melee units that when a ranged unit has buff you can use an uppgrade that only enables attack 2 then when unit no longer has buff enable attack 1

Adding a buff? Silly me!! Could really work! I'll give it a try asap!

Well then - your rep cash box just rings **KA-CHING** ;D
 

simonake

New Member
Reaction score
72
Why not using the Units locations as this leakless trigger shows.

Trigger:
  • Actions -
    • Set TempLoc[1] = (Position of ( attacking unit ))
    • Set TempLoc[2] = (Position of ( attacked unit ))
    • Set AttackDistance = (Distance Between (TempLoc[1]) and (TempLoc[2]))
    • Custom Script: call RemoveLocation( udg_TempLoc[1] )
    • Custom Script: call RemoveLocation( udg_TempLoc[2] )
 

komapatient

New Member
Reaction score
10
Why not using the Units locations as this leakless triggers shows.

Trigger:
  • Action -
    • Set TempLoc[1] = (Position of ( attacking unit ))
    • Set TempLoc[2] = (Position of ( attacked unit ))
    • Set AttackDistance = (Distance Between (TempLoc[1]) and (TempLoc[2]))
    • Custom Script: call RemoveLocation( udg_TempLoc[1] )
    • Custom Script: call RemoveLocation( udg_TempLoc[2] )

I thought of this as well.. but I want the unit actually to be under attack... if I just needed the difference of two units locations I could define a minimum attack range for my ranged unit attack without even triggering it.

The trick is I want to bind the unit to be a melee attacker when it gets melee attacked.

Imagine an archer forced to draw a dagger to fight an incoming grunt (even though I wouldn't have a dagger model at all for her :rolleyes: ).

I guess this would make large team games (5v5 or 6v6) more balanced, as the game gets more and more "Rangecraft" the more players are in it. I want to add a significant role to melee units to weaken front line ranged units without them losing their focus fire ability when they are not really threatened at all!
 

Zurtrogx

Active Member
Reaction score
24
You could use a Boolean Comparison, something like:
Code:
((Triggering unit) is A melee attacker) Equal to True

Boolean Comparison=> Unit - Unit Classification Check
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top