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

Don't Understand What Could Be Wrong

Status
Not open for further replies.
Level 6
Joined
Sep 19, 2005
Messages
169
[gui]Trigger 1
Events
Time - Elapsed game time is 30.00 seconds
Conditions
Actions
Unit Group - Add Recruitment Center 0203 <gen> to conflictterritory[2]
Unit Group - Add Recruitment Center 0204 <gen> to conflictterritory[2]
Unit Group - Add Recruitment Center 0220 <gen> to conflictterritory[2][/gui]


Other Trigger
Events
Time - Every 5.00 seconds of game time
Conditions
Actions
Game - Display to (All players) the text: (String((Number of units in conflictterritory[2])))

In game, I keep getting 0. It only works for the first group but any other array returns 0. In the original trigger 12 groups were created via the first trigger's method, and all returned 0 except the [1]
 
Level 23
Joined
Oct 20, 2012
Messages
3,075
It's displaying zero because the three recruitment centers aren't added to the group until after 30 seconds and your other trigger is displaying it every 5 sec right from the start..

  • Trigger 1
  • Events
  • Time - Elapsed game time is 30.00 seconds
  • Conditions
  • Actions
  • Unit Group - Add Recruitment Center 0203 <gen> to conflictterritory[2]
  • Unit Group - Add Recruitment Center 0204 <gen> to conflictterritory[2]
  • Unit Group - Add Recruitment Center 0220 <gen> to conflictterritory[2]
  • Trigger - Turn on Other Trigger
and make the other trigger not initialy on
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
maybe its because the group is not created(its null)
remember, arrays will not initialize themselfs and before you give them value they are null
put custom script - set udg_conflictteritory[2] = CreateGroup or try using some GUI functions but I dont know if there is set group = empty unit group but if there is you can use that too
 
Status
Not open for further replies.
Top