This trigger was puzzling me for a long time.. i finally today figured out how to do it and its fairly simple!
1. Create Player Group Variable named "Alliance" or what ever you want it to be....
2. use this trigger setup:
NOTE! Remember to add additional Conditions if you have more players! if you don't then the ones that aren't specified will attack... also if they are not players in the alliance player group they will also attack... I also supposed you don't need the player group.. but its working for me so..
I tried using the data editor but it didn't work it still allowed forced attacks like when you click attack and click a unit it would allow you to attack I se the filtes to exclude ally/neutral/ player and left enemy checked I did it for the weapon and ability and it still allowed the player to force an attack on the ally units. Also I didn't know what stage to use so thanks for the info on that! And I do think this trigger is relevant because I spent 2 days researching how to figure out hou to stop forced click attacks and I found the filter changes but to my surprise it didn't work so I figured this out and I works perfect within my map!
Lol, way to rip into a guy there, sheesh. Don't take it too hard Vamp, I think all they really meaning to say is, make sure your method is optimized/hasn't already been done before posting it. By the way, be careful about how you do this if you plan to implement PVP of any kind in your map, might have to re-work it otherwise.
My intent for this was to give direction to someone who can't figure it out on there own and need a little direction. Can I be optimized yes lots of thing on this site are... I never truly use information like this from the site and not change it to fit my needs. We're here to help one another. I have changed this base trigger to fit my map needs. If it were for pvp situation it would be a matter of making a trigger/dialog(many options) to toggle a Boolean variable for pvp on or, pvp off and adding a "if then" action and checking if its false/off then stop unit replacing existing orders and else do nothing... But I have no pvp in my map so..
And of course the variable would be an array if it were player based. Instead of global pvp.
I really think that before people flame someone for posting a tutorial on how to create something so you can customize it to your own needs. Relevant information that I got from the posts was using the first stage of the ability rather than any stage.
There is a function to check , if a player is allied to another player (in gui it is called Alliance Aspect, I believe), however, it is not really intuitive to use.
Anyway, I just tried to modify the attack ability in data to prevent selecting allied units as a target, and it seems to work flawlessly. Try it, search for the default Attack ability in the abilities tab, open the Ability: Supported Filters field and uncheck Ally and Player. Now, if you try to do a forced attack on an ally, you will issue an attack ground command on the clicked location instead. It wouldn't even select the allied unit as a click target, so there would be no error message as well.
Yes it works but I don't want the feature of the unit moving to the target like you said it does I like how the units stay in place the way it is now if it becomes an issue I will try it differently. Right now the trigger is not giving me any problems and I'm not getting any errors
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
This trigger was puzzling me for a long time.. i finally today figured out how to do it and its fairly simple!
1. Create Player Group Variable named "Alliance" or what ever you want it to be....
2. use this trigger setup:
NOTE! Remember to add additional Conditions if you have more players! if you don't then the ones that aren't specified will attack... also if they are not players in the alliance player group they will also attack... I also supposed you don't need the player group.. but its working for me so..
@vamppanik666: Go BTW your trigger's event is going to fire at every stage of a valid attack generating too many events IMO
Heres an easier way to do it.
This should be removed from tutorials..... that isnt the way to go about doing it at all
Whats wrong with the data editor? You can stop friendly fire on the weapon ...
Should even be possible in the target filters of the attack ability
I tried using the data editor but it didn't work it still allowed forced attacks like when you click attack and click a unit it would allow you to attack I se the filtes to exclude ally/neutral/ player and left enemy checked I did it for the weapon and ability and it still allowed the player to force an attack on the ally units. Also I didn't know what stage to use so thanks for the info on that! And I do think this trigger is relevant because I spent 2 days researching how to figure out hou to stop forced click attacks and I found the filter changes but to my surprise it didn't work so I figured this out and I works perfect within my map!
@vamppanik666: Go
It may work for your map currently but not for all situations. For example if you had a second team of players. It would not support that.
It also will not support most other players stuff.
My suggestion in the future it if you looking how to do something.... search for it in the forum.
If you cant find anything make a topic in the "trigger" or "data" forum depending on the kind of solution your looking for.
You shouldn't post half baked solutions to the "tutorial forum"
Lol, way to rip into a guy there, sheesh. Don't take it too hard Vamp, I think all they really meaning to say is, make sure your method is optimized/hasn't already been done before posting it. By the way, be careful about how you do this if you plan to implement PVP of any kind in your map, might have to re-work it otherwise.
My intent for this was to give direction to someone who can't figure it out on there own and need a little direction. Can I be optimized yes lots of thing on this site are... I never truly use information like this from the site and not change it to fit my needs. We're here to help one another. I have changed this base trigger to fit my map needs. If it were for pvp situation it would be a matter of making a trigger/dialog(many options) to toggle a Boolean variable for pvp on or, pvp off and adding a "if then" action and checking if its false/off then stop unit replacing existing orders and else do nothing... But I have no pvp in my map so..
And of course the variable would be an array if it were player based. Instead of global pvp.
I really think that before people flame someone for posting a tutorial on how to create something so you can customize it to your own needs. Relevant information that I got from the posts was using the first stage of the ability rather than any stage.
There is a function to check , if a player is allied to another player (in gui it is called Alliance Aspect, I believe), however, it is not really intuitive to use.
Anyway, I just tried to modify the attack ability in data to prevent selecting allied units as a target, and it seems to work flawlessly. Try it, search for the default Attack ability in the abilities tab, open the
Ability: Supported Filters field and uncheck Ally and Player. Now, if you try to do a forced attack on an ally, you will issue an attack ground command on the clicked location instead. It wouldn't even select the allied unit as a click target, so there would be no error message as well.
Does this work for you?
Yes it works but I don't want the feature of the unit moving to the target like you said it does I like how the units stay in place the way it is now if it becomes an issue I will try it differently. Right now the trigger is not giving me any problems and I'm not getting any errors