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.

How do I make a weapon fron script and add it to the databass?

I want to maker a random enchant weapon system. For instance, the hero will hold the specific sword, lets say a longsword, and then he uses enchant weapon spell. How do I make it duplicate the weapon and and an enchanment? Such as longsword of agility + 2 or longsword of fire?
 
Maybe something like:
Code:
$data_weapons.push(RPG::Weapon.new)

You have to set the attack power, price, etc. manually such as:

Code:
$data_weapons[id].atk = n
$data_weapons[id].price = n
 
Well, the most efficent way would be to call out a new item, then assign properties to it.

Code:
weapon = RPG::Weapon.new
# Now, look in the help file under RGSS - Game Library, Data Structure, Weapon
# Simply use: weapon.attribute = whatever for all stats

Get my virtual database script.

Then, add your newly created weapon, and add it to data weapons.
Code:
$data_weapons << weapon

Then, with the virtual database, use (I don't remember the exact syntax), something like:
Code:
$game_virtualdb.data_weapons = $data_weapons

It will save the weapon for just that save file into your database object for weapons.
 

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