Customized Fighting Style System help

Greetings, apologies for the thread in advance, but I was in search of some help to figure out how to implement the concept in the title:

45506078-ll-exvs7kef-v4(1).png


Basically, in my project, the main mechanic revolves around the customization of the Class, since Characters have fixed weapons and armors (And only Charms as universal equipment to boost specific stats), starting from:
- The "Style", which determines the skillset used, combined with dedicated battler sprites.
- The "Role", which instead determines the types of skills within the Style skillset (Brawler has offensive skills, Support has healing skills, and Tank has defensive skills), and gives a Stat boost fitting the role chosen.
- and the "Race", which instead grants passive abilities through permanent states depending on the Character's race, also grants a Stat boost, but less than the role.

So far, It's kinda simple to set the "Skillsets" for the Styles, as well as the States for the Races. What I am struggling with is figuring out how to make sure skills within the same skillset show up when a certain role is chosen, and disappear when changed. It's true I could just allow the skills to show up and be used regardless of the Role chosen and simply consider the Stat change aspect of the Role, but at the same time kinda makes it feel less interesting, like, everyone can just be a tank regardless of stats, while I would like that Roles really puts a character to fulfill that role alone and allow the player to shape their combat experience by being able to choose whichever chars they want with the role they want and could best suit em, while also adding a bit of a challenge with the skills limited by the Roles.

Any idea on how to figure it out? Also, slightly related altho it's more a menu-wise issue, but...

1761324178998.png


Any way to make sure that "Role" and "Race" classes don't show up when choosing Styles, and Viceversa?

I'll gladly wait for Feedback, and thanks in advance.
VS Skill and States has <JS Skill Visible> that you can use to show/hide skills depending on your user's role.

For your second question, the notetag they seem to have for their Class Change plugin only makes the class not enabled for a tier, not hidden. You can go to the console and look at the Window_ClassList.prototype.makeCommandList method. Click on it and select 'pretty print'. At least I can see a loop where it before checks for 'getActorUnlockedClasses'. The last line in the loop is probably what adds the class into the list. There's also a method for actors .isClassChangeTierRestricted I guess you can try to play around with those and see if you can make it work by putting a conditional before the last line and guessing their messed up variables for actor and class. But it's annoying trying to get right, at least for me LOL, so good luck!


EDIT:

Hmmm, I felt the urge to try to make this work. I was looking at the wrong method, it's not isClassChangeTierRestricted (that's for actor restrictions). I made a quick test and seems I got it working by adding a conditional (the gibberish class reference will be different for you):

const availableTiers = DataManager.getClassChangeTiersOnly(_0x38d23b);
if (availableTiers.includes(this._tier))
VS Skill and States has <JS Skill Visible> that you can use to show/hide skills depending on your user's role.

For your second question, the notetag they seem to have for their Class Change plugin only makes the class not enabled for a tier, not hidden. You can go to the console and look at the Window_ClassList.prototype.makeCommandList method. Click on it and select 'pretty print'. At least I can see a loop where it before checks for 'getActorUnlockedClasses'. The last line in the loop is probably what adds the class into the list. There's also a method for actors .isClassChangeTierRestricted I guess you can try to play around with those and see if you can make it work by putting a conditional before the last line and guessing their messed up variables for actor and class. But it's annoying trying to get right, at least for me LOL, so good luck!


EDIT:

Hmmm, I felt the urge to try to make this work. I was looking at the wrong method, it's not isClassChangeTierRestricted (that's for actor restrictions). I made a quick test and seems I got it working by adding a conditional (the gibberish class reference will be different for you):

const availableTiers = DataManager.getClassChangeTiersOnly(_0x38d23b);
if (availableTiers.includes(this._tier))
First part I'm having difficulty figuring out the right "Code" for the JS Skill Visible, mostly I barely know any code and I struggle finding a guide to the various codes.
1761485371577.png


Regarding the second, I tried to open console, but:
1761484579922.png


