Tw0Face

Master Strategist
Veteran
Joined
Nov 12, 2018
Messages
623
Reaction score
473
First Language
German
Primarily Uses
RMVXA
I'm currently trying to solve a problem that I thought I didn't need a script for, because it's actually one of the basics of what RPG Maker should be able to do.

I have 3 Actors, each of which has one special skill that should always be grayed out (not useable) unless a specific stat is applied to that Actor. In that case, the skill should become "unlocked" and useable as long as the state lasts.

It's always the same Stat that must be applied to unlock those Actor's special skills, like:
  • Actor A has Special Skill A that is greyed out and unusable -> Stat 1 is applied to Actor A -> Special Skill A becomes available for Stat duration
  • Actor B has Special Skill B that is greyed out and unusable -> Stat 1 is applied to Actor B -> Special Skill B becomes available for Stat duration
  • Actor C has Special Skill C that is greyed out and unusable -> Stat 1 is applied to Actor C -> Special Skill C becomes available for Stat duration
I thought that couldn't be that hard to achieve but seems impossible with what RPG Maker Vx Ace offers by default.

Can someone help me out with a quick snipped to do this?

Best Regards
Tw0Face
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,932
Reaction score
10,515
First Language
German
Primarily Uses
RMMV
a skill needs two parts to be usable: the skill itself and the skill type.

so by default there are two different ways to handle this:
1) have the actor learn the skill and the state to add the skill type
2) have the actor add the skill type and the state to add the skill

In both cases the skill is invisible until usable however

if you want the skill to be greyed out by default, you would have to use the weapon requirement, or a script to change the behaviour.
If I remember correctly both yanfly and tsukihime have written script that can do this, but I don't have the links or names anymore. you'll have to look on their websites (himeworks.com and yanfly.moe)
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
880
Reaction score
422
First Language
English
Primarily Uses
RMXP
FINAL EDIT

Or try this piece of code.

Ruby:
# * KSkillNeedsState ACE * #
#   Scripter : Kyonides Arkanthes
#   2023-01-29

# * Free as in Beer * #

# Leave this note _need state ID_ in the Skill's Note box.
# There ID stands for any existing State ID.

module KSkillNeedsState
  SKILL_REGEX = /_need state (\d+)_/i
end

class Game_Battler
  alias :kyon_gm_btlr_skill_cond_met? :skill_conditions_met?
  def skill_need_state?(skill)
    return true if skill.note[KSkillNeedsState::SKILL_REGEX] == nil
    state?($1.to_i)
  end

  def skill_conditions_met?(skill)
    result = kyon_gm_btlr_skill_cond_met?(skill)
    result = skill_need_state?(skill) if result
    result
  end
end
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

I made the mistake of using CCleaner. Now I have to hack every account I have xD
Having some issues with some esthetic scripts. Mind checking my threads and help?
I've been working on character sprites :), although not far in development, I wanted to start getting sprites done before my art style changes again.
62661208_w4addaU2hBczYcr.png
62661121_AGK5FiAt2QwWjYL.png
Grading exams makes me swing between being full of pride for my students and doubting everything I did this semester xD
Has it really been 50 streams? At this point it's just guilting me into pushing out a prototype. :kaoswt:



I should probably just bite the bullet and send it out, then go with my original plan to provide weekly updates.

Forum statistics

Threads
129,725
Messages
1,204,686
Members
170,811
Latest member
antisocialgames
Top