This error message is confounding me. I’ve spent an hour trying to figure out what’s wrong.
So I have all my supporting characters with variables showing the relationship with the MC. They all start at 25.
In startup:
*create stunner 25
Then later in the game I have a choice that affects the MC’s relationship with him, resulting in the following code on line 256.
*set stunner %-30
When I run Randomtest, I get this message
line 256: Can’t fairAdd to non-percentile value: 0
Does anyone have any idea what’s wrong? The stunner variable should be exactly the same as alllll the other characters but he’s the only one that gives me this message and it’s preventing me from running a full Randomtest
Well I found one mistake where I had typed *set stunner -30% in an earlier scene but the tests still give me the same error on line 256. I’m double and triple checking the other *set stunner commands. Again, I appreciate the help. Hopefully there’s one more goof hiding somewhere.
@gkkiller, Thanks! that’s what I’m checking for after work today. I’ve been shift f ing everything to do with stunner and I -have- to find the problem because its jamming up randomtest until it’s fixed.
It’s most likely referencing that line because the value went above 100 or below 0 somewhere beforehand, and using fairmath during those instances will result in error. Try checking to make sure you didn’t set the variables outside the 0-100 range and didn’t use any fixed additions/subtractions that could have made the value less than 0 or greater than 100.
Edit: From my knowledge, the automated tests only reference the line where the error occurs, I.e. the spot where the variable is being fairmath’d outside the percentile range, and doesn’t tell you the specific point in which the value actually falls outside that range.
Does fairmath only work with the %+ separated from the number by a space?
I ask because I recently received the same error as in the OP, and reading through this thread has me realizing that the fairmath ChoiceScript wiki page actually has fairmath as:
*set beauty %+ 5
…Whereas I’ve been using
*set beauty %+5
And I never caught on because I’ve never had any errors until now, the game has been running just fine that way and has indeed been changing the variables! However, I am awful at math and didn’t bother checking if the fairmath calculations were actually right… Does it actually work without the space, or have I actually not been using fairmath this whole time lmao?
Reviving this again to say: my readers keep getting persistent Can’t FairAdd errors whenever their values go over 100. A lot of this has turned out to be save plug-in stuff (storing and saving variables that end up adding to over 100), but some errors aren’t resolved by clearing the web cache and starting over fresh.
However, I was under the impression that using fairmath meant it was literally impossible to go over 99, so I’m baffled for why my stats keep going over 100, resulting in the error. (The choices that produce the error also use fairmath.)
Does anyone have any ideas what could be causing this? Is it possible that mixing types of stat changes (sometimes +1 strength, other times +%5 strength) could cause this?