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.

Accessory-Magic Combination

Okay, another question...
In my current project (For RXP) I wanted to make it, so that in order to cast spells, you need to have an accessory equipped, for example.

Say the main charecter obtains the FIRE CARD, when equipped, they will be able to cast Fire, Fire 2 and Burn, is this at all possible?

Oh, and if it is, is it also possible to maybe make it so, as they fight, they can permanently learn the spell on the cards?

Please be descriptive, I can get confused easily
 
That has been done more or less with a script. it was called the spell tablet system. I don't have the demo anymore though. Normally you'll find it on this or some other website floating around somewhere ;)
 
Or you could use an evented system.

For that you'd have to make a common event set on parrallel process. Once your game starts switch it on.
In this event set a conditional branch for each of your equipment that makes you learn spells, with condition that this equipment is actually equipped.
Make it so that when this condition is met the spell/skill is learnt.
Set an else handling that has a conditional branch inside again. Condition: Lets say variable x lower than 30.
If this condition is met set the skill to be forgotten.
Now you link each skill to it's own conditional branch that sets variable x (same one as before) +1.

This way if you have used a skill more than 29 times it won't be forgotten by discarding the equpment again.

Hope this helps (and actually works quite as well as I imagined it)

~Dalton~
 

Atoa

Member

I have a simple script that allows actors to lear skill with equipment.

Weapon_Skills[Weapon ID] = [Skills IDs]
Armor_Skills[Armor ID] = [Skills IDs]

This don't work with multi-slot scripts.
Code:
#===============================================================================

# Equi Skill

#===============================================================================

 

module Atoa

  Weapon_Skills = [] #Don't remove or change this line

  Armor_Skills  = [] #Don't remove or change this line

  

  Weapon_Skills[1] = [1]

  Weapon_Skills[2] = [2]

 

  Armor_Skills[1]  = [7]

  Armor_Skills[2]  = [10]

  Armor_Skills[29] = [8]

end

 

 

#===============================================================================

# Game_Actor

#===============================================================================

class Game_Actor < Game_Battler

  #--------------------------------------------------------------------------

  alias equip_learn_skill_initialize initialize

  alias equip_learn_skill_equip equip

  #--------------------------------------------------------------------------

  def initialize(*args)

    @equipment_skills = []

    equip_learn_skill_initialize(*args)

    gain_equip_skills

  end

  #--------------------------------------------------------------------------

  def equip(equip_type, id)

    lose_equip_skills

    equip_learn_skill_equip(equip_type, id)

    gain_equip_skills

  end

  #--------------------------------------------------------------------------

  def lose_equip_skills

    for lose_skills in @equipment_skills

      self.forget_skill(lose_skills)

    end

    @equipment_skills = []

  end

  #--------------------------------------------------------------------------

  def gain_equip_skills

    new_skills = Atoa::Weapon_Skills[@weapon_id]

    get_new_equip_skill(new_skills)

    new_skills = Atoa::Armor_Skills[@armor1_id]

    get_new_equip_skill(new_skills)

    new_skills = Atoa::Armor_Skills[@armor2_id]

    get_new_equip_skill(new_skills)

    new_skills = Atoa::Armor_Skills[@armor3_id]

    get_new_equip_skill(new_skills)

    new_skills = Atoa::Armor_Skills[@armor4_id]

    get_new_equip_skill(new_skills)

  end

  #--------------------------------------------------------------------------

  def get_new_equip_skill(new_skills)

    if new_skills != nil

      for learning in new_skills

        if !self.skill_learn?(learning) and !@equipment_skills.include?(learning)

          @equipment_skills.push(learning)

          self.learn_skill(learning)

        end

      end

    end

  end

  #--------------------------------------------------------------------------

  def exp=(exp)

    lose_equip_skills

    @exp = [[exp, 9999999].min, 0].max

    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0

      @level += 1

      for j in $data_classes[@class_id].learnings

        if j.level == @level

          learn_skill(j.skill_id)

        end

      end

    end

    while @exp < @exp_list[@level]

      @level -= 1

    end

    @hp = [@hp, self.maxhp].min

    @sp = [@sp, self.maxsp].min

    gain_equip_skills

  end

end
I have an improved version of it (My actor advanced status, wich come with multi equip slots and equipments sets) but for now it's compatible only with my ACBS and the SBS Tankentai.
 

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