[Trigger] Random generator WILL NOT WORK Help!

Status
Not open for further replies.

Chikokishi

C

Chikokishi

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: 192
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])
 
I cant find the preferences, but i did run it in warcraft and it worked fine. Thanks!
 
Status
Not open for further replies.
Back
Top