Is there any way I could disable the targeting of an ally's units? I'm not talking about un-allying/allying them. That's not the problem. I'm talking if they decide to attack you without un-allying you. I mean I could probably create a trigger couldn't I? Help don't know where to start.
You can set up a pretty simple trigger to cause any attack orders against allied units to simply be disregarded:
Event: Unit - Any Unit is issued an order to Attack
Condition: (Player (Triggering player) is giving player (Owner of (Target unit for (Triggering order))) Non-aggression) == true
(read like this: "If the player issuing the order is not hostile towards the owner of the order's target")
Action: Unit - Order (Triggering unit) to ( Stop) (Replace Existing Orders)
I don't see a simple way to make this kind of thing cover all hostile abilities, though. For example, I see no reason that Snipe wouldn't still work with this trigger.
You can set up a pretty simple trigger to cause any attack orders against allied units to simply be disregarded:
Event: Unit - Any Unit is issued an order to Attack
Condition: (Player (Triggering player) is giving player (Owner of (Target unit for (Triggering order))) Non-aggression) == true
(read like this: "If the player issuing the order is not hostile towards the owner of the order's target")
Action: Unit - Order (Triggering unit) to ( Stop) (Replace Existing Orders)
I don't see a simple way to make this kind of thing cover all hostile abilities, though. For example, I see no reason that Snipe wouldn't still work with this trigger.
I could probably find a way around that. But honestly could not find a working way of doing it. Currently the way I tried to make it work was by checking if the unit was on the same team. But this lead to the some crappy results. Thanks tho :D
Yah they changed it, just checked. Well tell me if it works
It does, perfectly well. Actually, I was looking at rallion's way of doing it in the trigger debugger. Apparently, and I didn't see before because I have the trigger error option checked on my map, his was like a constant bomb. It may have worked but jesus it spat out like 50 bajillion errors a second.
To amend rallion's trigger, another first-ordered condition is necessary:
(Ownerof(Targetunitfor(Triggeringorder)))<=15
since the function "Target Unit For Order" returns "16" if the player attack move to an area instead of clicking on a unit. And 16 as you may know is out of bounds when accessing players in an array.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Is there any way I could disable the targeting of an ally's units? I'm not talking about un-allying/allying them. That's not the problem. I'm talking if they decide to attack you without un-allying you. I mean I could probably create a trigger couldn't I? Help don't know where to start.
@ST4RKiLL3R: Go
You can set up a pretty simple trigger to cause any attack orders against allied units to simply be disregarded:
Event: Unit - Any Unit is issued an order to Attack
Condition: (Player (Triggering player) is giving player (Owner of (Target unit for (Triggering order))) Non-aggression) == true
(read like this: "If the player issuing the order is not hostile towards the owner of the order's target")
Action: Unit - Order (Triggering unit) to ( Stop) (Replace Existing Orders)
I don't see a simple way to make this kind of thing cover all hostile abilities, though. For example, I see no reason that Snipe wouldn't still work with this trigger.
I could probably find a way around that. But honestly could not find a working way of doing it. Currently the way I tried to make it work was by checking if the unit was on the same team. But this lead to the some crappy results. Thanks tho :D
Well. For the snipe ability: when creating he ability make it's targets to be hostile (like you can't cast feedback on allies)
Use the Target Filters on the weapon tab.
Self
Ally
Neutral
Enemy
Uncheck the Self, and Ally
Seems they changed it because there is no 'self' there. I think 'Player' replaced it.
Yah they changed it, just checked. Well tell me if it works
It does, perfectly well. Actually, I was looking at rallion's way of doing it in the trigger debugger. Apparently, and I didn't see before because I have the trigger error option checked on my map, his was like a constant bomb. It may have worked but jesus it spat out like 50 bajillion errors a second.
So what type of map is for?
Snowball Wars. Had to make sure it wouldn't be a problem for the remake.
@rallion: Go
To amend rallion's trigger, another first-ordered condition is necessary:
since the function "Target Unit For Order" returns "16" if the player attack move to an area instead of clicking on a unit. And 16 as you may know is out of bounds when accessing players in an array.