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.

Newbie needs help with simple weapon script.

Trying to learn with just the help file is hard enough, and most tutorials just confuse me more.

Trying to make simple script that multiplies damage by wielders level.
Code:
class Game_Actor < Game_Battler
 
#===============================================================================
# For weapons that you want the attack value to be modified by the wielder's level,
# put the weapon number in Lvlweaponupgradearray.
#===============================================================================
  
Lvlweaponupgrade = [33,34,35]

alias spc base_atk

def base_atk
  weapon = $data_weapons[@weapon_id]
  for q in 0...Lvlweaponupgrade.size
    if weapon == Lvlweaponupgrade[q]
      $game_temp.message_text = ("Let's do this!")
    else
    end
  end

  spc
  weapon = $data_weapons[@weapon_id]
  for z in 0...Lvlweaponupgrade.size
     if weapon == Lvlweaponupgrade[z]
       return ((weapon*@level)/2)
     else
       return weapon
     end
  end
end
end
Tells me it cannot convert Rpg::Weapon to integer, and when printed gives me many values describing the equipped weapon. I want to get the @id part of the weapon to be tested in the loop. Also, tell me if i aliased wrong, trying to learn that too.
 

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