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

[Trigger] Random generator WILL NOT WORK Help!

Status
Not open for further replies.
Level 2
Joined
Feb 12, 2010
Messages
7
My random generator WILL NOT WORK, and i cant figure out why! Every time i start the game the tower is put into the exact same spot. Can someone please help me?

I want the tower to go into a random spot, in a random region between 1 and 14. each region can hold 4 towers if it needs to.

i have another script that has the code set randomRegion[1] = Region1 from region 1 to region 14, so thats where the randomRegion variable is coming from.

Thanks
 

Attachments

  • AHHHH.jpg
    AHHHH.jpg
    133.5 KB · Views: 140
Level 6
Joined
Jan 31, 2009
Messages
166
Are you testing via World editors Test map? When you do this the world editor automatically uses the same random number seeds every time. To fix this eather play the game normaly through wc3 online or offline or go to Preferences - Test map and un check used fixed random seed. btw your trigger Leaks.

Hope that helps
 
This is kinda messy for no reason.
  • Trigger1
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set Regions[1] = Region 000 <gen>
    • Set Regions[2] = Region 001 <gen>
    • Set Regions[3] = Region 002 <gen>
    • Set...
  • Trigger2
  • Events
    • Time - Elapsed time is 0.20 seconds
  • Conditions
  • Actions
    • Set Locs[1] = (Player 1 (Red) Start Location)
    • Set Locs[2] = (Center of (Regions[(Random integer number between 1 and 3)]))
    • Unit - Create 1 Jake for Player 1 (Red) at Locs[1] facing default building degrees
    • Unit - Create 1 Jake bounty tower for Player 1 (Red) at Locs[2] facing default building degrees
    • Custom script: call RemoveLocation (udg_Locs[1])
    • Custom script: call RemoveLocation (udg_Locs[2])
 
Status
Not open for further replies.
Top