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

It's been a while since i posted so here's something i've been working on.
Game_Mockup7_6.png
Engine: RPG Maker VX Ace

I've decided to stop buying candy in supermarket and bulk buy 4.5kg of candy. The disadvantage of that is, now I eat a lot of candy. -_-
Microsoft has consumed Activision Blizzard. Makes me wonder if they're gonna make Blizzard Blizzard again.
HexMozart88 wrote on AphoticAmaranth's profile.
Your profile pic's face is my current mood.

Forum statistics

Threads
118,543
Messages
1,116,813
Members
155,579
Latest member
dignus93
Top