Mostly I can't seem to find that thing in particular.
If I understood correctly you want to check your 2nd class. I haven't really dealt with that plugin, but I think you get the 2nd class id with user._multiclasses[1].
So it's user._multiclasses[1] === X // (replace X with class ID)
EDIT: So like

<JS Skill Visible>
visible = user._multiclasses[1] === X
</JS Skill Visible>

For the other question don't use search, but type the stuff in the console and press enter, the click on the function to get to the sources tab, choose pretty print, copy it to a notepad, add my two extra lines in the same spot where I've added them, save it as a .js file in your plugin folder and add it as a plugin under VisuStella. I have old version of the plugin, so your code is probably scrambled differently, so you need to copy paste it yourself, but the spot to add the extra lines is the same (also check where I picked the scrambled reference in the extra line and copy it from the same place):

Window_ClassList[_0x2e2dc8(0x1ab)][_0x2e2dc8(0x3e2)] = function() {
const _0x231d02 = _0x2e2dc8;
if (!this[_0x231d02(0x1d3)])
return;
if (this[_0x231d02(0x15c)] <= 0x0)
return;
const _0x45e88f = DataManager['getActorUnlockedClasses'](this[_0x231d02(0x1d3)]);
for (const _0x38d23b of _0x45e88f) {
if (!_0x38d23b)
continue;
let _0x1e1706 = _0x38d23b[_0x231d02(0x413)];
_0x1e1706 = _0x1e1706[_0x231d02(0x238)](/\x1I\[(\d+)\]/gi, ''),
_0x1e1706 = _0x1e1706[_0x231d02(0x238)](/\\I\[(\d+)\]/gi, '');
const _0x4d9cfb = this[_0x231d02(0x2ed)](_0x38d23b);
const availableTiers = DataManager.getClassChangeTiersOnly(_0x38d23b);
if (availableTiers.includes(this._tier))
this[_0x231d02(0x166)](_0x1e1706, _0x231d02(0x18d), _0x4d9cfb, _0x38d23b);
}
this[_0x231d02(0x15c)] > 0x1 && this[_0x231d02(0x166)]('', _0x231d02(0x18d), !![], null);
}
If I understood correctly you want to check your 2nd class. I haven't really dealt with that plugin, but I think you get the 2nd class id with user._multiclasses[1].
So it's user._multiclasses[1] === X // (replace X with class ID)
EDIT: So like

<JS Skill Visible>
visible = user._multiclasses[1] === X
</JS Skill Visible>

For the other question don't use search, but type the stuff in the console and press enter, the click on the function to get to the sources tab, choose pretty print, copy it to a notepad, add my two extra lines in the same spot where I've added them, save it as a .js file in your plugin folder and add it as a plugin under VisuStella. I have old version of the plugin, so your code is probably scrambled differently, so you need to copy paste it yourself, but the spot to add the extra lines is the same (also check where I picked the scrambled reference in the extra line and copy it from the same place):

Window_ClassList[_0x2e2dc8(0x1ab)][_0x2e2dc8(0x3e2)] = function() {
const _0x231d02 = _0x2e2dc8;
if (!this[_0x231d02(0x1d3)])
return;
if (this[_0x231d02(0x15c)] <= 0x0)
return;
const _0x45e88f = DataManager['getActorUnlockedClasses'](this[_0x231d02(0x1d3)]);
for (const _0x38d23b of _0x45e88f) {
if (!_0x38d23b)
continue;
let _0x1e1706 = _0x38d23b[_0x231d02(0x413)];
_0x1e1706 = _0x1e1706[_0x231d02(0x238)](/\x1I\[(\d+)\]/gi, ''),
_0x1e1706 = _0x1e1706[_0x231d02(0x238)](/\\I\[(\d+)\]/gi, '');
const _0x4d9cfb = this[_0x231d02(0x2ed)](_0x38d23b);
const availableTiers = DataManager.getClassChangeTiersOnly(_0x38d23b);
if (availableTiers.includes(this._tier))
this[_0x231d02(0x166)](_0x1e1706, _0x231d02(0x18d), _0x4d9cfb, _0x38d23b);
}
this[_0x231d02(0x15c)] > 0x1 && this[_0x231d02(0x166)]('', _0x231d02(0x18d), !![], null);
}
First part ended up working perfectly, and I thanks for that.
Regarding the second, I've copied and paste the version of that code from my console
1761501671076.png

