Indeed, it's the users fault if they don't check their changes.
Like Renegade said, check the crates. They have a weighting that adds up to 110.
On that note, use integers just like for crates. Floating point numbers are horrible horrible horrible.
With the system I descibe below, it works just like crates except there is no set 'total' number of 'probability units'.
Each country should have a value RandomChance=Integer
The default would be 1.
To give, say, Germany a double chance of getting picked at random, the modder would have to set RandomChance=2 for Germany.
To give, say, Germany, a 1.5x chance of getting picked, multiply to get integer value:
RandomChance= (1.5 * 2) = 3 (Germany)
RandomChance= (1 * 2) = 2 (other countries)
To give Germany AND Russia a 1.5x chance of getting picked (when compared to ''normal'' chance),
RandomChance= 3 (Russia/Germany)
RandomChance = 2 (other countries)
Note that this system gives a RELATIVE liklihood, just like for Crates. The actual probability still works though, because whilst one country increases it's liklihood, the other countries decrease.
This way, there's no chance of the user getting the wrong number (they just have to be sure to use integers).
With a probability maximum like the crates, you can't ensure that the chance for each country will be equal (eg. 100 probability units divided by 11 countries, if the user has added one).
In this system, there is no maximum and the default value of 1 can be applied to any number of countries so that modders who add countries but want the random chance to be the same do not need to do anything.
I suppose that with the above system you could use RandomChance=Float - it would make things simpler for modders.
And if you want sides rather than countries to have stronger weightings, just give each country on that side the same boost.
Like Renegade said, check the crates. They have a weighting that adds up to 110.
On that note, use integers just like for crates. Floating point numbers are horrible horrible horrible.
With the system I descibe below, it works just like crates except there is no set 'total' number of 'probability units'.
Each country should have a value RandomChance=Integer
The default would be 1.
To give, say, Germany a double chance of getting picked at random, the modder would have to set RandomChance=2 for Germany.
To give, say, Germany, a 1.5x chance of getting picked, multiply to get integer value:
RandomChance= (1.5 * 2) = 3 (Germany)
RandomChance= (1 * 2) = 2 (other countries)
To give Germany AND Russia a 1.5x chance of getting picked (when compared to ''normal'' chance),
RandomChance= 3 (Russia/Germany)
RandomChance = 2 (other countries)
Note that this system gives a RELATIVE liklihood, just like for Crates. The actual probability still works though, because whilst one country increases it's liklihood, the other countries decrease.
This way, there's no chance of the user getting the wrong number (they just have to be sure to use integers).
With a probability maximum like the crates, you can't ensure that the chance for each country will be equal (eg. 100 probability units divided by 11 countries, if the user has added one).
In this system, there is no maximum and the default value of 1 can be applied to any number of countries so that modders who add countries but want the random chance to be the same do not need to do anything.
I suppose that with the above system you could use RandomChance=Float - it would make things simpler for modders.
And if you want sides rather than countries to have stronger weightings, just give each country on that side the same boost.
Ever wondered what the hell is going on?
Believe me friend you're not the only one.
--Lysdexia
Check out Launch Base for RA2/YR - http://marshall.strategy-x.com
Also home to the Purple Alert mod, 1.002 UMP, and the YR Playlist Manager.
Believe me friend you're not the only one.
--Lysdexia
Check out Launch Base for RA2/YR - http://marshall.strategy-x.com
Also home to the Purple Alert mod, 1.002 UMP, and the YR Playlist Manager.