Bandages are now handled by JS and work here. Make shure your JS scripts, jse_fileassociations.scp, jse_objectassociations.scp, jse_typeassociations.scp and DFNs are all up-to-date.
Imagine my surprise when I suddenly died of heart failure after my first bandage use! I was curious. So I met a wandering healer that ressed me, and I applied bandages again.....and BAM sure enough I died!
I wish I had my scripts with me, but the error seemed to be in the statement at the bottom where the health was calulated:
Imagine my surprise when I suddenly died of heart failure after my first bandage use! I was curious. So I met a wandering healer that ressed me, and I applied bandages again.....and BAM sure enough I died!
I wish I had my scripts with me, but the error seemed to be in the statement at the bottom where the health was calulated:
Technically Heal() should only be a positive, however that would me most easily done with using a UI16 instead of SI16. But Maarc may have wanted it to be possible to pass a negative value, so best to check with him first.
As for the problem you got, stranf, it looks like what was happening is the number was too large (due to bad math by the JS Engine) and it was rolling that over into a negative when passed to the Heal() function.
While I anticipate that most calls to these functions will be positive, not negative, it doesn't imply that it should always be so. I'm sure people can envisage a time where they might want to do negative healing or damage (creatures of fire attacked with fire, in most RPGs, tend to be healed, or negative damage inflicted).
giwo's other idea is quite possible, too large causing a rollover ... but if that's the case, I'd have to wonder how it got so high. It would essentially have to rollover 32767! Given that the skills themselves probably can't go that high (unless Stranf had a char with > 2000.0 of helaing and anatomy?), I'd have to wonder why the numbers aren't coming out right.
As I noted, bad math by the JS Engine. Without telling it to parse to an int, it was (aparrantly) using a float, which for some reason was getting to 100,000 and even higher when I spit it to the Console. Notably this was with a character who had 0 healing, 0 anatomy.
I'm thinking maybe something due to converting float values to integers for the RandomNumber() call.
[EDIT]
RandomNumber() a Candidate for JSEncaps usage, anyone?