But it appears that there's a different term for it, especiallysince even the lastline is completely different from your example.
1761501720756.png
Cool.

For that second part, the lines you were supposed to add are (I changed the scrambled variable to match yours, hope I wrote it correctly):

const availableTiers = DataManager.getClassChangeTiersOnly(_0x15897c);
if (availableTiers.includes(this._tier))

It seems like you left out the upper line and copied an unnecessary line below and their placement is a little bit off. If you paste that function here (don't add anything extra), I can add the lines there. It's currently as a pic, so I can't use that.
Here you go

Window_ClassList[_0x5d7c39(0x30a)][_0x5d7c39(0x2cd)] = function() {
const _0x358564 = _0x5d7c39;
if (!this[_0x358564(0x2ff)])
return;
if (this[_0x358564(0x32e)] <= 0x0)
return;
const _0x54e352 = DataManager['getActorUnlockedClasses'](this['_actor']);
for (const _0x15897c of _0x54e352) {
if (!_0x15897c)
continue;
let _0x329de2 = _0x15897c[_0x358564(0x385)];
_0x329de2 = _0x329de2[_0x358564(0x202)](/\x1I\[(\d+)\]/gi, ''),
_0x329de2 = _0x329de2['replace'](/\\I\[(\d+)\]/gi, '');
const _0x36897b = this[_0x358564(0x38c)](_0x15897c);
this['addCommand'](_0x329de2, _0x358564(0x209), _0x36897b, _0x15897c);
if (availableTiers.includes(this._tier))
this[_0x231d02(0x166)](_0x1e1706, _0x231d02(0x18d), _0x4d9cfb, _0x38d23b);
}
this['_tier'] > 0x1 && this['addCommand']('', 'classChange', !![], null);
}
EDIT: NEVERMIND, I finally saw the error! I simply had to replace
this[_0x231d02(0x166)](_0x1e1706, _0x231d02(0x18d), _0x4d9cfb, _0x38d23b); (From your example)
with
this['addCommand'](_0x329de2, _0x358564(0x209), _0x36897b, _0x15897c); (From my Console)
with the addition of the missing string. It's resolved now. Thank you so much!
Ok, I saw your edit, but since what you pasted seemed not to be straight from console, but with extra lines added, just to make sure, I think this should be your final result:

Window_ClassList[_0x5d7c39(0x30a)][_0x5d7c39(0x2cd)] = function() {
const _0x358564 = _0x5d7c39;
if (!this[_0x358564(0x2ff)])
return;
if (this[_0x358564(0x32e)] <= 0x0)
return;
const _0x54e352 = DataManager['getActorUnlockedClasses'](this['_actor']);
for (const _0x15897c of _0x54e352) {
if (!_0x15897c)
continue;
let _0x329de2 = _0x15897c[_0x358564(0x385)];
_0x329de2 = _0x329de2[_0x358564(0x202)](/\x1I\[(\d+)\]/gi, ''),
_0x329de2 = _0x329de2['replace'](/\\I\[(\d+)\]/gi, '');
const _0x36897b = this[_0x358564(0x38c)](_0x15897c);
const availableTiers = DataManager.getClassChangeTiersOnly(_0x15897c);
if (availableTiers.includes(this._tier))
this['addCommand'](_0x329de2, _0x358564(0x209), _0x36897b, _0x15897c);
}
this['_tier'] > 0x1 && this['addCommand']('', 'classChange', !![], null);
}
All works properly now.

Original thread: https://forums.rpgmakerweb.com/threads/customized-fighting-style-system-help.180691/