Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[VX] Adding "Unlock" to YEZ Job System Classes [SOLVED]

When I last worked on my project, I had "upgraded" from Yanfly's YERD Subclass Selection System to his new YEZ Job System: Classes for the sake of new features, such as support for his DEX and RES stats. However, what I didn't realize at the time was that some functionality was lost between the two scripts, namely the ability to restrict access to certain classes by Actor. Accessible classes were editable and designated in a line of script, and in order to gain access to these classes they would have to be "unlocked" via event or item.

With YEZ, however, there doesn't seem to be an item tag or a script call that can unlock classes. Rather, all available classes are designated within the setup portion of the script and become immediately available without any kind of restriction. I can go into reasons why I don't want this to be happening, but the point is that this is not exactly what I'm looking for.

Essentially, I'm looking for a way to create a restriction on accessible classes listed until a script call is used or an item is used. The unlocking of classes would be done on an individual actor basis.

I've included the YEZ Job Class script with this post, as well as the YERD Subclass Selection System script to see if anyone can translate the methods used to restrict/add in that system to the YEZ script.

Though I doubt compatibility would be an issue since this is just a script patch, the major script I need to worry about is GTBS, the rest of my major scripts being Yanfly scripted.

Both of the scripts are apparently way too big, so I'm linking to them externally.
http://shinobi_dan.webs.com/yanfly-YEZ_Job...tem-Classes.txt
http://shinobi_dan.webs.com/subclassselectionsystem.txt


Thanks for the help in advance!

EDIT (PROGRESS?): I was messing around and tried to see if I could make my own method for unlocking classes. I did a bit of research to see if I could figure it out, and came up with the following method, which I added to the Game_Party section:

#--------------------------------------------------------------------------
# new method: unlock_actorclass
# Call using $game_party.unlock_actorclass(actor, class)
#--------------------------------------------------------------------------
def unlock_actorclass(actor_id, class_id)
YEZ::JOB::UNLOCKED_1STCLASS_LIST[actor_id] << class_id
end

And this worked! Sort of. I'm not sure what would be causing this problem, but I can't make the script add classes if there is only one element listed in the array, and I also can't make the script work multiple times per character (for unlocking different classes). Can anyone give me a hand in figuring out what's wrong?

Further progress: Managed to eliminate the first problem by changing it to " += [class_id] ", but I still can't get it to perform addition into the array more than once.

SOLVED: Must initialize original class array at a larger size. I'm not sure why it isn't dynamic, but such is the case. If you know you're going to unlock 20 classes, initialize by having the array as [4,0,0,0,0,0,0,etc.]
 
While I can't help you on the topic, I might help you on your next request/Support topic by telling you that no matter what it is you're asking for: If you want the theory explained or help with it, however ultimately scripting it yourself, you're right in Script Support. If you don't want to mess with it and rather have someone else do the sharping, go to Script Request forums.

Also, be aware that .org has it's own syntax highlighter, useable by [rgss][/rgss] tags, which is much more convenient than pastebin's ugly and blocky stuff, plus shows more syntax highlighting than yours does ;) (though I believe pastebin supports Ruby syntax highlighting... guess you didn't select it.)
 
Sorry about that, both pastebin and the RGSS tags are new since the last time I've been here. Regardless, however, I think both scripts are far too long for me to post within the topic, so I've gone ahead and uploaded them elsewhere.
 
Bump, as I've possibly found something that could be useful.

I tried looking through the script again to see if there were any built in methods for unlocking classes, and I did run across this command:

$game_party.unlock_class

Which I tried in game with the following command, "$game_party.unlock_class(1)" and it worked. However, the problem was that it unlocked for ALL characters, which is not what I'm looking for; I want it to be able to unlock for only either one specific actor or one subset of actors that I can designate somehow.

Thanks in advance!

EDIT (PROGRESS?): I was messing around and tried to see if I could make my own method for unlocking classes. I did a bit of research to see if I could figure it out, and came up with the following method, which I added to the Game_Party section:

#--------------------------------------------------------------------------
# new method: unlock_actorclass
# Call using $game_party.unlock_actorclass(actor, class)
#--------------------------------------------------------------------------
def unlock_actorclass(actor_id, class_id)
YEZ::JOB::UNLOCKED_1STCLASS_LIST[actor_id] << class_id
end

And this worked! Sort of. I'm not sure what would be causing this problem, but I can't make the script add classes if there is only one element listed in the array, and I also can't make the script work multiple times per character (for unlocking different classes). Can anyone give me a hand in figuring out what's wrong?

Further progress: Managed to eliminate the first problem by changing it to " += [class_id] ", but I still can't get it to perform addition into the array more than once.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top