RPG Maker Forums

So, I am using and potentially adapting Bobstah's custom stat script to use for my game.  Thank you Bobstah for all your hard work.  I'm having trouble getting it to function how I want.  I believe it will already do the first part of what I would like, but I am unable to get it to work.  Here is the part of code that I am trying to figure out if I need to change.


Bobstah.CustomStats.defineStat = function(name, percent) {
    var newObj = Bobstah.CustomStats.statList[name] = {
        'name': name,
        'percent': percent
    };
    if (typeof(Bobstah.CustomStats[name]) === "undefined") {
        Bobstah.CustomStats[name] = newObj;
    } else {
        if (Bobstah.CustomStats[name].percent !== percent) {
            console.warn("Conflicting percentage information for "+name+"!");
            Bobstah.CustomStats[name].percent = true;
        }
    }
};


Bobstah.CustomStats.createStatNode = function(baseValue, op, evl, percent) {
    if (op === "-") {
        op = -1;
    } else {
        op = 1;
    }
    evl = evl || false;
    percent = percent || false;
    var obj = {
        'baseValue': baseValue,
        'eval': evl,
        'modifiers': {},
        'modifier': 0,
        'percent': percent,
        'op': op
    };
    return obj;


What I am gathering from this, is that it will not allow the first definition of a variable to be anything other than a whole number.   I have a computation I want it to do, but I don't remember the function to get JavaScript to only value it as a whole number and not a humongous decimal.  What I am wondering, is this only allowing for a whole number to be put in and cannot use an evaluation to determine the stat, such as str=$(a.level / 3 + 12).

Latest Threads

Latest Posts

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,470
Members
137,821
Latest member
Capterson
Top