Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Skill condition - Weapon - For RMVX, when you hold sword,you can't use spear skill.
Nechi
post Feb 9 2008, 10:39 PM
Post #1


Certamen Promus
Group Icon

Group: Revolutionary
Posts: 117
Type: None
RM Skill: Beginner




CODE
#===========================================
# Skill condition -Weapon- for RMVX
# Edited by Nechigawara Sanzenin
# RMXP version by angelix,http://community.thaiware.com/thai/index.php?showuser=168152
=begin
How to Use:
1.Open The Database and Add New Element For the Weapon (EX:Sword)
2.Add Id form New create Element add in WEAPON = [] (EX:WEAPON = [15,12,13])
3.Set Element for Skill And Weapon
=end
#===========================================
class Game_Actor < Game_Battler
  WEAPON = []
  #--------------------------------------------------------------------------
  def setup(actor_id)
    actor = $data_actors[actor_id]
    @actor_id = actor_id
    @name = actor.name
    @character_name = actor.character_name
    @character_index = actor.character_index
    @face_name = actor.face_name
    @face_index = actor.face_index
    @class_id = actor.class_id
    @weapon_id = actor.weapon_id
    @armor1_id = actor.armor1_id
    @armor2_id = actor.armor2_id
    @armor3_id = actor.armor3_id
    @armor4_id = actor.armor4_id
    @level = actor.initial_level
    @exp_list = Array.new(101)
    make_exp_list
    @exp = @exp_list[@level]
    @skills = []
    @weapon_type = WEAPON
    for i in self.class.learnings
      learn_skill(i.skill_id) if i.level <= @level
    end
    clear_extra_values
    recover_all
  end
  #--------------------------------------------------------------------------
  def elements_max_rate(element_set)
    return 100 if element_set.empty?                # 無属性の場合
    rate_list = []
    clone_ele = element_set.clone
    if self.is_a?(Game_Actor)
      for i in self.weapon_type
        clone_ele.delete_at(i)
      end
    end
    for i in clone_ele
      rate_list.push(element_rate( i ))
    end
    return rate_list.max
  end
  #--------------------------------------------------------------------------
  def skill_can_use?(skill)
    if @weapon_id != 0 and skill.id != 0
      @wep_type = $data_weapons[@weapon_id].element_set
      @need_type = $data_skills[skill.id].element_set
      for i in @weapon_type
        if @need_type.include?(i) and @wep_type.include?(i) == false
          return false
        end
      end
    end
    return false unless skill_learn?(skill)
    return false unless skill.is_a?(RPG::Skill)
    return false unless movable?
    return false if silent? and skill.spi_f > 0
    return false if calc_mp_cost(skill) > mp
    if $game_temp.in_battle
      return skill.battle_ok?
    else
      return skill.menu_ok?
    end
  end
  #--------------------------------------------------------------------------
end


Add this before Main Script

How to Use:
1.Open The Database and Add New Element For the Weapon (EX:Sword)
2.Add Id form New create Element add in WEAPON = [] (EX:WEAPON = [15,12,13])
3.Set Element for Skill And Weapon

RMXP Version by : Angelix,Thaiware RPG Maker

This post has been edited by Nechi: Feb 11 2008, 09:20 AM


__________________________


Now, I 'm very busy.I'm work hard in the university. If you send me PM, sorry that I can't answer them at the moment.
Go to the top of the page
 
+Quote Post
   
neclords
post Feb 11 2008, 01:31 AM
Post #2


Love me! I wanna you to love me!
Group Icon

Group: Revolutionary
Posts: 196
Type: Event Designer
RM Skill: Beginner




That's will be an awesome idea.. biggrin.gif


__________________________

~Time To sWallow tHe Pain and VaniSH OuR HuRt~
Go to the top of the page
 
+Quote Post
   
mikeDman1988
post Feb 11 2008, 03:10 AM
Post #3


Level 4
Group Icon

