Random Point In Region always the same?

Labmonkey123

New Member
Joined
Feb 22, 2008
Messages
3
Reaction score
0
I am making a map where there are a bunch of towers placed randomly along the map. After a few tests though, I noticed that each time the towers where placed at the same spots. Any help?
Place Units
Events
Map initialization
Conditions
Actions
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
Unit - Create 1 Scout Tower for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
 

ChrisH36

Guy with Most Posts on Quiet Board.
Joined
May 20, 2003
Messages
15,042
Reaction score
4
Location
Temple Prime, Sarajevo
It's strange, it couldnt be coincidence.

When you restart, do you hit the restart button? Or do you close the Wc3 and then retest the map?
What you could also do is this:

Have an integer variable and random a number between like 1 and 4. And another one to track the number of times this function is called.
Have 4 Regions or "Zones" as ninja said splitting the map into 4 parts.
If say 1 was drawn, create a scout tower at a random location at Region1. And do it as many times as
necessary. Adding 1 to the flag each time till a number is met (like check for calls < 15 or something).

The problem is, you might be using that playable map area spot.

Try that and see if it works. I know it works cause one campaign I have does this with a certian quest. It involved finding an item but it was never in the same spot each playthrough. This is my theory on how it was done. And I wish I could supply you with triggers and conditions, but I have a hard time piecing them together, even though I can do it logically.
 

Labmonkey123

New Member
Joined
Feb 22, 2008
Messages
3
Reaction score
0
yes, I was thinking of doing something like that, but warcraft random numbers are not very good. It uses premade things in the map that are always the same, so while you get a pretty random number but it is the same every time. I changed the idea of my map to work around this, but i might make the original one if i get a way around that problem.
 

ChrisH36

Guy with Most Posts on Quiet Board.
Joined
May 20, 2003
Messages
15,042
Reaction score
4
Location
Temple Prime, Sarajevo
Well, when you generate a random number, you need to specify a range. The problem is you will most likely get the same number, if the range is small. The other problem is it doesnt reset the numbers when the map restarts, which isn't a good thing to do. However, that is the second best idea.
 

NewPosts

New threads

Top