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.

Skill from accessory, useable only once

kkxkn

Member

I'm using this battle system:
http://www.rmxp.org/forums/showthread.php?t=14163

No other addons not included in that demo are being used at this stage.

What I'm after, is that, by equipping an accessory, the character gains an extra skill. Then, when this skill is used, the accessory is removed(as in, it is lost, not just unequipped) and the skill is lost (until another accessory is equipped).

So basically,
1) Accessory is equipped, skill is gained
2) Once skill is used, accessory is lost
3) When accessory is either lost in that way or unequipped, the skill is lost

Also another _very_ minor addon that would go well with this one, if it's not already the default behaviour of RMXP... if a skill has an MP cost of 0, then don't display anything for MP cost instead of displaying 0.
 

kkxkn

Member

It possibly could, but it would require a lot of fork conditions and be extremely complex, and is there any way through that to tell which character even casted the spell?
 
umm not sure if this can do that...

http://www.rmxp.org/forums/showthread.php?t=4462

Its Tricksters individual battle commands... you might just be able to do that in the script section and stuff not sure...

just ask in that post I guess and see what script can be used... it would require you to make an ID of all the accessories that give skills to have the skills though...

but that adds an extra command so maybe is not what you want... hmmm... for just a skill dunno but this is probably close to what you need

you will probably need the bag of skill effects too... http://www.rmxp.org/forums/showthread.php?t=19102

the divest script (unequip item when skill is used) then probably make it so you loose the item...

so umm probably something like this???


item 81 is the accessory novice spell book...

Code:
#--------------------------------------------------------------------------
# * Command Id 13  : Custom Commands Special attacks
#   Description   : a novice spell book that gives you 4 spells... skills 1 => 1 is skill id 1 at level 1
#--------------------------------------------------------------------------
id		13
name		Novice's Book
kind		1
armor_ids	[81]
skills		{1 => 1, 2 => 1, 3 => 1, 4 => 1}
description	A Novice Spellcaster's Spellbook
help_text	Contains 4 basic spells...
next_method	start_skill_select

and useing the bag of skills effects set it so that those 4 skills would make it remove the equiped item that gives you the skills...

so on line 23 of the divest script set it to

Code:
Divest = {1 => [81], 2 => [81], 3 => [81], 4 => [81]}

I think that is what you mean... hmm not sure if it will work maybe someone will look at this XD

hmm if you use those 2 scripts it would probably work but only problem is it adds that command window with the skills in it... could be useful though... an item that gives you a super attack spell but destroys the item itself or gives you a super healing spell XD

hmm though for destorying the item is the problem isn't it??? hmm I guess this would need changed but I dunno your gonna have to ask Trickster about it... T_T so I guess it needs to have an item remove code added to the end

which is already in the games defaults just how to call it???

hmm...
Code:
  #--------------------------------------------------------------------------
  # * Lose Items
  #     item_id : item ID
  #     n       : quantity
  #--------------------------------------------------------------------------
  def lose_item(item_id, n)
    # Reverse the numerical value and call it gain_item
    gain_item(item_id, -n)
  end
  #--------------------------------------------------------------------------
  # * Lose Weapons
  #     weapon_id : weapon ID
  #     n         : quantity
  #--------------------------------------------------------------------------
  def lose_weapon(weapon_id, n)
    # Reverse the numerical value and call it gain_weapon
    gain_weapon(weapon_id, -n)
  end
  #--------------------------------------------------------------------------
  # * Lose Armor
  #     armor_id : armor ID
  #     n        : quantity
  #--------------------------------------------------------------------------
  def lose_armor(armor_id, n)
    # Reverse the numerical value and call it gain_armor
    gain_armor(armor_id, -n)
  end


Code:
=begin
==============================================================================
 ●● Name: Divest
    Effect: Unequips weapon/armor 
==============================================================================
=end
#--------------------------------------------------------------------------
# * Begin SDK Log
#--------------------------------------------------------------------------
SDK.log('Skill Effect Divest', 'Trickster', 1.0, '7.2.07')
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.enabled?('Skill Effect Divest')

module Effects
  #--------------------------------------------------------------------------
  # * Divest
  #   - syntax skill_id => [ what to unequip ]
  #   what to unequip: 'w(id)' for weapon 'a(id)' for armor
  #   'w' = all weapons 'a' = all armors nil = everything
  #--------------------------------------------------------------------------
  Divest = {137 => ['a']}
  #--------------------------------------------------------------------------
  # * Default Divest Effect
  #--------------------------------------------------------------------------
  Divest.default = nil
  #--------------------------------------------------------------------------
  # * Divest Element
  #--------------------------------------------------------------------------
  Divest_Element = nil
  #--------------------------------------------------------------------------
  # * Do Not Touch
  #--------------------------------------------------------------------------
  Methods << :divest
end

class Game_Battler
  #--------------------------------------------------------------------------
  # * Skill Effect Divest
  #--------------------------------------------------------------------------
  def skill_effect_divest(user, skill)
    # If A Divest Effect and isn't immune
    if (skill.has_effect?(:divest) and not skill_immune?(:divest) and
        self.is_a?(Game_Actor))
      # Get what to unequip
      unequip = Effects.effect(:divest, skill.id)
      # Run Through Array and Unequip
      unequip.each do |id|
        # if nil unequip all
        if id == nil
          (weapon_ids.size + armor_ids.size).times {|id| self.equip(id, 0)}
        elsif id == 'w'
          weapon_ids.each_index {|id| self.equip(id, 0)}
        elsif id == 'a'
          armor_ids.each_index {|id| self.equip(id + weapon_ids.size, 0)}
        elsif id[0..0] == 'w'
          self.equip(id[1...id.size].to_i, 0)
        elsif id[0..0] == 'a'
          self.equip(id[1...id.size].to_i + weapon_ids.size, 0)
        elsif id.is_a?(Integer)
          self.equip(id, 0)
        end
      end
      self.damage = 'Unequipped'
    end
  end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
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