Status
Not open for further replies.

Mahoken

Veteran
Veteran
Joined
Nov 24, 2013
Messages
41
Reaction score
3
First Language
English
Primarily Uses
I'm trying to make a skill called "Impale", but I want the "Required Weapons" to be a Sword, Longsword, AND spear. You can only choose two though T-T

How can I make more than 2 "Required Weapons"?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,693
Reaction score
3,023
First Language
Tagalog
Primarily Uses
RMVXA
you cannot do it via the default methods if you want it to be completely unusable...

you can use skill restriction scripts to do it though... or you can also opt to simply make use of the formula so that it won't do any damage if used with other weapons
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,086
Reaction score
15,501
First Language
English
Primarily Uses
RMMV
Or a custom script.

Here you go. Paste this into a new slot in your script list. If you have any custom scripts that alias the Game_Actor.skill_wtype_ok? method, this script should go BEFORE them.

module DataManager class << self alias shaz_3weapons_load_normal_database load_normal_database end def self.load_normal_database shaz_3weapons_load_normal_database $data_skills.compact.each { |skill| skill.note.split(/[\r\n+]/).each do |line| case line when /<require\s*(\d+)>/i # <require id> in note skill.required_wtype_id3 = $1.to_i end end } endend class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # * Determine if Skill-Required Weapon Is Equipped #-------------------------------------------------------------------------- def skill_wtype_ok?(skill) wtype_id1 = skill.required_wtype_id1 wtype_id2 = skill.required_wtype_id2 wtype_id3 = skill.required_wtype_id3 return true if wtype_id1 == 0 && wtype_id2 == 0 && wtype_id3 == 0 return true if wtype_id1 > 0 && wtype_equipped?(wtype_id1) return true if wtype_id2 > 0 && wtype_equipped?(wtype_id2) return true if wtype_id3 > 0 && wtype_equipped?(wtype_id3) return false endend class RPG::Skill < RPG::UsableItem alias shaz_3weapons_skill_initialize initialize def initialize super @required_wtype_id3 = 0 end attr_accessor :required_wtype_id3end
Then in your skill, add a note like this:

<require id>where id is the id of the third weapon type (shown in your Terms tab; do not include leading zeros - so 04:Sword would be shown as <require 4>)If you want MORE than 3 required weapons, I'd have to modify that.
 
Last edited by a moderator:

Xypher

Veteran
Veteran
Joined
Apr 1, 2012
Messages
148
Reaction score
26
Primarily Uses
shaz's script isn't working for me so made a new one

module DataManager  class <<self; alias load_database_3rwt load_database; end  def self.load_database    load_database_3rwt    load_notetags_3rwt  end   def self.load_notetags_3rwt    for obj in $data_skills      next if obj.nil?      obj.load_notes    end  endendclass RPG::Skill < RPG::UsableItem  attr_accessor :required_wtype_id3  def load_notes    @required_wtype_id3 = []    self.note.split(/[\r\n]+/).each { |line|      case line      when /<require\s*(\d+(?:\s*[, ]\s*\d+)*)>/i        $1.scan(/\d+/).each { |num|        @required_wtype_id3.push(num.to_i) if num.to_i > 0}      end      }    endendclass Game_Actor < Game_Battler  def skill_wtype_ok?(skill)    wtype_id1 = skill.required_wtype_id1    wtype_id2 = skill.required_wtype_id2    wtype_id3 = skill.required_wtype_id3    return true if wtype_id1 == 0 && wtype_id2 == 0 && wtype_id3.empty?    return true if wtype_id1 > 0 && wtype_equipped?(wtype_id1)    return true if wtype_id2 > 0 && wtype_equipped?(wtype_id2)    return true if (weapons.any? {|weapon| wtype_id3.include?(weapon.wtype_id)})    return false  endend
same notetag as shaz's except with multiple id support.

so use <require id> or <require id, id, id, id> or <require id id id> in a skill's notebox
 
Last edited by a moderator:

Mahoken

Veteran
Veteran
Joined
Nov 24, 2013
Messages
41
Reaction score
3
First Language
English
Primarily Uses
Thank you! It's just what I was looking for!
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,086
Reaction score
15,501
First Language
English
Primarily Uses
RMMV
I don't know why it wouldn't work for you Xypher. Worked fine for me.


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

I'm listening to iiluminaughtii talking about the secrets behind shady businesses and scams. Meanwhile I'm writing a fanfic about Sephiroth from FF7, one specifically for my stepmom. I'll get to give it to her, too, because my boss said I could take the holidays off! Dec. 22-27 I will be in Orlando, and maybe Fort Myers too, visiting my dad and stepmom!
Of course, I bought a handful of games on the Steam Black Friday sale. Will I try them? Will I complete any? Who knows...
I don't really have any neat updates today about how I screwed up programming... But if you want to observe the intensenes of me programming, then you can check out my stream :)
New Weapons.gif
No more spam from me today, I promise! Just wanted to upload this, people have been giving me feedback that my weapon sprites (which were RTP) clashed badly with my battlers for ages, so today I finally took the plunge and updated them! Really happy with how they came out :D :D
So Facebook fraudulently took money from me. They even went through my PayPal accounts to find a card that had the money on it. Thinking about deleting my Facebook account because this doesn't happen on twitter, not even close.

Forum statistics

Threads
117,001
Messages
1,103,714
Members
152,895
Latest member
tmsvan
Top