• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Ally attack

Status
Not open for further replies.
Level 18
Joined
Aug 3, 2008
Messages
1,935
You can :

A) make the allys invulnverable
B) Make the allys a differtent type of attack target that units dont usually attack, such as " ground, Air, Ward " are common attack targets, switch it to something like " doodad or something else . this is editable in the object editor ( sounds confusing, but PM me for more info on it )
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Using the trigger editor. If you attack a friendly unit you simply force the unit to stop and so not attack. Be careful as often people want to be able to TK as it can fix some bugs (getting stuck) or be used to remove noobs (if they block something or are doing something selfish and stupid).
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Untitled Trigger 081
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Owner of (Triggering unit)) Not equal to (Owner of (Attacking unit))
      • ((Owner of (Triggering unit)) is an ally of (Owner of (Attacking unit))) Equal to True
    • Actions
      • Unit - Order (Attacking unit) to Stop
The first condition is under "player" the second is under "boolean".
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
there is a better way...
EVENT
unit is issued an order targeting an object
CONDITION
issued order equal to attack
target unit is an ally of triggering unit
owner of triggering unit not equal to owner of
target unit
ACTION
pause triggering unit
unpuse triggering unit
order triggering unit to stop


it stops the unit when he is ordered,so your unit does not have to walk to ally unit and begin attacking,and than stop
 
there is a better way...
EVENT
unit is issued an order targeting an object
CONDITION
issued order equal to attack
target unit is an ally of triggering unit
owner of triggering unit not equal to owner of
target unit
ACTION
pause triggering unit
unpuse triggering unit
order triggering unit to stop


it stops the unit when he is ordered,so your unit does not have to walk to ally unit and begin attacking,and than stop

but you don't need to pause him really. just order him to stop. and if I'm right the unit's owner is considered as an ally of that unit's owner, so there's no need for the last condition.
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
but you don't need to pause him really. just order him to stop. and if I'm right the unit's owner is considered as an ally of that unit's owner, so there's no need for the last condition.

its the same as maker´s "((Owner of (Triggering unit)) is an ally of (Owner of (Attacking unit))) Equal to True" but changed because event

you need this because player might want to attack his own units

pauseing and unpauseing unit makes unit able to stop in event - unit is issued an order

here is the trigger

  • stop ally attack targeting
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(attack))
      • ((Target unit of issued order) belongs to an ally of (Owner of (Triggering unit))) Equal to True
      • (Owner of (Triggering unit)) Not equal to (Owner of (Target unit of issued order))
    • Actions
      • Unit - Pause (Triggering unit)
      • Unit - Unpause (Triggering unit)
      • Unit - Order (Triggering unit) to Stop
      • -------- give player the massage that he cannot attack allied units --------
if you don't use pause and unpause warcraft will crash coz unit cannot have to orders in the same time
 
its the same as maker´s "((Owner of (Triggering unit)) is an ally of (Owner of (Attacking unit))) Equal to True" but changed because event

you need this because player might want to attack his own units

pauseing and unpauseing unit makes unit able to stop in event - unit is issued an order

here is the trigger

  • stop ally attack targeting
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(attack))
      • ((Target unit of issued order) belongs to an ally of (Owner of (Triggering unit))) Equal to True
      • (Owner of (Triggering unit)) Not equal to (Owner of (Target unit of issued order))
    • Actions
      • Unit - Pause (Triggering unit)
      • Unit - Unpause (Triggering unit)
      • Unit - Order (Triggering unit) to Stop
      • -------- give player the massage that he cannot attack allied units --------
if you don't use pause and unpause warcraft will crash coz unit cannot have to orders in the same time

oh... so it's because of the event used... okay...
 
Status
Not open for further replies.
Top