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.

[req]Variable Skills

Tim.

Member

Hey there, I've recently been working on my game and decided to include a skill levelling system, and I didn't want to get too complex with scipts and stuff, so I got the idea of a script that adds 1 point to a variable every time a skill is used, in battle or in the menu. Could any body do this? I also need the script to be easy to edit. Like, copy and paste one line and change some names for different skills and variables. (I'm a noob scripter).
 
Couldn't you set a Battle event for turns 0+1 and set it to battle and use a conditional branch checking for the script.
Code:
@Window_Skill[I]
Input.trigger?(Input::C)

And then add a variable within the conditional branch? If that doesn't work it will only require a line of script.

Can't remember where though...
 
Copy and Paste Below Everything else
Code:
class Game_Actor
  Skill_Variable_Counter = {
    skill_id => variable_id
  }
  alias seph_skillusecntr_se skill_effect
  def skill_effect(user, skill)
    seph_skillusecntr_se(user, skill)
    if Skill_Variable_Counter.has_key?(skill.id)
      $game_variables[Skill_Variable_Counter[skill.id]] += 1
    end
  end
end

Just fill the Skill_Variable_Counter hash with skill_id numbers and the variable ids with the variables that will increase by 1 after each use.
 

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