Snippet Making it So Allies Can't Attack Allies

Nets8

New Member
Reaction score
1
This will fix any cheaters and back stabbers on your map. It's a big ass trigger to function not being able to attack allies. Basically what it is saying is that if a unit of a player is attacked by an ally, the triggering unit will be paused for five game-seconds and then unpaused.

Code:
allies cant attack allies
    Events
        Unit - A unit owned by Player 12 (Brown) Is attacked
        Unit - A unit owned by Player 11 (Dark Green) Is attacked
        Unit - A unit owned by Player 10 (Light Blue) Is attacked
        Unit - A unit owned by Player 9 (Gray) Is attacked
        Unit - A unit owned by Player 8 (Pink) Is attacked
        Unit - A unit owned by Player 7 (Green) Is attacked
        Unit - A unit owned by Player 6 (Orange) Is attacked
        Unit - A unit owned by Player 5 (Yellow) Is attacked
        Unit - A unit owned by Player 4 (Purple) Is attacked
        Unit - A unit owned by Player 3 (Teal) Is attacked
        Unit - A unit owned by Player 1 (Red) Is attacked
        Unit - A unit owned by Player 2 (Blue) Is attacked
    Conditions
        ((Triggering player) is an ally of Player 12 (Brown)) Equal to True
        ((Triggering player) is an ally of Player 11 (Dark Green)) Equal to True
        ((Triggering player) is an ally of Player 10 (Light Blue)) Equal to True
        ((Triggering player) is an ally of Player 9 (Gray)) Equal to True
        ((Triggering player) is an ally of Player 8 (Pink)) Equal to True
        ((Triggering player) is an ally of Player 7 (Green)) Equal to True
        ((Triggering player) is an ally of Player 6 (Orange)) Equal to True
        ((Triggering player) is an ally of Player 5 (Yellow)) Equal to True
        ((Triggering player) is an ally of Player 4 (Purple)) Equal to True
        ((Triggering player) is an ally of Player 3 (Teal)) Equal to True
        ((Triggering player) is an ally of Player 2 (Blue)) Equal to True
        ((Triggering player) is an ally of Player 1 (Red)) Equal to True
    Actions
        Unit - Pause (Triggering unit)
        Wait 5.00 game-time seconds
        Unit - Unpause (Triggering unit)

Have fun!
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
Are you serious? This trigger does nothing. Meaning that people will still be able to attack each other. The trigger does not stop them from attacking, it does nothing at all. The action Do Nothing does just that - nothing.
 

Nets8

New Member
Reaction score
1
Then why is there something like that for actions? Then if someone picks that they shouldn't have a trigger at all?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
> Then why is there something like that for actions?

I have no idea, but that action is pretty pointless. Don't ever use it. It just takes up unnessary RAM.

> Then if someone picks that they shouldn't have a trigger at all?

Well, the trigger will do nothing.
 

Nets8

New Member
Reaction score
1
I'm kind of new to this. I have my own map and it is pretty decent. A gate system and stuff. Then what would you do so allies can't attack allies?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
> Then what would you do so allies can't attack allies?

You would order the attacking unit to stop.
 

Nets8

New Member
Reaction score
1
Making it So Allies Can't Attack Allies FIXED

This will fix any cheaters and back stabbers on your map. It's a big ass trigger to function not being able to attack allies. Basically what it is saying is that if a unit of a player is attacked by an ally, the triggering unit will be paused for five game-seconds and then unpaused.

Code:
allies cant attack allies
    Events
        Unit - A unit owned by Player 12 (Brown) Is attacked
        Unit - A unit owned by Player 11 (Dark Green) Is attacked
        Unit - A unit owned by Player 10 (Light Blue) Is attacked
        Unit - A unit owned by Player 9 (Gray) Is attacked
        Unit - A unit owned by Player 8 (Pink) Is attacked
        Unit - A unit owned by Player 7 (Green) Is attacked
        Unit - A unit owned by Player 6 (Orange) Is attacked
        Unit - A unit owned by Player 5 (Yellow) Is attacked
        Unit - A unit owned by Player 4 (Purple) Is attacked
        Unit - A unit owned by Player 3 (Teal) Is attacked
        Unit - A unit owned by Player 1 (Red) Is attacked
        Unit - A unit owned by Player 2 (Blue) Is attacked
    Conditions
        ((Triggering player) is an ally of Player 12 (Brown)) Equal to True
        ((Triggering player) is an ally of Player 11 (Dark Green)) Equal to True
        ((Triggering player) is an ally of Player 10 (Light Blue)) Equal to True
        ((Triggering player) is an ally of Player 9 (Gray)) Equal to True
        ((Triggering player) is an ally of Player 8 (Pink)) Equal to True
        ((Triggering player) is an ally of Player 7 (Green)) Equal to True
        ((Triggering player) is an ally of Player 6 (Orange)) Equal to True
        ((Triggering player) is an ally of Player 5 (Yellow)) Equal to True
        ((Triggering player) is an ally of Player 4 (Purple)) Equal to True
        ((Triggering player) is an ally of Player 3 (Teal)) Equal to True
        ((Triggering player) is an ally of Player 2 (Blue)) Equal to True
        ((Triggering player) is an ally of Player 1 (Red)) Equal to True
    Actions
        Unit - Pause (Triggering unit)
        Wait 5.00 game-time seconds
        Unit - Unpause (Triggering unit)

