• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

How do I make players not attack each other.

Status
Not open for further replies.
Level 13
Joined
Sep 14, 2012
Messages
437
@Jampion
  • Events
    • Unit - A unit is issued an order targeting an object
  • Conditions
  • Actions
    • Player Group - Pick every player in (Ally) and do (Actions)
      • Loop - Actions
        • If(Conditions are True)then do (Then Actions)else do(Else Actions)
          • If - Conditions
            • (Owner of (Attacking unit)) Equal to (Owner of (Picked Player))
          • Then - Action
          • Else - Action
This is What i got so far, Help me out.
 
Last edited:
Level 15
Joined
Mar 25, 2016
Messages
1,327
Not so complicated. :)
  • Attack Stop
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Owner of (Attacked unit)) is an ally of (Owner of (Attacking unit))) Equal to True
    • Actions
      • Unit - Order (Attacking unit) to Stop
You have a few options there. You can change the event from detecting the attack to detecting the order given.
You can also use other orders. For example have the unit follow the target or have the unit attack move towards the target point.

I personally would go with detecting the order and ordering the unit to attack move to the position of the target unit when the order is given. Then a missclick on an allied unit would mean no harm.
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
it's a boolean condition, no player comparison

edit: search at p: player is enemy of player
 
Last edited:
Status
Not open for further replies.
Top