As I am pretty bad at explaining things, I will try my best. Please let me know if you need additional information.
Using the default settings as an example.
When you hit [ESC] to go into your main menu, you can then select Skills. Once you select Skills you then choose the character and can then choose between the Skill Types of Special and Magic. What I am wanting to do is hide those selections unless you actually know a skill of that skill type.
I ask this as I have several skill types and I do not want the player to have to scroll through all of the skill types that they do not currently possess until they learn a relative skill.
Thanks!
[ACE] - Hide Skill Type When Skills Not Learned
● ARCHIVED · READ-ONLY
-
-
Do you want this just in the main menu, or in the battle menu as well?
-
I already have it that way in the battle menu, so I just need it in the main menu. I had a custom script written, but forgot to ask for this feature. Sadly, the creator seems to be on hiatus from the boards right now.
-
Well, first take a look at what your scripter did to make it happen in the battle menu. They are different windows, but they have the same method with exactly the same commands to form the list of skill types. You MAY just be able to copy that method and put it inside a Window_SkillCommand class and have it work.
If you can't get it working, add this to a new script slot ABOVE your other custom scripts. This looks at all the skills the actor currently has and builds the list of skill types based on that list (so if your actor somehow has skills of a type that's NOT listed in their features or the class's features, that type will also show - I don't think this should happen normally, but I made it happen just by giving them skills belonging to a class they don't have on levelling up):
Code:This overwrites Window_SkillCommand's make_command_list method. If you have any other scripts that also overwrite the same method of that class, you'll have to merge them as only one will be active (the lowest one).class Window_SkillCommand < Window_Command #-------------------------------------------------------------------------- # * Create Command List #-------------------------------------------------------------------------- def make_command_list return unless @actor #@actor.added_skill_types.sort.each do |stype_id| (@actor.skills.collect{|skill| skill.stype_id}).sort.uniq.each do |stype_id| name = $data_system.skill_types[stype_id] add_command(name, :skill, true, stype_id) end endend -
Okay, I tried taking everything from Window_ActorCommand, and putting it under Window_SkillCommand, but that did not do the trick. I am going to try your second suggestion. Would you mind if I PM you with the script + my alteration to see if you notice what I did wrong? It's relatively short.
Edit -
Your second suggestion works, but I have one heading that should always be displayed, Learn Skill. Now I just have to figure out how to have that choice displayed all the time. -
That is not what I told you to do. I told you to copy the appropriate method under Window_ActorCommand and put it into a new script for the Window_SkillCommand class. Not the whole thing. It will look just like I put above, but the content of the method will be different.
Please don't PM me. I don't have time to provide one-on-one assistance. If you post a link to the script (or put it in pastebin if it's a custom one and provide a link), several people will be able to take a look at it for you. -
Right, which is what I did
I took:
class Window_ActorCommand < Window_Command #-------------------------------------------------------------------------- # * Add Skill Command to List #-------------------------------------------------------------------------- def add_skill_commands @actor.added_skill_types.sort.each do |stype_id| name = $data_system.skill_types[stype_id] add_command(name, :skill, true, stype_id) if @actor.skills.any? {|i| i.stype_id == stype_id } end endend
Then turned it into:
Code:class Window_SkillCommand < Window_Command #-------------------------------------------------------------------------- # * Add Skill Command to List #-------------------------------------------------------------------------- def add_skill_commands @actor.added_skill_types.sort.each do |stype_id| name = $data_system.skill_types[stype_id] add_command(name, :skill, true, stype_id) if @actor.skills.any? {|i| i.stype_id == stype_id } end endend
I tried both placing this inside the current script and in a script by itself, above the other scripts. Neither of which worked. Was that not what you suggested? I apologize if I misunderstood or if I am still misunderstanding. -
Yeah, that would work (and in fact was the first approach I took when I was writing it).
If you put that in the same script and it made no difference, it probably indicates that there's another script lower that overwrites it. Do a global search (control+shift+f) for add_skill_commands and see how many times it comes up, and in what scripts.
You could try putting your code BELOW all other custom scripts. But if something else has overwritten it for some purpose, you may be losing the functionality that script added. -
Hmm, there are only 3 places. 2 instances inside Window_ActorCommand and the one instance inside my custom script. I am going to experiment a bit with it and see what I can find.
If all else fails, your section suggestion worked, I just need that one header, Learn Skills, to always be displayed. -
The script I gave you does exactly what the other script does that you just posted. If there was previously a Learn Skills, that would be from another custom mod.
You said you replaced the whole Window_SkillCommand script ... did you change it back again after it failed to work? -
I did not replace the default whole Window_SkillCommand script.
What I have tried...
Setting everything back to how it was before this thread.
I then checked to see how many instances of add_skill_commands (thank you so much for the ctrl+shift+f, that will help tremendously), of which there were only the 3 instances above.
After that I took the Window_SkillCommand script that I listed in the spoiler above and tried placing it inside the custom script. - No Effect.
I then put it into a script slot by itself and placed it above the other my other custom scripts. - No Effect.
Lastly, I placed it below all other scripts. - No effect.
I am honestly not sure why that is not working when what you have works perfectly.
As for the Learn Skills, it is created by Yanfly's Learn Skill Engine:
Code:#-------------------------------------------------------------------------- # new method: add_learn_skill_command #-------------------------------------------------------------------------- def add_learn_skill_command return unless Switch.show_learn_skill name = YEA::LEARN_SKILL::COMMAND_NAME add_command(name, :learn_skill, true, @actor.added_skill_types[0]) end end # Window_SkillCommand
I can use your script above, by I need to have it so that Learn Skill is always in the Skill List.
*Edit*
So with all of this in mind, does anyone know how I could use Shaz's script, which hides any skill that does not have a skill learned in it, but still show the Learn Skills selection? -
Shaz, I am rather embarrassed to admit this, and owe you an apology for misreading. I misread "If you can't get it working, add this to a new script slot ABOVE your other custom scripts." as "above your custom skill script."
As Yanfly's Learn Skill is the one that draws the Learn Skills, placing it above that corrects it. Thank you so very much and I apologize for misreading. -
Awesome - glad you got it working :)
-
Apologies for necrobumping, but do you happen to have the script that hides the commands in battle? Or at least know how to convert Shaz's script listed above to do so?
Many thanks.
Edit
I found a solution using a mixture of Shaz's fix above and another poster's tweaking. I made the following adjustment in the Window_ActorCommand script:
Code:#-------------------------------------------------------------------------- # * Add Skill Command to List - Help from Shaz and kerbonklin #-------------------------------------------------------------------------- def add_skill_commands return unless @actor #@actor.added_skill_types.sort.each do |stype_id| (@actor.skills.collect{|skill| skill.stype_id}).sort.uniq.each do |stype_id| name = $data_system.skill_types[stype_id] add_command(name, :skill, true, stype_id) unless stype_id == 00 #hides moves with no Skill Type end end