MZ Looking for some specific database script calls

Hi folks,

I'm setting up a system to display info about items the player will craft, and have run into some issues with displaying certain weapon/armor details.

I've found all the basic stuff, like script calls for all the standard 8 parameters, damage type and item description, but I have run out of leads for displaying the following stats:

- Element rates
- Ex Parameters
- Sp Parameters

Are there script calls to get these values for a specific weapon/armor in the database?

Thanks!
Analyze this in the game's DevTools:
$dataWeapons

In this object, you will be able to receive the values you need for the item you select by ID:
$dataWeapons[ID Item].traits

Each parameter is a Traits object:
{code: Type, dataId: Element ID, value: percentagem}

code: 11 -> Element Rate
code: 22 -> Ex-Parameter
code: 23 -> Sp-Parameter

Examples of values in percentage:
1 or 1.0 = 100%
0.5 = 50%
0.15 = 15%
0.87 = 87%
Analyze this in the game's DevTools:
$dataWeapons

In this object, you will be able to receive the values you need for the item you select by ID:
$dataWeapons[ID Item].traits

Each parameter is a Traits object:
{code: Type, dataId: Element ID, value: percentagem}

code: 11 -> Element Rate
code: 22 -> Ex-Parameter
code: 23 -> Sp-Parameter

Examples of values in percentage:
1 or 1.0 = 100%
0.5 = 50%
0.15 = 15%
0.87 = 87%
This is very helpful, thanks!

I am a little confused about how exactly I would format all of this for a script call, though.

Would you be able to give an example of how I would display the hit rate (sp param 0)? I could probably figure out how to apply it to all of the others with that.
As shown, these are Objects that return values. You can save them in game variables through the Script field. You can also check for their existence using Conditional Branch:
Code:
◆If:Script:$dataWeapons[49].traits[2].code == 23
  ◆Control Variables:#0001 = $dataWeapons[49].traits[0].value*100
  ◆
:End
(I multiplied the value by 100 because RPG Maker variables only work with integers)

I could even create a plugin with several sub-functions for reading and editing, as well as using a For loop to check if the equipment actually has a specific "Trait" or not...

But I find providing support an unrewarding service in terms of compensation, so I don't have time for that. This is proven by the fact that it usually doesn't get any "reactions".

You can read about FOR here:

Good luck

Original thread: https://forums.rpgmakerweb.com/threads/looking-for-some-specific-database-script-calls.180969/