[GUI-Triggers] Can't attack friendly units.

Epicgamers

New Member
Reaction score
5
Hello, Once again =]

Can someone please tell me how/if it can't be easier.
That you can't attack friendly units with 'Attack Command'?
Cause im making a RPG and it will be stupid that you kill the whole town.

And i can't make them invurnerable cause enemies may kill the guards =]


thank you,

RodyIsGod
 
Give them a classification like "ancient" or some such, and then set it so that the hero unit cannot attack ancients.
 
Trigger:
  • dd
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
    • Actions
      • Player Group - Pick every player in Team1 and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Targeted unit)) Equal to (==) (Picked player)
            • Then - Actions
              • Unit - Order (Ordered unit) to Stop
            • Else - Actions
You can try like that
Give them a classification like "ancient" or some such, and then set it so that the hero unit cannot attack ancients.

Also that Wouldnt work cuz maybe all the players might be the same units
and you can change the attack to Enemy only
 
Trigger:
  • Anti-Friendly fire
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Owner of (Attacking unit) belong to an Ally of (Owner of (Attacked unit) Equal to TRUE)
    • Actions
      • Unit - Order (Attacking unit) to Stop

Done as it is in Dota Template.
 
Trigger:
  • Anti-Friendly fire
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Owner of (Attacking unit) belong to an Ally of (Owner of (Attacked unit))
    • Actions
      • Unit - Order (Attacking unit) to Stop
Lol it was that ez? Wow im a dumb@ssXD
 
Or, more simply:
Code:
Event - A unit is attacked
Condition - Boolean - (Owner of (Triggering Unit)) is an ally of (Owner of (Attacking Unit)) Equal to (True)
Action - Order (Attacking Unit) to (Stop)

edit: woah, fast posts. I have been bested.
 
Hm, forgot about enemy only, that would be the best option. There's no need to trigger this, at any rate.
 
Trigger:
  • dd
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
    • Actions
      • Player Group - Pick every player in Team1 and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Targeted unit)) Equal to (==) (Picked player)
            • Then - Actions
              • Unit - Order (Ordered unit) to Stop
            • Else - Actions
You can try like that


Also that Wouldnt work cuz maybe all the players might be the same units
and you can change the attack to Enemy only

Ur trigger doesn't work either.
Or how you got pick every player in TEAM1.
How you got team 1? if its a variable which should i use.
 
Ur trigger doesn't work either.
Or how you got pick every player in TEAM1.
How you got team 1? if its a variable which should i use.
Team 1 is a player group variab;e
Mkae a trigger which adds players to the player group
I just used that trigger cuz it was in the map i was making lol so trust simonake
 
Woah, 3 posts while i was trying his code.
Well thank you, yours was way clearer.

Thank you for trying too Blooman, then it would probably worked, but ya i got for the easiest =]

THANKS!
 
Woah, 3 posts while i was trying his code.
Well thank you, yours was way clearer.

Thank you for trying too Blooman, then it would probably worked, but ya i got for the easiest =]

THANKS!
Waah You didnt pick mineD::mad::mad:
JkXD:shades:at least ty for trying mines out
 
Team 1 is a player group variab;e
Mkae a trigger which adds players to the player group
I just used that trigger cuz it was in the map i was making lol so trust simonake

Lolz, I think simonake is a noob.
 
Have you tried setting the hero's attacks so that they can only target and affect enemies? Using a trigger just adds in more work for the computer (not much, but it adds up) and makes the whole deal less reliable. If there's a bit of lag or a lot of triggers running at once, it could take a while before the trigger kicks in. Just disallowing attacking allies in the first place on the other hand would remove that much more processing power and bandwidth needed. :rolleyes:

Also, no need to go insulting others, especially when they just finished helping someone.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      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