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.

A script that only lets you use skills provided a certain state is active

Are there any scripts that only let you use a skill if a certain state is active?
(For example to use Cross Slash Aluxes must have the sharp state active)
 

poccil

Sponsor

The method skill_can_use? of the Game_Battler class (defined in the script section "Game_Battler 3") allows you to add custom processing to determine whether a skill is usable. In your case, you can modify that method as follows:

Code:
  def skill_can_use?(skill_id)
[b]    # If skill is Cross Cut and battler doesn't have Sharp state
    if skill_id==57 and not state?(13) 
      return false
    end[/b]
    # If there's not enough SP, the skill cannot be used.
    if $data_skills[skill_id].sp_cost > self.sp
      return false
    end
 

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