Possible upgrade to YEP_ItemCore? [resolved]

I have Yanfly's Item Core and I was wondering if there was a way to either edit it or come up with a script in conjunction that would allow an item(s) color to change based on the degree of random variance within the item core. i.e. if a weapon rolls mid level variance then the color of the item would change to a color I choose, if it rolls more high end on the variance it would be a different color? I understand that the more stats you have on an item would make this a bit harder to calculate since they all vary per item. If you can help, thanks!

EDIT: I'd want it to change the item text color, not the icon color.
The answer to your question is, there is a way.
It would be possible, but very complicated. The game uses iconsets to draw items, so if you want the item to change colors, you would need to have different colors of the same item in the iconset. You can also maybe play with item hue, but that would look ugly.
Color of the icon or color of the text?
Color of the text. Basically making it a rarity system. If it rolls high end on the variance the color might be purple for epic or low end (negatives) would make it grey.
If you can wait a day, I can do an addon for that.🙂
Take all the time you need, my friend. I appreciate any help I can get as I'm more into the graphic art aspect of design. Also, if it helps maybe you can make the rarity fall only on the variance of the major stats, such as ATK, MAT and DEF. I'm not sure what would be easier.
Okay, here is the link to the addon https://www.dropbox.com/s/c4ongeaam0kra5n/WAY_X_ItemCoreAddon.js?dl=0

You can add this notetag to your items, weapons, armor. For example:
<Custom TextColor Eval>
var sum = item.params.reduce(function (a, b) {
return a + b;
}, 0);
if (sum < 20) {
textColor = 14;
} else {
textColor = 27;
}
</Custom TextColor Eval>

sum is the total sum of all stats the item has. If that value is below 20 the textColor will be 14, if not 27.

If you want only specific statsm, you could do:

var sum = item.params[id] + item.params[id]...
0 - maxhp
1 - maxmp
2 - atk
3 - def
4 - mat
5 - mdf
6 - agi
7 - luk

If there are any issues or bugs, please let me know.
Alright, I've tested it and apparently I have it conflicting with another script I think. It works, but for some reason it's naming everything "true" instead of the name the item was given. I've tried moving the script up and down a few times and the only thing I can think of is turning off scripts one at a time till I figure it out. Also, I'd like to be able to have multiple color selections instead of just two. I tried this below but I got an error. I think I might be missing something lol.

<Custom TextColor Eval>
var sum = item.params.reduce(function (a, b) {
return a + b;
}, 0);
if (sum >=6) {
textColor = 13;
} else {
if (sum =5) {
textColor = 1;
} else {
if (sum <=4) {
textColor = 0;
}
</Custom TextColor Eval>
The if else statements you used are formatted wrong. Here's the correct format for what you were trying to do:

Code:
<Custom TextColor Eval>
var sum = item.params.reduce(function (a, b) {
return a + b;
}, 0);
if (sum >=6) {
textColor = 13;
} else if (sum <=5) {
textColor = 1;
} else if (sum <=4) {
textColor = 0;
}
</Custom TextColor Eval>
Yeah, what @Naveed should work fine. You can have as many different textColor checks as you want.
The if else statements you used are formatted wrong. Here's the correct format for what you were trying to do:

Code:
<Custom TextColor Eval>
var sum = item.params.reduce(function (a, b) {
return a + b;
}, 0);
if (sum >=6) {
textColor = 13;
} else if (sum <=5) {
textColor = 1;
} else if (sum <=4) {
textColor = 0;
}
</Custom TextColor Eval>
Ah. Thanks so much. I now have a much larger scale of colors to work with and so far it works perfectly aside from the "true" weapon naming thing.
@Braxillian I fixed that issue, download the plugin again.😅
Yeah I turned everything off except Yanfly's and your script and it still happens and I noticed something else that it was doing too. It was removing the names of my skills from the skill menu. The icons are there, but not the names.
@Braxillian Yeeah, download it again ..sry there was another issue. 😅

I should test my stuff more carefully. 😅
Thanks so much. It seems to be working perfectly now. I appreciate you taking the time to help me.
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/possible-upgrade-to-yep_itemcore-resolved.79794/