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 Level

I am looking for a script would add another attribute the a skill object (Level attribute). Then the player could increase the skill of the level using the point gained from leveling up or whatever.

This script doesn't have to change the base damage, atk_f etc of the skill, I just want to be able to access the skill level using obj.level in Game_Battler def make_obj_damage_value (This is for my multiple-hits script, each hit for each skill level or something similar)

I did try editing the skill module, but the skills are already setup from the database and not initialize through script >_< So I have no idea how to add another attribute to a skill object :x

PS: I really just need the extra skill attribute that can be accessed with skill.level, then I can script the rest myself ^^#

Thank you in advance!
 

poccil

Sponsor

Unfortunately, skill objects are from the data_skills array of the database, and if a level attribute is added to that skill object, problems could result if, for example, more than one battler has that skill, namely that the skill would have the same level for each battler.

Use this code instead.  It takes a Game_Actor object and the RPG::Skill object to determine the level of the respective skill.  It adds two methods to the Game_Actor object: setSkillLevel and getSkillLevel.  All skill levels are initially set to 1.

Code:
class Game_Actor
  def setSkillLevel(skillObject,level)
    @skillLevels=[] if !@skillLevels
    @skillLevels[skillObject.id]=level
  end
  def getSkillLevel(skillObject)
    @skillLevels=[] if !@skillLevels
    skillLevel=@skillLevels[skillObject.id]
    return !skillLevel ? 1 : skillLevel
  end
end
 

poccil

Sponsor

You might not be so serious there, but in case you were serious, it may seem better to actually simulate such skills in the database, since enemies don't have skills in the same way as actors do.
 

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