The Random Generator.

TaCoChris

New Member
Reaction score
1
Hey guys.

I use the random generator right now.
Trigger:
  • Set BjarneBeeInt[1] = (Random integer number between 1 and 10)


But im not sure if its the numbers 1,2,3,4,5,6,7,8,9,10 or just 1,2,3,4,5,6,7,8,9?
I've putted a trigger to active if the number hits 10, but it never happens.

I use this random to get %. So 10% chance to trigger.
- It would fail if it was 1/9 instead of 1/10.

- Chris

Is the last number included?
 

krainert

Member
Reaction score
10
Actually including the first and not the last would be a rational choice on the grounds that it'd be the simplest way to divide a range into intervals (from a computer science perspective). Anyway, Warcraft DOES include the upper bound as a possible value. You've probably fallen victim to fixed random seed (there should be a setting for it somewhere in the editor) ;)
 

staind25

TH.net Regular
Reaction score
7
A little off the purpose of the topic, but if you think about it, the way the action is worded is rather misleading. It says "between", which should make you think not including 1 and 10. Confused me when I first saw it.
 

TaCoChris

New Member
Reaction score
1
A question to the " Used Fixed Random Seed ".

What's the cons/pros for have that checked?

- And yes, i though too it would be stupid not to include, but it would be wrong to say 10% chance to hit, if the chance was 1/9 instead of 1/10.

Thanks for your answer!
 

Ryushi

"I will stand, or I will fall. I will not sit."
Reaction score
59
The only reason you would use the Fixed Random Seed is if you want to have the same random numbers generated every time you test the map. If you don't need this, then leave it unchecked to get different random numbers.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top