// NLOOTGROUP.CFG - Loot definitions
//
// Format:
// Stack {n=1} [ObjName] {color=0} {chancetospawn=100} Stacks the amount. DO NOT use on
// non-stackable items such as arms and armor! Use "Item" for those.
// Item {n=1} [ObjName] {color=0} {chancetospawn=100} include 1 of ObjName
// Random [n] [GroupName] {chancetospawn=100} pick n Items from GroupName randomly
// Group [GroupName] include GroupName too
// Unique [ObjName] don't give more than one
Notice that a line of
Random 1d4 NormalEquipment
would actually have around a 0% to 3% chance of creating something from the group NormalEquipment which is a list of equipment in the same file.
So if you are using a lootgroup system similar to that one, all you have been changing has been the chance to spawn, not the number it spawns.
lootgroup 7 //level3map { Random 2 Circle3Scrolls // gives me 2 random items from circle3scrolls group
Random 1 BoneArmor 0 2 // gives me 1 item random, from bonearmor group, with color=0, and chance to spawn= 2/100.
Stack 3000 GoldCoin // 3000 gold coins
Random 1d10+5 Reagents // gives me a number of regs, from regs group. it can be 6 to 15.
Random 8 NormalEquipment// gives me 8 random item form normalequipment group.
Random 1d3 Treasures3// and here's is my problem, i understand that this must be: 1 to 3 items sorted randomly, from treasures3 group(defined in same file).
But when i try if it works ingame, always gives me 1 item sorted randomly. Never 2, or 3.
}
mmm... i'm confused.
Edit 2: uufff.... well... now it´s works. it seems that only was bad luck.
i try 20 times, and always gives me 1 item, so i thought that something was wrong, but now, in 21 try, the loot was 3 items, so... it's WORKS!
I have the sneaking suspicion that the random number generator in POL favours the lowest number more than it should.
Eg randomInt(2) seems to give a lot more 0's than 1's.
Most of the time we run it once only to get a value, we don't run it 10 times to see how often a 0 occurs. Run it just once and you will get a 0 almost twice as often as a 1, or maybe that too is just my imagination.
It is important to remember too that there is no true random number generator algorithm. More properly they should be called "pseudo-random number generators".
Some are better than others and POLs is probably average to below average. It probably hasn't been looked at since Syzygy created POL. Maybe Shinigami could look into it and if need be add improving it to the POL 0.98 roadmap.
An update to the random number issue with smaller number ranges:
I found myself facing the same problem as you Equiii. I needed a random number in the range of 0 to 3. Using RandomInt I was getting mostly 0. I mean 20 times in a row I got 0 so I decided to give the RandomDiceRoll function a try and it is much better at generating smaller numbers it seems.