My title doesn't say much but in the ma that I'm editing only requires money, so I changed the tree icon for lumber to a kodo face. Then I thought what's the point of having that there when it does nothing. I looked at other games such as "Rabbits Vs Sheep" and they didn't use the lumber section either but they change it into rabbit/sheep face and I think there were numbers to show how many sheep/rabbits are on the map.
I thought it was a good idea but I didn't know how to make the trigger.
So can someone give GUI triggers for this?? Please??
Thank You in advance
Help with: Unit Counter Trigger
Moderator: Cheaters
-
- Senior Member
- Posts: 123
- Joined: July 4th, 2009, 12:00 am
- Title: Pandaren-Assassin
Help with: Unit Counter Trigger
Last edited by Panda-Assassin on July 9th, 2009, 5:36 am, edited 1 time in total.
"A unit of time is as precious as a unit of gold, but you cannot don't click me back one unit of time with one unit of gold."
Thanks for all the help Syre!
Thanks for all the help Syre!
-
- Forum Staff
- Posts: 506
- Joined: November 17th, 2008, 3:49 pm
Re: Help: Unit Counter Trigger
Alright..if your using only one type of kodos, this will work. Just create two variables. One an integer, the second a unit group.
UG is for the unit-group variable, and I is for the integer one. If your using more than one type of kodo, use this instead. (Assuming your going to have them owned by a comp, not hostile.)
Code: Select all
Untitled Trigger 001 Copy 4
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Set UG_Kodos = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Kodo Beast))
Set I_Kodos = (Number of units in UG_Kodos)
Player Group - Pick every player in (All players) and do (Player - Set (Picked player) Current lumber to I_Kodos)
Code: Select all
Untitled Trigger 001 Copy 4
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Set UG_Kodos = (Units owned by Player 12 (Brown))
Set I_Kodos = (Number of units in UG_Kodos)
Player Group - Pick every player in (All players) and do (Player - Set (Picked player) Current lumber to I_Kodos)
-
- Senior Member
- Posts: 123
- Joined: July 4th, 2009, 12:00 am
- Title: Pandaren-Assassin
Re: Help: Unit Counter Trigger
Thank You.
But sadly, this won't work because there are 13 kodos in total in my game and some appear depending on the level (i.e. Easy, Normal, X-Treme)
If there are 2 AI controlling the kodos, do I just add an extra player?? (i.e units owned by player dark green??)
About the variables: I_Kodos and UG_Kodos, what variable types are they?? because I'm not too good with triggers and I don't know which one to use for certain variables.
But sadly, this won't work because there are 13 kodos in total in my game and some appear depending on the level (i.e. Easy, Normal, X-Treme)
If there are 2 AI controlling the kodos, do I just add an extra player?? (i.e units owned by player dark green??)
About the variables: I_Kodos and UG_Kodos, what variable types are they?? because I'm not too good with triggers and I don't know which one to use for certain variables.
Last edited by Panda-Assassin on July 9th, 2009, 8:35 am, edited 4 times in total.
"A unit of time is as precious as a unit of gold, but you cannot don't click me back one unit of time with one unit of gold."
Thanks for all the help Syre!
Thanks for all the help Syre!
-
- Forum Staff
- Posts: 506
- Joined: November 17th, 2008, 3:49 pm
Re: Help with: Unit Counter Trigger
Well, the second one would work no matter how many types you have. As that counts how many units that color has. So even if you have all 13 types at once, it would work if its all controlled by one enemy.
Edit : Dident see the edit before. Use this instead then.
Alright, UG_Kodos is a Unit Group Array. Size 2. To make it, go into the varibles editor Ctrl+B, create a new variable (Green X, or Ctrl+N). Name it whatever you want, but make it something that you wont confuse with the integer. Next, make the type Unit Group. Under that, check Array, and make the Size 2.
Next, we do it again. Create a new one, type integer. Click Ok, dont check array. Now, create a new action. Its called Set Variable, first we need to set the unit group. So for the variable go ahead and click the unit group you made. Next, something should come up saying [Index], for that just put 1, as shown above. Then Units - Owned by Player. Then, just repeat the step for the second one, just change the number and the player.
Then, again create action, this time use the integer. For the value, use the first one thats there, Arithmetic. First one Units - Count unit in unit group. Set it as shown above, and do the same for the other one. Then, for the last one, ya should be able to get on your own, its self explanitory.
Hope this helps.
Edit : Dident see the edit before. Use this instead then.
Code: Select all
Untitled Trigger 001 Copy 4
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Set UG_Kodos[1] = (Units owned by Player 12 (Brown))
Set UG_Kodos[2] = (Units owned by Player 11 (Dark Green))
Set I_Kodos = ((Number of units in UG_Kodos[1]) + (Number of units in UG_Kodos[2]))
Player Group - Pick every player in (All players) and do (Player - Set (Picked player) Current lumber to I_Kodos)
Next, we do it again. Create a new one, type integer. Click Ok, dont check array. Now, create a new action. Its called Set Variable, first we need to set the unit group. So for the variable go ahead and click the unit group you made. Next, something should come up saying [Index], for that just put 1, as shown above. Then Units - Owned by Player. Then, just repeat the step for the second one, just change the number and the player.
Then, again create action, this time use the integer. For the value, use the first one thats there, Arithmetic. First one Units - Count unit in unit group. Set it as shown above, and do the same for the other one. Then, for the last one, ya should be able to get on your own, its self explanitory.
Hope this helps.
-
- Senior Member
- Posts: 123
- Joined: July 4th, 2009, 12:00 am
- Title: Pandaren-Assassin
Re: Help with: Unit Counter Trigger
Thank You for step to step procedure. Works great.
"A unit of time is as precious as a unit of gold, but you cannot don't click me back one unit of time with one unit of gold."
Thanks for all the help Syre!
Thanks for all the help Syre!