Okay, first, rounding is a new addition (added less than a month ago) so I don’t think many of us have really played with it too much. That said, what seems to be the problem? Are you hitting an error? If so, what is the error message (test the game in Internet Explorer for the proper error message). Is it just not rounding? Without knowing what’s actually going wrong, it’s hard to diagnose the error.
As a test, I tried this:
*set leadership 10 Set Leadership 10: ${leadership} *set leadership /3 Set Leadership /3: ${leadership} *set leadership round(leadership) Set Leadership Round(Leadership): ${leadership}
and everything seemed to work fine for me. Did you makes sure to reload the page (F5) each time you test the game? Your browser may be holding an old copy in memory and running that instead.
Two tips for checking things yourself: If everything seems to work fine, but the numbers are just wrong at the end, put a series of outputs after each line (like I did above), so that you can see where your numbers suddenly go wrong, and can narrow down the problem. If, on the other hand, everything keeps crashing, and you can’t figure out why, grab another copy of ChoiceScript and rebuild the chunk that may be crashing one line at a time (or at least a minimal number of lines at a time), running the game after each new line (or group of lines) is added, until the game crashes. Trying one of those will usually make it easier to isolate the problem, which makes fixing it a lot easier.
It rounds to the nearest integer, rounding 0.5 up to 1. If you always want to round down, you can subtract 0.5 from the number before rounding, like this:
As per the code, the strength modifier is equal to the strength score -10, then divided by 2.
Essentially a formula of x=(y-10)/2
If y=16 then,
x=(16-10)/2
Therefor x=3
If y=15 then,
x=(15-10)/2
Therefor x=2.5
If I change the formula to:
x=(y-10)/2-0.5 and y=15 then x=2 and round has nothing to round up.
If I change the formula to:
x=(y-10)/2-0.5 and y=16 then x=2.5 and round changes that to a 3, giving me the same result it would before the formula change.