RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VX] [Solved] Skill Prerequisite script

0 Members and 1 Guest are viewing this topic.

***
Gracies New Favorite
Rep:
Level 63
<Skill Prerequisites>
<December 24, 2011>



Summary
<<I'm looking for a script that makes it so you can only use certain skills if the user is in a certain state. I know Yanfly has a script like that, the custom skill effects script... but it's not compatible with tankentai that I know of. It displays attack animations wrong when its implemented.>>

Features Desired
  • Prerequisites for skills (states preferred)
  • The ability to use gold or HP for skill currency would be cool... but optional
  • Full compatibility with the newest version of Tankentai

Mockups
<<I don't believe I could post a picture of this>>

Games its been in
  • None that I know of.

What other scripts are you using?
  • These are the ones pertaining to battle~~
  • Tankentai
  • Regenerate HP/MP - RMVX Version
  • Weapon Unleash
  • YEZ Job System: Base, Classes, Skill Levels
  • YEZ Weapon Mastery Skills
  • YEZ Victory Aftermath
  • YEZ Battler Stat: DEX, RES



Did you search?
<<Yes>>

Where did you search?
  • This database
  • Google
  • RPGRPG Revolution

What did you search for?
  • RPMVX Skill Prerequisites
  • Custom Skill Effects Compatibility
  • Skill Prerequisites for RPG Maker VX
« Last Edit: December 30, 2011, 12:32:53 AM by modern algebra »

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Best IRC Quote2014 Zero to Hero2014 Most Missed Member2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Merry Christmas script!
Code: [Select]
# Skill State Prerequisites
# By Pacman (25/12/11 - CHRISTAMAS SCRIPT!)
# Use the tag:
# <need state: x>
# <need state: x, y, z>
# where x (y and z) is (are) an integer(s) in the notebox of a skill to make
# the skill require the states with those IDs to work. Therefore, if you put
# <need state: 2> in a skill's notebox, the skill requires the state with ID
# 2 to work. If you put:
# <need state: 3, 6> in the notebox, it requires both states with IDs 3 and 6.
# Insert this near the bottom of your custom script list.

class RPG::Skill
  def need_states
    return @need_states if !@need_states.nil?
    @need_states = []
    self.note.split(/[\r\n]+/).each { |line|
      case line
      when /<(?:NEED STATE|need_state|NEEDSTATE):[ ](\d+(?:\s*,\s*\d+)*)>/i
        $1.scan(/\d+/).each { |num|
          @need_states.push($data_states[num.to_i]) if num.to_i > 0
        }
      end
    }
    return @need_states
  end
end

class Game_Battler
  alias skipre_skill_can_use? skill_can_use?
  def skill_can_use?(skill, *args)
    return false unless skill.is_a?(RPG::Skill)
    sstates = skill.need_states
    for state in sstates
      return false unless states.include?(state)
    end
    return skipre_skill_can_use?(skill, *args)
  end
end
I didn't do the currency thing, because I'm not quite sure what you meant by that.
MERRY CHRISTMAS (it might not be Christmas for you yet, but it is for me).
it's like a metaphor or something i don't know

***
Gracies New Favorite
Rep:
Level 63
Thanks, Pac! It is christmas here, or rather Christmas eve... By "currency" I mean that it costs gold, or HP instead of MP. But like i said, it was optional. Thank you so much :) I was all distraught cause it canned the whole Idea I had for my warrior. Merry Christmas :)