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

[Solved] Variables aren't set?

Status
Not open for further replies.
Level 15
Joined
Sep 27, 2009
Messages
669
What's wrong with my triggers??
I made 6 regions in "Forest" and triggers are supposed to do this:
-Every 3 seconds pick all units owned by p12 in Z1 and order picked unit to move-attack random region 1-6... But it's not working good ...
  • Set R
    • Events
    • Conditions
    • Actions
      • Set FRegions[1] = F1 <gen>
      • Set FRegions[2] = F2 <gen>
      • Set FRegions[3] = F3 <gen>
      • Set FRegions[4] = F4 <gen>
      • Set FRegions[5] = F5 <gen>
      • Set FRegions[6] = F6 <gen>
  • Order 1
    • Events
      • Time - Every 3.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in Z1 <gen> owned by Player 12 (Brown)) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack-Move To (Center of FRegions[(Random integer number between 1 and 6)])
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
And what exactly "isn't working good"?

If they always move to the same region, then go to File -> Preferences -> Test Map and turn off "Fixed Random Seed".
If they don't move at all, try debugging the trigger by adding game messages (inside the group show the unit name of the picked unit, the random integer etc).

Also:
  • Order 1
    • Events
      • Time - Every 3.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in Z1 <gen> owned by Player 12 (Brown)) and do (Actions)
        • Loop - Actions
          • Set loc = (Center of FRegions[(Random integer number between 1 and 6)])
          • Unit - Order (Picked unit) to Attack-Move To loc
          • Custom script: call RemoveLocation(udg_loc)
 
Status
Not open for further replies.
Top