HELP! I want to add text to an item´s description by code.

Hi!

So, I have my item´s (armor, weapon, etc) description defined in the standard database box. If a condition is met, I will add some text to it. Im using Yanfly´s item core and equip core.

I was able to accomplish (partially) what I need, I found the function
Code:
Window_Help.prototype.setItem
on the file rpg_Windows.js where I added
Code:
this.setText(item ? item.description + " TEST" : '');
and it does what I want. so when I go to my menu, then items, I see what i want (the word TEST added to the description):
cap 1.png


My problem is, when i go to Menu, Equip, I dont see the TEST word added to it:
cap 2.png

Im sure its because its drawing the description from somewhere else. I searched in yanfly´s equip core, item core, and rpg_scenes and couldn't find it, so maybe one of you can guide me in the right direction.

Thank you!
When you're trying to edit things, it's not a good idea to edit the base code files themselves.

The two main reasons for this are:
1 - It's better to have what you've changed separate, so you have it easily referenced and still have the reference of what it was originally.

2 - If you have any plugins, they may overwrite the same functions you're trying to, which is what I suspect is happening here.

Now it's also possible that the equip screen is referencing a different window type, I haven't looked. But the first thing for you to try is to copy your changes into a new *.js file and include it as a plugin beneath any of the Yanfly. I would bet that the Equip Core is overwriting some of the window stuff.

I also think there's probably a better way of going about what you want, but try that first.
Looks like you need to pull the items description and set it into your formula for each window you need it to be into. Otherwise (bound with lots of work) you have to copy/paste all description into a new .js file and pull the info from there to make sure that its in there.
Just for reference, one example of an easier path would be using Hakuen's Escape Codes and Global Text.

Write the full description of the item in your database with part of it prefaced by an eval escape code that has the conditional built in. Zero editing of game code required.

Original thread: https://forums.rpgmakerweb.com/threads/help-i-want-to-add-text-to-an-item-s-description-by-code.161632/