RMMV Showing variables linked to an item in the description (YEP Item Core)

Thornton

Villager
Member
Joined
Jul 17, 2015
Messages
7
Reaction score
1
First Language
English
Primarily Uses
RMMV
Hi everyone, I'm using this script to show evals in the weapons and armor descriptions.

The weapons and armors I'm using have a randomly generated weaponDamage variable attached to them during the item creation process utilizing Yanfly's Item Core.
What I'm trying to do is show the generated item's variables in the eval, so when the player hovers over the item (not equip it) using the arrow keys, it'll show the called variables on creation.

As an example, utilizing a random formula I made up:

JavaScript:
<On Creation Eval>
item.ilvl = 5;
item.weaponDamage = 20 + Math.floor((item.ilvl * Math.random()*5)**1.02);
</On Creation Eval>

If say, item.weaponDamage spat out 32, I would like to display it in the description without having the player actually equip the weapon somehow, basically making the value based on the weapon/armor instead of actor.
Something like
JavaScript:
+#{item.weaponDamage} weapon damage
I get a "item is undefined" error so I'm not sure how to exactly do this.

Sorry if this sounds confusing.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,063
Reaction score
2,323
First Language
English
Primarily Uses
RMMV
Hmm, this might not be very straightforward; independent weapons basically add themselves as a new element in $dataWeapons; at the point of the code where the eval happens "item" doesn't exist because it's an addition to the function that converts escape characters, so you need to reference the item directly. But you don't know its ID at runtime because it's generated when the item is created. I'll have to think about this one.
 

Latest Threads

Latest Profile Posts

Hey everyone! No Studio Blue RPG Maker Critiques Stream today! But you can always check the playlist for old streams you've missed!

I ran out of paper sheets to draw, so I guess I'm forced to do digital for a while now...
x778xt8.jpg

Still haven0t found a colouring style that I like :kaoswt:
woods.pngshop.jpgboss.jpgRoom.png

Mapping is becoming so much easier!
FirestormNeos wrote on Neikoku's profile.
the cat in your profile picture is adorable
Are the default-size "chibi" sprites really a bad thing for a project? I'm not planning to sell my game anyway but I was wondering if they were as hated as some videos seem to claim...

Forum statistics

Threads
111,431
Messages
1,061,081
Members
144,797
Latest member
gh05tinblack
Top