Treasures Loot. Need help.

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Equiii
New User
Posts: 3
Joined: Sun Aug 26, 2007 8:08 pm

Treasures Loot. Need help.

Post by Equiii »

Hi, i have a problem with treasures loot.

i have something like this in nlootgroup.cfg

lootgroup 9 //level5map
{
Random 1d4+1 Circle8Scrolls
Stack 10000 GoldCoin
Random 2d10+99 Reagents
Random 10 NormalEquipment
Random 1d4 Treasures5
}

And always "Random 1d4" gives me 1 item.
Thats the problem, it´s like "1d4" doesn´t work.

And "Random 2d10+99" gives me 3 mandrakes, 8 spidersilk... doesn´t work to...



Any Answer?

PS: i apologies for my english :oops:
User avatar
Tritan
Grandmaster Poster
Posts: 147
Joined: Sat Feb 04, 2006 8:17 am

Post by Tritan »

What script set are you using?

It would help to post you script that you think you are having problems with.

It sounds to me like the script is not calling the proper function to get the amount.
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Post by OldnGrey »

I looked up a few different sets of scripts and there are several ways of doing these files.

This is in the 095 distro for example:

Code: Select all

//  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.
Equiii
New User
Posts: 3
Joined: Sun Aug 26, 2007 8:08 pm

Post by Equiii »

EDIT: wait, i still understanding XD

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!


Thanks for the help!
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post by Yukiko »

Welcome to the world of computers!

I think sometimes computers really do have a mind of their own.
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Post by OldnGrey »

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.
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post by Yukiko »

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.
Equiii
New User
Posts: 3
Joined: Sun Aug 26, 2007 8:08 pm

Post by Equiii »

Yeap, i talk to a guy who was doing the same does i, and he said that maybe pol doesn´t work bery good when the random has low numbers.

he recommended me to use something like 25d40 and others convinations to see if it´s works or not.

=)
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post by Yukiko »

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.
Post Reply