My problem, is how do i do a check to see if the unit that entered within 14 of the triggering unit is an enemy? There no function to return it :(
Ive searched but all the workarounds I've found deal with targeted ability which the workaround is to use autocasting, which of course will not work here unless im missing something major.
If i have the syntax wrong, fine. Thats an easy fix.
however. This is what i need to do:
Event (Pseudo or actual)
Unit 1 gets within X of Unit 2.
Make sure Unit 1 is a siege tank, and make sure owning player has researched siege tech.
Make sure owner of Unit 1 and owner of Unit 2 are enemy's.
order tank to enter siege mode.
I'm more than open to any ideas of how to accomplish this using auras, behaviors etc. It just seems silly that the event doesnt let you return both units somehow.
You want to change wherever you have Triggering Unit to reference the Siege Tank you actually want the trigger to work for since that isn't the appropriate use for the Triggering Unit function.
Now, for checking the owner of a unit: Add a Comparison condition. For the first value, you want the function named "Owner of Unit". For the second value you set the player number you want to check for and it should work.
In that case, what I would do is set the event to be "Any Unit Enters a distance of 14.0 from Any Unit". Now, keep in mind that the Triggering Unit will be the unit that will be moving in range of the other.
And I think you want the "Alliance Aspect" function. Pass the player numbers (which you get from the Owner of Unit function) to this function and it should tell you whether the players are enemies or not.
It might be better to use an issue order effect, in combination with a search behavior/effect to do this using the data editor.
the buff is on the tank unit
Search area -> range: 14 arc: 360
Effect -> Issue order -> Siege Mode
this is the general idea for doing this using just the data editor. you can set this behavior (buff) to be active on all siege tanks, or just on specific ones that you give the buff when they're created or some other way using triggers.
Yep, that is much better. You can then also set the target filters to Enemy so that it occurs only when there are enemies in range doing away with triggers completely.
Im trying to come up with a trigger that will make a siege tank enter siege mode when an enemy ground unit enters within 14. Ive got this so far;
My problem, is how do i do a check to see if the unit that entered within 14 of the triggering unit is an enemy? There no function to return it :(
Ive searched but all the workarounds I've found deal with targeted ability which the workaround is to use autocasting, which of course will not work here unless im missing something major.
Events Unit - Any Unit Enters a distance of 14.0 from (Triggering unit)
That's is what's wrong. You can't use the triggering unit as an event parameter.
@Skoite: Go
If i have the syntax wrong, fine. Thats an easy fix.
however. This is what i need to do:
Event (Pseudo or actual) Unit 1 gets within X of Unit 2.
Make sure Unit 1 is a siege tank, and make sure owning player has researched siege tech. Make sure owner of Unit 1 and owner of Unit 2 are enemy's. order tank to enter siege mode.
I'm more than open to any ideas of how to accomplish this using auras, behaviors etc. It just seems silly that the event doesnt let you return both units somehow.
You want to change wherever you have Triggering Unit to reference the Siege Tank you actually want the trigger to work for since that isn't the appropriate use for the Triggering Unit function.
Now, for checking the owner of a unit: Add a Comparison condition. For the first value, you want the function named "Owner of Unit". For the second value you set the player number you want to check for and it should work.
@Klishu: Go
Im not sure I understand your first part, how can you direct the value to a unit within the script that has not been created yet?
Eg.
Unit - Any Unit Enters a distance of 1.0 from "Unit"
What would I put in the quoted 'unit' ?
It does not allow for a Unit by Unit Type, and the siege tanks in question of course haven't been created yet as of map init.
For the second part, I'm afraid I'm needing something more dynamic :/ teams will not be a constant throughout the course of the game.
@DarkShape80: Go
In that case, what I would do is set the event to be "Any Unit Enters a distance of 14.0 from Any Unit". Now, keep in mind that the Triggering Unit will be the unit that will be moving in range of the other.
And I think you want the "Alliance Aspect" function. Pass the player numbers (which you get from the Owner of Unit function) to this function and it should tell you whether the players are enemies or not.
@Klishu: Go
It might be better to use an issue order effect, in combination with a search behavior/effect to do this using the data editor.
the buff is on the tank unit
Search area -> range: 14 arc: 360
Effect -> Issue order -> Siege Mode
this is the general idea for doing this using just the data editor. you can set this behavior (buff) to be active on all siege tanks, or just on specific ones that you give the buff when they're created or some other way using triggers.
@Helral: Go
Yep, that is much better. You can then also set the target filters to Enemy so that it occurs only when there are enemies in range doing away with triggers completely.
@Klishu: Go
It doesn't allow the preset Any Unit to be entered there.
@Helral: Go
Ill see if this will do what i need, sounds very promising, Ive never tangled with behaviors tho.
@DarkShape80: Go
Auto Cast on the Siege Tank morph ability can do what you want very easily.
@Elemeno: Go
ty, this worked perfectly, and was much easier than the way I was trying to do it.