Percentage variable going into negative figure while using fairmath?

As far as I’m aware when using fairmath it is meant to be impossible for a stat to drop below 0 but someone has managed to get one of his stats to -2. I’ve searched all my files and the stat in question is only ever increased %+ or decreased %- apart from the occasion when it is created (as 100) and for a check when the player checks the stat screen when it is meant to set the stat to 100 if it it greater or to 10 if its less than 0 but afaik isn’t fairmath meant to prevent it from dropping below 0?

1 Like

It is.

I know this sounds silly, but check your files again looking for “-”
It’s all to easy to miss a % at a *set

1 Like

I’ve checked for all *set condition which is the variables and here are all that show up. I’ve looked over several times and can’t see it :frowning:

*set condition %-50
*set condition %+10
*set condition %-10
*set condition %+25
*set condition %+25
*set condition %+25
*set condition 100
*set condition 10
*set condition %+10
*set condition %-10
*set condition %-10
*set condition %-10
*set condition %-10
*set condition %-10
*set condition %+25
*set condition %-10
*set condition %-10
*set condition %-15
*set condition %-10
*set condition %-10
*set condition %+25
*set condition %-10
*set condition scondition
*set condition %-10
*set condition %-15
*set condition %-15
*set condition %-10
*set condition %-15
*set condition %-10
*set condition %+25
*set condition %-10
*set condition %-10
*set condition %-10
*set condition %-10

1 Like

When is this used, and how is scondition set?

1 Like

that is in the save file. it set scondition as the same score as condition at the end of every episode

1 Like

In that case, can we assume they are using a modified file?

1 Like

Thats what I’m starting to think but their stats don’t seem to suggest modded files they seem normal?

1 Like

When you searched for all your *set condition commands, were you searching with notepad++ in all opened documents? Makes it really easy to find all instances of whatever.

1 Like

yeah the results are what i posted earlier

2 Likes

I assume you did a playthrough to see when it changes?

1 Like

thats next on my list. Just running randomtest first.

1 Like

I’d argue that a -2 stat that’s only ever adjusted with fairmath seems distinctly abnormal.

That aside, has your player been able to repeat the error? Can you ask them which options they’re choosing, to attempt to replicate the error with your own version of the game? Could you outright ask your player if they’re playing a modded version? Without, in the process, tanking whatever relationship (working? friendship? other?) you’ve established with them?

Also, what did their error message say? Here’s why I ask:
fairmath_error
This is what happens when you try to apply a fairmath operation to a value that’s already outside the 0-to-100 range. You might be able to narrow down the location of the error (assuming said error actually exists, and hasn’t been artificially introduced via modding) if you can get the text of the error message from your player.

1 Like

What were you doing when the error occured?

Error: line 116: Can’t fairAdd to non-percentile value: -2

thats what the error message is. but all the changes to the stat are either fairmath or specifically set as you can see in my earlier post.

edit: I’ve asked the person who reported the error whether they have modded the game at all and if they haven’t if they can replicate the error an make a note of their choices to try and narrow it down a little.

edit 2: just noticed the saved variable for condition (scondition is 1) so at the start of episode six they had their condition at 1 which means at some point their condition goes from 1 to -2 via fairmath which makes no sense.

1 Like

Yeah, that really shouldn’t be possible. I hope your player replies soon!

1 Like
*temp status 0
status = ${status}

*set status %-100
status = ${status}

This results in the 0 being changed to a 1, even if you use extremes like %-100.

1 Like

hmm noticed one that one site that does mods one of them is supposed to make sure condition never decreases so maybe that is it? I’ll wait to see what the person says to me.

edit: his reply was he’d check it out so we’ll see what happens.

2 Likes

@jasonstevanhill @dfabulich

Should an error like this crash randomtest? because I ran randomtest 20,000 times and it doesn’t crash at all.

edit running it 100,000 times already passed 32,000 tests and no errors…

This could be one of those cases where someone’s using a hacked version of the game.

1 Like

When I asked if he modded the game he hasn’t said he did. He is just trying to replay it.

Update randomtest has passed 40,000 tests and still no error.

Update 2 randomtest passed 60,000 tests and never found the error. This is starting to look more like a hacked version. So I’m moving onto a different bug before I get depressed

1 Like