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.

In-Game Item/Weapon/Armor Altering

Now I was wondering..is it possible to use a script to alter a weapon or armor or item while in game? This is to save space...

Like if i wanted a short sword to have more attack power, a script is called in game and the item short sword has gained 2 atk pwr, and now has a total of 7 atk pwr...is this even possible to do?

(And you may say that all the short swords in the game will be altered...that doesnt matter since in my game each player has his/her own unique set of weapons and armor and such...)

thx in advance

AoW-Nitewraith
 
You can use the SephirotSpawn's Event Spawner, its very usefull to save a lot of space or to transforms for example a Bronze sword into Iron Sword (you can change all the parameters of all the objects of the database).

You can find it in the Seph's TestBed
 
That actually is not what I am looking for...

I was in the Virtual Database, but it did not seem to have what I wanted...

So lets say we are in the game playing...and you get a weapon..call it Short Sword with 5 Atk dmg and +1 strength...now lets say it gets stronger or you upgrade it..is it possible to alter the stats of that item without swapping it with a different one...

If possible..use a common event that gets triggered and calls a Script...in this script it should contain something that increases the Atk Dmg field on the database for that weapon (Short Sword)...this should be possible since RMXP can be manipulated to fit a person's need....if this is not a clear request, please ask me anything to help clarify what I have requested...

Thanks!!!
 
And also to add, I hope I got the message across that what I am requesting a script that not only alters the ATK field in the weapon area, but to be able to alter anything on any field that is Armor, Item and Weapon related. I dont mind if there is elemental tags or not, for there is already a script for that, a few of them if that...

And I really need this script, it is a necessity for me to be able to continue making my games, its the only thing holding the games behind.

Thanks In Advance!!!
 
Ok..I had tried to do all that before..but I cant figure out what the strength attribute is...

I tried to do
Code:
object.name = 'Iron Sword'
object.str = 12

but I dont know what the object.str should be...

I tried object.strength but that did not work...what are the names for each stat?

object.atk is one that I figured out a while back...
object.name is one that was a defualt in the Virtual Daatbase...

what could they be?

and thanks so much for the help you are giving me Mephisto...this is much appreciated! adn the demo file is exactly right on track of what I requested!!

Now I shall keep trying to figure out what the names for the attributes are...
 
As you'll have seen the script is the SephirothSpawn's Virtual Database.;)

Well, for every Data parameter name you can see the RPGMAKER XP help archive, you can go to:

RGSS MANUAL REFERENCE/GAME LIBRARY/RPGXP DATA STRUCTURE, and search, in this case for weapon.

Code:
name 
The weapon name.

icon_name 
The weapon's icon graphic file name.

description 
The weapon description.

animation1_id 
The animation ID when using the weapon.

animation2_id 
The animation ID when on the receiving end of the weapon.

price 
The weapon's price.

atk 
The weapon's attack power.

pdef 
The weapon's physical defense rating.

mdef 
The weapon's magic defense rating.

str_plus 
The weapon's strength bonus.

dex_plus 
The weapon's dexterity bonus.

agi_plus 
The weapon's agility bonus.

int_plus 
The weapon's intelligence bonus.

element_set 
The weapon's element. An Elemental ID array.

plus_state_set 
States to add. A State ID array.

minus_state_set 
States to cancel. A State ID array.

If you want to change anything, you need to put a:

object.X = Value or string, and for the ID of the weapon only change the [] and the () Number, but it's not difficulty to use.

for strenght for example:

Code:
object.str_plus = your value
But obviusly acredit to the God Sephirothspawn for this pretty system :yes:.
 
Yeah I actually had figured it out like 10 minutes after my last reply...and with this..a person could make a rally nice crafting/blacksmith script..perhaps i will arise to the challenge...

Thanks alot for your help Mephisto...and I wont give up Reaper!! I got a good game already in the works as we speak..only got 10 minutes of gameplay..but it should turn out real good...despite the usage of the graphics that came with the Program...wont have too many origional things..but thanks to this script stuff, I can make a dream possible...

I Appreciate the help guys..thx..

AoW-Nitewraith
 
Hmm...I was messing around and I found a problem...

I try and use the code, then I put this in:
Code:
object = $game_virtualdb.data_weapons(10)
object.element_set = 1 
objects = $game_virtualdb.data_weapons
objects[10] = object
$game_virtualdb.data_weapons = objects
or
Code:
object = $game_virtualdb.data_weapons(10)
object.element_set = [1]
objects = $game_virtualdb.data_weapons
objects[10] = object
$game_virtualdb.data_weapons = objectsCODE]

Neither Work...

This is just a tid bit of the whole code...but for some reason, the RGSS doesn't like the code at all and exits the game with an error message that says:

[CODE]ArgumentError occured while running script.
wrong number of arguments(1 for 0)

Explain to me why this script isnt working...or maybe I just typed the code wrong..but I have tried again and again...changing the script over and over...and yet it still does not work...

All I want to do is add the Fire Element to a weapon....which is the first element...and also...if I do use the 1 as the value..does it erase the other values? (Which means...if I add Fire to the weapon, does it take of the other elements?)

Scripting can be a tad annoying..sheesh
 
O, I you need to put atention to the plural and singulars@_@

Code:
[COLOR=Red]object = $game_virtualdb.data_weapons(10)
object.element_set = 1 
objects = $game_virtualdb.data_weapons
objects[10] = object
$game_virtualdb.data_weapons = objects[/COLOR]

For example, when says 'object' use singular words, and when says 'objetcts' use plural words. In that case use this:

Code:
[COLOR=Blue]object = $game_virtualdb.data_weapon(10)
object.element_set = 1 
objects = $game_virtualdb.data_weapons
objects[10] = object
$game_virtualdb.data_weapons = objects[/COLOR]

and Wuala.:thumb:
 
Sheesh, one thing is all that needed fixed...lol...

*Smacks Forehead*

Well that is one step closer to a weapon and armor cusomization thing for my game...heck yes!!!

I will be shunned by any scripter here for I dont really use that much of my own scripting..im using common events and such to do the customization..but I think with my growing (And dominating;)...sigh...:() scripting knowledge..I shall make a script that handles this...8-)

How hard would it be to make a script like this? Seriously..if I put some effort into it..do you think it could work out?

Thanks a bunch for all this help Mephisto, couldn't have done alot of this without your help!!! :thumb:
 
Alright, I've figured out how to work this, and I'm eventing my system...

But I'm getting this error on start up now:

Script 'Virtual Database' line 662: NoMethodError occurred.
undefined method 'update_database' for {}:Hash

Here's line 662:
$game_virtualdb.update_database


It works fine in the demo, but I don't understand why it won't work for me. Could another script be clashing with it? And if so, can anyone give me a general idea of what type of script would cause it?
 

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