Jump to content

Feature probability is invalid


Miloch

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.).

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 :party:.
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

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
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

Archived

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

×
×
  • Create New...