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.

[Resolved]Attack Stat that levels up

What I'm trying to do is fix it so that the Attack stat is always equal to the actor's level. So if you're level 94, the Attack stat should be 94, and so on.

I've tried using this script here:
http://www.rmxp.org/forums/local_links.php?catid=31&linkid=511

What happens there though is that when someone levels up, there is an error involving the .inc_level function.

Since I'm only looking to add one to a particular variable, I'm guessing it's merely a case of knowing the right syntax, right?

Thanks in advance.
 

Anonymous

Guest

Do you just want it equal to actor level, period, or actor level plus weapon attack?

If just level, replace this method:

Code:
  #--------------------------------------------------------------------------
  # * Get Basic Attack Power
  #--------------------------------------------------------------------------
  def base_atk
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.atk : 0
  end

With:

Code:
#--------------------------------------------------------------------------
  # * Get Basic Attack Power
  #--------------------------------------------------------------------------
  def base_atk
    return @level
  end

If plus weapon atk, replace with this:

Code:
#--------------------------------------------------------------------------
  # * Get Basic Attack Power
  #--------------------------------------------------------------------------
  def base_atk
    weapon = $data_weapons[@weapon_id]
    return (weapon != nil ? weapon.atk : 0) + @level
  end

EDIT: And script fixed. Stupid typos.
 

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