Have fun!
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
Don't start a whole new thread. Simply edit your existing trigger. Also, I don't think there is a Triggering Player, either. And another thing is you can't have all of those conditions be true at the same time. A much better and more efficient way would be like this:

Code:
Stop Attacks
    Events
        Unit - A unit Is attacked
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Owner of (Attacking unit)) is an ally of (Owner of (Attacked unit))) Equal to True
            Then - Actions
                Unit - Order (Triggering unit) to Stop
            Else - Actions
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
> Done.

However, the trigger doesn't work.

1. You can't have all of those conditions be true at the same time. That would mean that the owner of the unit is allied to everyone.

2. There is no Triggering Player. You have to use Owner of Triggering Unit.
 

Blackveiled

Formerly, Ban-Lord
Reaction score
157
and you gotta have the conditions set as if like one happens, because it wont work if theres like 20 conditions, and you only need one for the player. so make it

If (ANY) conditions are true THEN actions
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
> If (ANY) conditions are true THEN actions

That would be an OR comparison.
 

HailCommi

New Member
Reaction score
15
Correct me if I'm wrong, but I believe the Unit is Attacked event is for attack orders On Striking, and I was able to attack my allies (with similar functions) if clicked fast enough. I would imagine that a order comparison would be better. But then again, I dunno, never tried it :D . Why do so many ppl want Anti-FF triggers these days anyway =/. Just make them pay the price :p.
 

Blackveiled

Formerly, Ban-Lord
Reaction score
157
Also, this is alot of un-needed GUI..

Try

Events
Unit - A Unit is Attacked
Conditions
Any of the Conditions are true:
Unit - Owner of (Attacking Unit) is equal to (Player 1 (Red))
..etc
Actions
If/Then/Else
If Attacked Unit = Ally to owner of Attacking Unit
Then
. Unit - Order Unit to Stop
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
> Also, this is alot of un-needed GUI..

Try

o_O I think I covered that:

Code:
Stop Attacks
    Events
        Unit - A unit Is attacked
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Owner of (Attacking unit)) is an ally of (Owner of (Attacked unit))) Equal to True
            Then - Actions
                Unit - Order (Triggering unit) to Stop
            Else - Actions
 

Blackveiled

Formerly, Ban-Lord
Reaction score
157
Yeah, thats exactly what I was thinking of, I cant get the triggers right, because i need a new copy of my wc3 CDs so i dont have the editor with me right now.
 

Söder

New Member
Reaction score
1
Trigger
-----------------------------------------------------------------
Event:
-Unit - A unit Is attacked
Condition:
-((Owner of (Attacking unit)) is an ally of (Owner of (Attacked unit))) Equal to True
Action:
-((Owner of (Attacking unit)) is an ally of (Owner of (Attacked unit))) Equal to True
-Unit - Order (Attacking unit) to Stop
-Unit - Pause (Attacking unit)
-Special Effect - Create a special effect attached to the overhead of (Attacking unit) using Abilities\Spells\Orc\LightningShield\LightningShieldTarget.mdl
-Wait 0.50 seconds
-Special Effect - Destroy (Last created special effect)
-Wait 14.00 seconds
-Unit - Unpause (Attacking unit)
-----------------------------------------------------------------------
Worked for me ^^
 

Blackveiled

Formerly, Ban-Lord
Reaction score
157
14 seconds seems kind of long doesnt it? And wouldn't that trigger cause leaks because the special effect isnt designated to a variable?>
 

Sim

Forum Administrator
Staff member
Reaction score
534
Ghan gave you the solution but usually submissions are for working triggers... ;)
 

Blackrage

Ultra Cool Member
Reaction score
25
use this :
-------------------------------------------------
Event:

Unit is Attacked
-------------------------------------------------
Condition:

Attacking unit belongs to an ally of attacked unit
-------------------------------------------------
Action:

Unit - Order Attacking Unit to Stop
-------------------------------------------------
So much shorter ;)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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