What i want is a building is attacked, if the attacked building has no units owner by the owner of the attacked unit then create 3 footmen, i think the problem is with the conditions, but i dont know how to fix it.
Ownership 2
Events
Unit - A unit Is attacked
Conditions
(Number of units in (Units within 500.00 of (Position of (Attacked unit)) matching ((Owner of (Attacked unit)) Equal to (Owner of (Attacked unit))))) Equal to 0
Actions
Unit - Create 3 Footman for (Owner of (Attacked unit)) at (Position of (Attacked unit)) facing 270.00 degrees
Unit Spawn?
Moderator: Cheaters
-
- Forum Staff
- Posts: 829
- Joined: January 28th, 2007, 8:10 pm
- Title: JASS Programmer
- Location: Canada
Re: Unit Spawn?
How the "Units in Group Matching Condition" function works is this:
It picks all units within 500 of the position of the attacked unit THEN it filters out units that don't match the condition. Since your condition was "(Owner of (Attacked unit)) Equal to (Owner of (Attacked unit))", that condition would always be true therefore units would never get filtered out. So as long as there was units within 500 of the position of the attacked unit (Which I assume there was since the condition is that A unit is attacked), the group was never empty (Therefore never equal to 0) and thus no units would spawn.
A simple fix...
(Owner of (Attacked unit)) Equal to (Owner of (Matching unit))
It picks all units within 500 of the position of the attacked unit THEN it filters out units that don't match the condition. Since your condition was "(Owner of (Attacked unit)) Equal to (Owner of (Attacked unit))", that condition would always be true therefore units would never get filtered out. So as long as there was units within 500 of the position of the attacked unit (Which I assume there was since the condition is that A unit is attacked), the group was never empty (Therefore never equal to 0) and thus no units would spawn.
A simple fix...
(Owner of (Attacked unit)) Equal to (Owner of (Matching unit))
Try that.ZilvaX wrote:What i want is a building is attacked, if the attacked building has no units owner by the owner of the attacked unit then create 3 footmen, i think the problem is with the conditions, but i dont know how to fix it.
Ownership 2
Events
Unit - A unit Is attacked
Conditions
(Number of units in (Units within 500.00 of (Position of (Attacked unit)) matching ((Owner of (Attacked unit)) Equal to (Owner of (Matching unit))))) Equal to 0
Actions
Unit - Create 3 Footman for (Owner of (Attacked unit)) at (Position of (Attacked unit)) facing 270.00 degrees
-
- Member
- Posts: 52
- Joined: December 16th, 2007, 2:23 am
Re: Unit Spawn?
It dosen't work , thanks for the help lately Aero i really couldn't work on my map with out you.
-
- Forum Staff
- Posts: 829
- Joined: January 28th, 2007, 8:10 pm
- Title: JASS Programmer
- Location: Canada
Re: Unit Spawn?
No worky? Oh well.
I hate GUI, I'm so used to JASS I sometimes forget how to work with GUI.
I hate GUI, I'm so used to JASS I sometimes forget how to work with GUI.
-
- Newcomer
- Posts: 8
- Joined: September 9th, 2008, 4:08 am
- Title: Crack Whore
- Location: CA
Re: Unit Spawn?
i figured out your problem for the trigger just put in these specifications (be warned using this method means that you will have 2 do it for each building you want this effect on, but it works)
ex.
Events -
Unit - Barracks 0034 <gen> Is attacked
Conditions -
(Barracks 0034 <gen> is A structure) Equal to True
Actions -
Unit - Create 3 Footman for Player 1 (Red) at (Position of Barracks 0034 <gen>) facing 270.00 degrees
*Trigger - Turn off (This trigger)
(i believe that it works for everytime the building gets hit)(* put this in there if you only want it to work once, or you can make it everytime it is hit which is without the Trigger - Turn off (This trigger))
alright there you go, not exactly wat you wanted but i tried and thats what matters right? either way use that as a base for the other thing if you figure out how
ex.
Events -
Unit - Barracks 0034 <gen> Is attacked
Conditions -
(Barracks 0034 <gen> is A structure) Equal to True
Actions -
Unit - Create 3 Footman for Player 1 (Red) at (Position of Barracks 0034 <gen>) facing 270.00 degrees
*Trigger - Turn off (This trigger)
(i believe that it works for everytime the building gets hit)(* put this in there if you only want it to work once, or you can make it everytime it is hit which is without the Trigger - Turn off (This trigger))
alright there you go, not exactly wat you wanted but i tried and thats what matters right? either way use that as a base for the other thing if you figure out how
-
- Newcomer
- Posts: 24
- Joined: September 1st, 2008, 12:33 am
Re: Unit Spawn?
i found that your condition is completely wrong. I am not understand Jass at all, but i'm not bad in Gui. It should be like this^^ZilvaX wrote:What i want is a building is attacked, if the attacked building has no units owner by the owner of the attacked unit then create 3 footmen, i think the problem is with the conditions, but i dont know how to fix it.
Ownership 2
Events
Unit - A unit Is attacked
Conditions
(Number of units in (Units within 500.00 of (Position of (Attacked unit)) matching ((Owner of (Attacked unit)) Equal to (Owner of (Attacked unit))))) Equal to 0
Actions
Unit - Create 3 Footman for (Owner of (Attacked unit)) at (Position of (Attacked unit)) facing 270.00 degrees
Code: Select all
Events
Unit - A unit Is attacked
Conditions
((Attacked unit) is A structure) Equal to True
(Number of units in (Units within 512.00 of (Position of (Attacked unit)) matching (((Owner of (Matching unit)) Equal to (Owner of (Attacked unit))) and (((Matching unit) Not equal to (Attacked unit)) and (((Matching unit) is alive) Equal to True))))) Equal to 0
Actions
Unit - Create 3 Footman for (Owner of (Attacked unit)) at (Position of (Attacked unit)) facing Default building facing degrees