Group: Member
Posts: 52
Type: Artist
RM Skill: Advanced




I dont get how to set them up... More details please?


__________________________

I'm misttribe from Rmxp.org and rpgmakervx.net.
Go to the top of the page
 
+Quote Post
   
Nechi
post Feb 11 2008, 03:38 AM
Post #4


Certamen Promus
Group Icon

Group: Revolutionary
Posts: 117
Type: None
RM Skill: Beginner




QUOTE (mikeDman1988 @ Feb 11 2008, 02:17 AM) *
I dont get how to set them up... More details please?



I'm sorry for my bad English ^^


__________________________


Now, I 'm very busy.I'm work hard in the university. If you send me PM, sorry that I can't answer them at the moment.
Go to the top of the page
 
+Quote Post
   
mikeDman1988
post Feb 11 2008, 08:15 AM
Post #5


Level 4
Group Icon

Group: Member
Posts: 52
Type: Artist
RM Skill: Advanced




QUOTE (Nechi @ Feb 11 2008, 03:45 AM) *
QUOTE (mikeDman1988 @ Feb 11 2008, 02:17 AM) *
I dont get how to set them up... More details please?



I'm sorry for my bad English ^^



If I have no weapon equiped I get an error when I go to skills... Why is this?


__________________________

I'm misttribe from Rmxp.org and rpgmakervx.net.
Go to the top of the page
 
+Quote Post
   
Nechi
post Feb 11 2008, 09:12 AM
Post #6


Certamen Promus
Group Icon

Group: Revolutionary
Posts: 117
Type: None
RM Skill: Beginner




Thanks for tell me about some Bug.
I'm convert this script from XP ver. And don't test all command.
Please wait for my fix the Bug^^

Edit:: Now fixed bug was finish
Let's try new script at first post^^

This post has been edited by Nechi: Feb 11 2008, 04:16 PM


__________________________


Now, I 'm very busy.I'm work hard in the university. If you send me PM, sorry that I can't answer them at the moment.
Go to the top of the page
 
+Quote Post
   
xionreaver
post Jun 28 2008, 06:13 AM
Post #7


Level 1
Group Icon

Group: Member
Posts: 10
Type: Event Designer
RM Skill: Beginner




i tried using this, it worked, but seeing how i suck at scripting, i cant make it work for more than one selection, such as i cant use spear skills with a sword but i can use crossbow ones... what is the solution?
Go to the top of the page
 
+Quote Post
   
Mr_E_Man
post Jun 28 2008, 08:20 PM
Post #8


Level 8
Group Icon

Group: Revolutionary
Posts: 124
Type: Event Designer
RM Skill: Skilled




There is a better and easier script that does the same thing. You can find it here:

http://www.rpgrevolution.com/forums/?showtopic=14496


__________________________
We exist within all things and all things exist within us... it's very crowded.
Go to the top of the page
 
+Quote Post
   
xionreaver
post Jun 29 2008, 06:45 PM
Post #9


Level 1
Group Icon

Group: Member
Posts: 10
Type: Event Designer
RM Skill: Beginner




yes, thanks, that is a nice script but i dont see it using the elements set on the weapon to determine the use of a skill, can that be done through the given script or should i continue looking, my apologies for my inability to script myself.
Go to the top of the page
 
+Quote Post
   
xionreaver
post Jun 29 2008, 06:53 PM
Post #10


Level 1
Group Icon

Group: Member
Posts: 10
Type: Event Designer
RM Skill: Beginner




nevermind, i think i got it to work, forgot to add = before end.
Go to the top of the page
 
+Quote Post
   
Mr_E_Man
post Jun 29 2008, 07:30 PM
Post #11


Level 8
Group Icon

Group: Revolutionary
Posts: 124
Type: Event Designer
RM Skill: Skilled




No, this one sets the requirements using the notes field, which is just as easy as checking something in the element window.


__________________________
We exist within all things and all things exist within us... it's very crowded.
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th May 2013 - 08:50 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker