Friendly fire OFF

BruteBrutal

New Member
Reaction score
1
Hey again...

Trying to make it impossible to attack allied heros/unit. I'm in object manager and 'Combat Attack 1 Targets Allowed'..

But when I check Ground and Air he attacks allied units/heroes too. Even the heroes own summons.

How do I fix that?

Thanks in advance,

BruteBrutal
 

HydraRancher

Truth begins in lies
Reaction score
197
Some targets override each other. What are ALL the targets allowed you are using right now?
 

BruteBrutal

New Member
Reaction score
1
Allowed targets Air, Ground


And if I go Targeted as Hero (NOT Ground) then noone can attack me instead (not neutrals either)
 

HydraRancher

Truth begins in lies
Reaction score
197
In that case I have no idea. With those targets allowed it should work. The only thing I can recommend is making sure you save properly (and open the right map if you're not using the test map) and that you're using the right unit.

Although...What is the "Targeted As" for the unit you are trying to kill?
 

BruteBrutal

New Member
Reaction score
1
on the other heros I have Targeted as GROUND (standard) then allies can attack their own but if I dont have it, the enemys doesn't attack either...
 

NeuroToxin

New Member
Reaction score
46
Use triggers? Just stop the unit from attacking them, it'd be much easier then trying to find the error, just do something like this
Trigger:
  • HANDWRITTEN!
    • Events
    • A Unit is attacked
    • Conditions
    • Attacking unit == to an ally of attacked unit
    • Actions
    • Order attacking unit to stop

You can do this, because the event - A unit is attacked, happens BEFORE the unit is attacked not after
 

Inflicted

Currently inactive
Reaction score
63
I would advise NeuroToxin's method, because it's less likely to work incorrectly. Also alot simpler, and is easy to edit by adding a few conditions you can add a deny system etc.
 

BruteBrutal

New Member
Reaction score
1
Use triggers? Just stop the unit from attacking them, it'd be much easier then trying to find the error, just do something like this
Trigger:
  • HANDWRITTEN!
    • Events
    • A Unit is attacked
    • Conditions
    • Attacking unit == to an ally of attacked unit
    • Actions
    • Order attacking unit to stop

You can do this, because the event - A unit is attacked, happens BEFORE the unit is attacked not after


My first day of mapcreations ever was yesterday, began with a 12 hour session learning by doing so I'm sorry for being a bit noobish among you others but when I'm in the trigger it either says "No unit" is attacked or I have to pick ONE specific unit.

Also how does the map know that these three commands are linked?
 

Sim

Forum Administrator
Staff member
Reaction score
534
> it either says "No unit" is attacked or I have to pick ONE specific unit.

Change the event. Instead of Unit event, use "A unit is..." event. It's called "generic" I think.

> Also how does the map know that these three commands are linked?

Because Blizzard programmers told the map so. :)
(Attacking unit) refers to the unit that is attacking the (Attacked unit). That is so because those units are tied to the event that fired above. It is handled so there must be 2 units corresponding to the event firing, and the script defines the (Attacking unit) at that moment, as well as the (Attacked unit), and set them to those native functions.

Just know that it works. :)
 

BruteBrutal

New Member
Reaction score
1
I am officially too stupid for this. I'm in triggers, first of all the three things he wrote do I have to use all 3 for it to work? If i have more than one Melee Initialzition my game really fucks up. And I can't find that either.

Maybe I dont have an extended bought version of the map editor or something but for the third part the 'NEW ACTION' - ALL - nothing on that list anywhere is called "A unit is..."
 

NeuroToxin

New Member
Reaction score
46
create a new trigger, use the event, go to generic unit, find unit is attacked, condition should be a boolean comparison, ill upload a map

Trigger:
  • H
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Owner of (Attacking unit)) is an ally of (Owner of (Attacked unit))) Equal to (==) False
    • Actions
      • Unit - Order (Attacking unit) to Stop
      • Game - Display to (All players) the text: NO! You cannot attack an ally!
 

Attachments

  • Test Map.w3x
    16 KB · Views: 121

BruteBrutal

New Member
Reaction score
1
I send you a mental cheesecake as a thank you! :thup:

It was allies I didnt wanted to be attacked, but that fix I could manage myself.
 
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