# Feature probability is invalid

## Recommended Posts

If I set an effect on an item with what I would think to be a 1% chance - the probability from, say 40 to 40 (it triggers on a 40 rolled on a d100), DLTCEP gives me the above message. Is it really the case? Because if I wanted to have 100 different 1% effects, either there aren't enough numbers to go around or I'd have to overlap (40 to 41, 41 to 42 etc.).

0-100 is 100%

0-1 is 1%

-->

1-100 is 99%

reiterate.

##### Link to post

Ok, so I would have to overlap numbers? I always thought it'd be 0-24, 25-49, 50-74, 75-100 if I wanted a 1 in 4 chance for different effects.

##### Link to post

Well, think of the high value as 1d100 values go (1-100) and subtract one for the low values (0-99).

0-1 and 1-2 don't overlap.

0-1 is 1%

1-2 is another 1%

no room for overlap.

0-2 would be 2% entirely covering the previous 2.

0-0 is not happening

1-1 is not happening

You could fill your effect block with 0-0, 1-1, ... 100-100, and you wouldn't see a damn effect happening.

I know it is difficult to comprehend 0 based counting, but computers are like that.

##### Link to post
Well, think of the high value as 1d100 values go (1-100) and subtract one for the low values (0-99).

0-1 and 1-2 don't overlap.

Well I did some pretty extensive testing and that doesn't seem to be the way it works, unless I'm still not understanding something.

I made an item that has a bunch of different effects and set them all up this way. So for example, from probability 26-32, it inflicts disease. From 32-39 it inflicts blindness. According to your definition, there should not be an overlapping chance to get both - but I've managed to do it, presumably on a roll of 32. And since all the effects were set up this way, I've managed to get an overlap where I get hit with 2 effects fairly frequently.

Edit:

Moreover, I made a test item that stacked a bunch of effects with 0-0, 1-1, 2-2 probability etc. I got some of them to fire, disproving this:

0-0 is not happening

1-1 is not happening

You could fill your effect block with 0-0, 1-1, ... 100-100, and you wouldn't see a damn effect happening.

So maybe you need to disable this error message .
##### Link to post

Interesting, but this means either a 1,1 is the same as 0,1, or 100,100 doesn't work.

Or 1,1 is not 1% but 1/101.

##### Link to post

Hmm, well it might take a while to prove whether 100-100 works. I guess I could script my guy to continuously use an item with unlimited charges...

##### Link to post

Maybe Taimon knows the answer

##### Link to post
Hmm, well it might take a while to prove whether 100-100 works. I guess I could script my guy to continuously use an item with unlimited charges...
So I did this and let it rip in the background for about an hour. I've gotten the 0-0 message 4 times, the 1-1 message 8 times and the 100-100 message a total of zero times. This strongly suggests that on a percentile basis, 0 = 1, 99 = 100 and 100 is not a valid value.

Incidentally, when you create an item with zero charges, it makes it unlimited charges for all practical purposes, but also creates an occasional bug that creates 65535 copies of the item in one stack (weighing several tonnes for a 1lb item). Is this a known issue? Maybe it's related to the bugs with "unlimited" stacking/bags of holding components (I don't have those installed, but folks have reported similar things).

Also, as long as I'm reporting weird random stuff I'm not completely sure of, is it just me or does UseItem only work for certain items, like potions? I tried making the test item a wand at first and it did nothing in scripting until I changed it to a potion.

##### Link to post

The game checks for (rand <= prob1) && (rand >= prob2) with rand in range 0-99.

##### Link to post

This should probably be fixed in DLTCEP so there isn't an "invalid probability" message when setting an effect from 0 - 0, 1 - 1 or whatever (because it will fire 1% of the time in such cases, unless you choose 100 - 100 as 100 is not a valid die roll).

However, we made an interesting discovery in BG1 (with and without TotSC). I'm not sure if this is known but it doesn't appear to be documented anywhere. The engine either pretty much ignores probabilities or it causes bugs at best. If, for example, you have an item with staggered effect probabilities from 0-33, 34-66, 67-99 or even 0-4, 5-9, 10-14, all three effects will fire regardless. I think I have seen only 2 fire, but never just 1 or 0. It is perhaps not surprising that there are no such items in the vanilla game (except slimed2.itm and sw1h99.itm, both unused).

##### Link to post

As far as I know, BG1 has only one probability field.

And back to the original issue, so, if i understand this correctly, 0-1 is 2%.

And 0-99 is exactly the same as 0-100.

##### Link to post
However, we made an interesting discovery in BG1 (with and without TotSC). I'm not sure if this is known but it doesn't appear to be documented anywhere. The engine either pretty much ignores probabilities or it causes bugs at best. If, for example, you have an item with staggered effect probabilities from 0-33, 34-66, 67-99 or even 0-4, 5-9, 10-14, all three effects will fire regardless. I think I have seen only 2 fire, but never just 1 or 0. It is perhaps not surprising that there are no such items in the vanilla game (except slimed2.itm and sw1h99.itm, both unused).

I have been aware of the example you use since I began working on FotD. I think Ghreyfain explained to me a long time ago how it actually works. You cannot make the effects mutually exclusive because prob2 has to be 0 but you can still add some random element. . If you want a spell that improves AC by 1D4, make four AC +1 effects with probabilities 0-25, 0-50, 0-75 and 0-100.

##### Link to post
And back to the original issue, so, if i understand this correctly, 0-1 is 2%.

And 0-99 is exactly the same as 0-100.

Correct.
I think Ghreyfain explained to me a long time ago how it actually works. You cannot make the effects mutually exclusive because prob2 has to be 0 but you can still add some random element. . If you want a spell that improves AC by 1D4, make four AC +1 effects with probabilities 0-25, 0-50, 0-75 and 0-100.
Interesting... doesn't help much for what I wanted to do though, which was have separate random effects. I just worked around it using a sort of averaging that will have to suffice for the BG1 engine.
##### Link to post

Ok, it will allow equal min and max values from now.

#### Archived

This topic is now archived and is closed to further replies.

×
• Website