Random number generator? |

Does anyone know if there is a value that can be used in formulas to generate a random number in a specific range? I looked through the MainStrings.txt but could have easily missed something.

Random number generation
There is a Random(A, B) function that returns a random number between A and B. To see an example, take a look at Formulas.txt where it generates the values for a planet's gravity, temperature and radiation.

Careful
Just be careful where you use it, I don't think components/vehicle sizes are good places for example. (I'd love it if there were some way to incorporate it into weapon damage, but ATM it looks like the game processes the random command once and once only, probably during the game creation, and we know that it only reads and calculates formulas as save game load/game creation).
edit:
If what you need is a WEIGHTED random roll, just set it to a large range and give the higher weights more "values" with an iif statement.
There are 10 types of people in the world:
Those that understand binary, and those that don't.

I noticed that there is a
I noticed that there is a tonnage notation on the warp points, I haven't checked yet, but it seems to me that this indicates some warp points could have a max ship size it would let through. You might be able to have this max tonnage fluctuate also... cool.




Hrm...
I don't think yo'ure going to find that. What do you want it for? Most places I can think of where it might be useful, the game isn't exactly set up very well to use it.
There are 10 types of people in the world:
Those that understand binary, and those that don't.