• 🏆 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!

Can't count units

Status
Not open for further replies.
Level 3
Joined
Apr 12, 2015
Messages
19
Hey guys
I am new on this forum and I see in many other threads that the community is very helpful and I hope you can also help with my problem :as:

That's my problem:
I want to count the wisp of a Player everytime he trained one and the amount of the wisps should be seen at the mutliboard.

Like in Legion TD Mega:

Legion_TD_board.png




This is my Trigger:

Problem.png


I know that the problem is in the Event section because I changed it into "Unit - Unit enters Region" and it count the wisp. But this wont work like I want because when I walk in this Region with this one wisp again it will add the amount of wisps endless

I hope someone can help :as:
 
Level 3
Joined
Apr 12, 2015
Messages
19
wow thx for the fast replies =P

Try changing the Condition to Unit Type of TRAINED UNIT equal to Wisp.

Oh my godness >.< I tried and tried ans it's so simple o.ô

Also, triggering unit is the building that Trained the unit which is the Tree of Life if you are using the NightElf race.

Oh Didn't realize that. I often changed the trigger and I forgot to change it again ^^

Thanks guys for the fast help =) I guess I will have more questions in the future
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
This isn't related to the topic, but it will help you if you encounter more problems in the future.

Do like this:
f6046b64c76256ff9686b0733e388984.png


and then use [trigger]COPY PASTE HERE[/trigger]

equals

  • combat loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in CS_group and do (Actions)
        • Loop - Actions
          • Custom script: local integer udg_CS_handle1 = GetHandleId(GetEnumUnit())
          • Set CS_counter = ((Load 1 of CS_handle1 from CS_hash) + 0.03)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CS_counter Greater than or equal to CS_combat_time
            • Then - Actions
              • Hashtable - Clear all child hashtables of child CS_handle1 in CS_hash
              • Set CS_leaving_unit = (Picked unit)
              • Set CS_combat_event = 2.00
              • Set CS_combat_event = 0.00
              • Unit Group - Remove (Picked unit) from CS_group
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (CS_group is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
              • Hashtable - Save CS_counter as 1 of CS_handle1 in CS_hash
 
Status
Not open for further replies.
Top