gambitben

Veteran
Veteran
Joined
Jun 8, 2013
Messages
171
Reaction score
137
First Language
Spanish English
Primarily Uses
RMMV
How would I reference the variables for a reseted skill? I'm not a super advanced javascript user :rswt
 

SomeFire

Veteran
Veteran
Joined
May 27, 2016
Messages
129
Reaction score
138
First Language
Russian
Primarily Uses
How would I reference the variables for a reseted skill? I'm not a super advanced javascript user :rswt
Replace this function
Code:
SkillTreesSystem.resetSkillTree = function(actor, tree) {
    let points = 0;

    for (let skill of tree.skills) {
        if (!skill || skill.type !== "skill" || skill.level === 0)
            continue;

        for (let i = 0; i < skill.level; i++) {
            for (let req of skill.reqs[i]) {
                if (req.type === "points")
                    points += req.price;
            }

            if (!skill.learnActions || !skill.learnActions[i])
                continue;

            for (let learnAction of skill.learnActions[i]) {
                if (learnAction.type === "game_variable") {
                    let oldVal = $gameVariables.value(learnAction.varId);

                    $gameVariables.setValue(learnAction.varId, oldVal - learnAction.inc)
                }
            }
        }

        skill.forget(actor);
        skill.level = 0;
    }

    tree.points = 0;

    actor.refresh();

    return points;
};
 
Last edited:

gambitben

Veteran
Veteran
Joined
Jun 8, 2013
Messages
171
Reaction score
137
First Language
Spanish English
Primarily Uses
RMMV
Works like a charm, thank you! If I could like this post five times I would ;D
 
Last edited:

Frostorm

[]D[][]V[][]D
Veteran
Joined
Feb 22, 2016
Messages
2,370
Reaction score
1,985
First Language
English
Primarily Uses
RMMV
Hey @SomeFire, is it possible for one tree to be wider than another tree? Like if an actor has 3 trees, but I want 1 of those trees to have/show more skills in the row. In referring to this parameter:
1639039477086.png
I basically need the 1st tree to show 11 skills in a row instead of 7.
 

SomeFire

Veteran
Veteran
Joined
May 27, 2016
Messages
129
Reaction score
138
First Language
Russian
Primarily Uses
It requires some coding. You need to replace usages of SkillTreesSystem.skillWindowMaxCols and SkillTreesSystem.skillWindowDrawCols by condition with your tree. For example:
Code:
Skills_Window.prototype.maxCols = function() {
    return SkillTreesSystem.skillWindowMaxCols;
};
Skills_Window.prototype.maxCols = function() {
    if (this._tree != null && this._tree.symbol == `SymbolOfYourSpecificTree`) {
        return 11;
    }
    return SkillTreesSystem.skillWindowMaxCols;
};

Skills_Window.prototype.windowWidth = function() {
    return this.itemWidth() * SkillTreesSystem.skillWindowDrawCols + this.standardPadding() * 2;
};
Skills_Window.prototype.windowWidth = function() {
    if (this._tree != null && this._tree.symbol == `SymbolOfYourSpecificTree`) {
        this.itemWidth() * 11 + this.standardPadding() * 2;
    }
    return this.itemWidth() * SkillTreesSystem.skillWindowDrawCols + this.standardPadding() * 2;
};
 

Latest Threads

Latest Profile Posts

Micro rant. The worst part of working from home when you live with your family is seeing how inconsiderate they are. "Hey, you're sitting in front of your computer, that means you're not doing anything! I want to put the TV at 200 decibels!"

If I was working in the office would you still talking me like that?
It's definitely discouraging when streamers give a try-to-say-it-nicely (i.e. bad) review of your game demo. It's like jumping into a cold pool. Bad initally, but it gets better with time. And you are now more alert and see better.
Some screenshots of the pub and lodging with the beginnings of clutter taking shape
TTp8uCw.png

jtC202e.png

bSXgyVl.png

eRx9PUF.png
Backgrounds are not my strong suit... :kaodes:
DazI8jt.jpg

Just realized I forgot doing the clouds... woops
Went to get some stuff for February 10, the birthday of my favorite ink monster...
I have a little one-person party for Bendy every year, complete with the life-size plushie I made. And yes, I bake a birthday cake!

Forum statistics

Threads
118,500
Messages
1,116,422
Members
155,498
Latest member
Neocops
Top