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.

Armor with attack power

I was working on my project, when it occurred to me, you can't have armor with attack power, or weapons with evasion and defense power. I know it can be down with scripting, but I've been looking around in the scripts and I can't figure out how to add those onto specific weapons. Does any here know how?
 

e

Sponsor

Now, I don't exactly remember how it all works out, and I don't have access to the help file nor the program (so I'll verify when I get home), but I believe you could edit the item class (RPG::Item? RPG::Weapon? I don't remember) and eventually add your own properties.

I'll look into it when I get back home and see if item equipment is generalized and all you have to do is add properties.

Of course, since you can't modify the database tool, you'd have to assign the stats for each item manually in a script.
 
I make this little code, I hope works :). (Tested)

Code:
#==============================================================================
# ** RPG::Armor
#==============================================================================

class RPG::Armor
  #--------------------------------------------------------------------------
  # â—
 

e

Sponsor

That's pretty much it. I assume the hash's key is the item's ID and the value is the stat addition.

I couldn't find where you used the default though.

So maybe something more like:
Code:
class RPG::Armor
  #--------------------------------------------------------------------------
  # â—
 
Maybe you have another scripts that deals with my modifications...if you have, post the list here.  (Or see my examples)
___

@etheon: The default method is automaticaly add to the hash, you can put a 'default' attack for all non-defined objects, so it's not neccesary to make a ternary operator.
 
if you want weapons with evasion, just have them add to your characters speed total

armor with attack power can just be an armor that adds to strength.

you dont really need a code.
 

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