• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Income Per Type of unit help trigger.

Status
Not open for further replies.
Level 3
Joined
Nov 12, 2011
Messages
46
I searched through most of the forum to look for a trigger that could help me in this.

  • Chicken Income
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Chicken
            • Then - Actions
            • Else - Actions
              • Do nothing
im having a problem with the counting the number of "chickens" and giving (number of gold) per chicken to a limit of 7 chickens.if anyone can help me with this i would realy appciait ait.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Chicken Income
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • loop from 1 to max player number
        • set integerArray[integer A] = 0
      • endloop
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Chicken
              • Picked unit is alive
              • integerArray[Player number of owner of picked unit] < 7
            • Then - Actions
              • set integerArray[Player number of owner of picked unit] = integerArray[Player number of owner of picked unit] + 1
            • Else - Actions
 
Level 3
Joined
Nov 12, 2011
Messages
46
defskull, seeing as for right now the fact that the chicken is the only Auto income for my map i wanted a small non-leaking code :D but thank you for the infomation.

And thanks maker for the help. Maker it would have helpped a bit more to explain how each part that you changed was done. it took me nearly an hour to get it done

Edit: Maker it seems that you were not looking at the world editor when you wrote this xD the trigger its self is sound but at this time it is not activating correctly.
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
I would be honored if you tell me where is the leak instead of saying the leak but you're not really explain it where and how to improve.
Perhaps I can improve it and credits to you of course.
Action speaks louder than words, they say.
 
Status
Not open for further replies.
Top