-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skill Calculation Error #115
Comments
Okay, this may take me a bit. Partly because it's complicated, and partly because I'm in the middle of converting the code to Laravel. Which will massively increase maintainability, and should massively reduce your save file size. Let me see what I can do really quickly though. Determining the final value is easy enough. That's done here. That calculation looks something like:
Now skill costs are calculated here. Importantly the total skill value for calculating costs looks something like:
We can see two things pretty clearly from this. First, there are a surprising number of bonuses that have to be managed under the hood to determine how much something costs. Second, if you have any bonuses from things like software or traits, those are applied after the amount of points put into the skill. That's because I couldn't find the correct answer to the order question in the rules and this is how the original creators did it years ago. That may seem to have been what was causing the problem. On the other hand, there is a logic error in this piece of code:
Modified to add constants instead of config values. Specifically, that second to last line should look like:
Fortunately, this is a relatively easy fix, so it shouldn't take long for me to test and deploy it. :) |
There's an error when calculating the costs for skills, and I've figured out exactly what's happening, but not entirely sure why. If a skill's total is 1-59, it calculates as normal, with it costing 1 CP per level in the skill. However, for a skill total of 60+, it counts it only as 1 CP for every skill point after 60.
For example, if you bring a skill to 65, the site only counts it as 5 CP being spent. Bringing the skill to 60 has the same effect as keeping it at a total of 0.
My theory for why this is happening is that perhaps an if-statement in the code has gone wrong? I'd guess you coded it so that it calculates differently for stats higher than 60, but maybe in detecting that you've caused it to ignore the first 59 points?
The text was updated successfully, but these errors were encountered: