Giter VIP home page Giter VIP logo

Comments (7)

krmbn0576 avatar krmbn0576 commented on July 23, 2024

RMMV recalculates the new stat value (after equipment change) to be as close to the previous percentage as possible

I tried testing the same situation.
However, after changing the equipment, HP/MP were simply clamped between 0 and the max value.

I'm sorry but I don't know what situations you are concerned about. 😖

from corescript.

niokasgami avatar niokasgami commented on July 23, 2024

Did you tried without yanfly plugins?

from corescript.

Mkneeshaw avatar Mkneeshaw commented on July 23, 2024

It has nothing to do with yanfly scripts. Its how the core script handles the data type.

If we simply round the value before displaying it, we should be able to keep the float for calculations, but still display the value we would like to display. The bad part is that it doesn't look like RMMV differentiates between calling the HP for a calculation and calling it for a display value, so we would have to write a new method .paramUnrounded that returns the unrounded version whenever a calculation is to be done, and then allow it to use the original rounding for display calls or we could do the opposite. It really depends on if there are more calls for calculation or display.

from corescript.

Mkneeshaw avatar Mkneeshaw commented on July 23, 2024

Clamp just keeps the HP value between 0 and Max which we obviously want to do. I assume it didn't round since most clamping functions don't. If a player has full health and unequips and then reequips they can lose or gain 1hp from the rounding error. I can show the problem in defualt/no plugin screenshots if it will help.

from corescript.

Mkneeshaw avatar Mkneeshaw commented on July 23, 2024

/**

  • Returns a number whose value is limited to the given range.
  • @method Number.prototype.clamp
  • @param {Number} min The lower boundary
  • @param {Number} max The upper boundary
  • @return {Number} A number in the range (min, max)
    */
    Number.prototype.clamp = function(min, max) {
    return Math.min(Math.max(this, min), max);
    };

Champ is not rounding

from corescript.

niokasgami avatar niokasgami commented on July 23, 2024

as I said stop assuming,
before claiming a bug you should be able to reproduce it without any plugins or with a newer projects.
if they have plugins in it this not the responsability of the oss to find why it's bug with the said plugins.

as I said try to reproduce it with a fresh project without ANY plugins.
if it's doesn't bug without plugins, then it's a plugin bug. if you can reproduce without the plugins the said bug. then OSS will fix it.

from corescript.

Mkneeshaw avatar Mkneeshaw commented on July 23, 2024

You are correct. I'll be more careful claiming a bug in the future. Thanks for checking into it.

The problem still exists in the original game, but equipping/unequipping hp items simply doesn't attempt to keep the same %. I had realized the original scripts use the same hprate function that Yanfly uses, but failed to realize you never use it for equipping. You only use it for 2 purposes: 1. confitional branch (is actor hp between x/y) and 2. to confirm if the actor is alive for combat conditions. I can't think of a possible issue with rounding in those two instances where we would need a float over an int.

from corescript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.