"Friendly-fire Will Not Be Tolerated"

Mindless

New Member
Reaction score
4
Hi everyone,

How to stop friendly-fire in Warcraft? i.e. stop allied units from trying to force attack another allied unit? Like in DotA.

P.S. for all you guys that played CoD, look at the title...:)
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Detect when a unit is attacked, and if the two units are allied, order the attacker to stop.
 

Mindless

New Member
Reaction score
4
Ok, thanks a lot. Just wondering though, can I do it this way? Once a unit is given an order "attack", order it to stop.
 

Mindless

New Member
Reaction score
4
I think by default all units have Combat - Attack 1/2 - Target's Allowed Allied/Friendly unchecked... but they are still able to attack allies...
 

xAnaMorphine

Active Member
Reaction score
43
Can anyone tell me how to use GUI tags?

Nevertheless here is the trigger:

Code:
Friendly Fire
    Events
        Unit - A unit Is attacked
    Conditions
        ((Owner of (Attacking unit)) is an ally of (Owner of (Attacked unit))) Equal to True
    Actions
        Unit - Order (Attacking unit) to Stop
 

Mindless

New Member
Reaction score
4
Thanks xAnaMorphine. However, WolfieeifloW's solution seems much neater, if I can get it to work, or if he can explain it a bit more... :p
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Use block brackets containing "wc3" and "/wc3" at the start and end of the code, respectively, so it would look like this:
Trigger:
  • Friendly Fire
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Owner of (Attacking unit)) is an ally of (Owner of (Attacked unit))) Equal to True
    • Actions
      • Unit - Order (Attacking unit) to Stop
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Apparently that doesn't work.
I swore changing targets allowed to Enemy worked.

In light of that, just trigger it.
You can use 'stop', which I just checked and it seems that's what DotA uses.
Optionally, for cool effect, you can add a text message to the attacking player.

Or, get SimError, and just call the custom script:
Code:
Custom script:    call SimError(GetOwningPlayer(GetAttacker()), "Friendly-fire will not be tolerated!")
 

Mindless

New Member
Reaction score
4
I swore changing targets allowed to Enemy worked.

I tried that, doesn't work...

However, I'll go with DotA's technique. (If it's good for DotA, it's good for me! And plus this way I can test if the unit's below certain amount of HP so I can allow denials etc.)

Thanks guys! And by the way, thanks for the SimError thing, gives a unique tweak to my map!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top