It is currently Wed Oct 15, 2008 3:17 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Treasures Loot. Need help.
PostPosted: Sun Aug 26, 2007 8:21 pm 
Offline

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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 27, 2007 9:51 am 
Offline
User avatar

Joined: Sat Feb 04, 2006 8:17 am
Posts: 146
Location: Illinois, USA
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.

_________________
2nd place is the 1st loser.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 27, 2007 4:21 pm 
Offline

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 561
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:
//  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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 28, 2007 3:02 pm 
Offline

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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 28, 2007 5:34 pm 
Offline

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1154
Location: Southern Central USA
Welcome to the world of computers!

I think sometimes computers really do have a mind of their own.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 28, 2007 6:13 pm 
Offline

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 561
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 28, 2007 7:27 pm 
Offline

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1154
Location: Southern Central USA
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.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 28, 2007 8:47 pm 
Offline

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

=)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 04, 2007 8:25 pm 
Offline

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1154
Location: Southern Central USA
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.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl