I had an idea pop in my head, and I am trying to materialize it through brute force starting from 0 knowledge and I chose to use this base as it provides a lot of content for me to work with.
I don't really know what I'm doing, but I was wondering if someone could help me.
I am interested in recoloring items, and to do that, for the server, I defined 3 files in items-json, the placeholder, noted, and item itself. I added the item itself and noted item into item_definitions.json, and then I added the actual recoloring of an existing item into the itemdefinition.java.
When I launch the fileserver, client and server, everything seems to work perfectly. It's just whenever I log in and spawn the item. The client freezes, and it persists when I restart the client. I ultimately fix it by removing it from my inventory. I'm getting this error:
java.lang.ArrayIndexOutOfBoundsException: Index 28790 out of bounds for length 28790
I will add that I did adjust the item definition limit to be like 33000, so I thought that would solve this issue, but it's most likely a client side issue and not a server side issue.
case 28790:
final var rpb = ItemDefinition.lookup(1127);
itemDef.name = "Recolored Rune platebody";
itemDef.inventoryModel = rpb.inventoryModel;
itemDef.maleWield = rpb.maleWield;
itemDef.maleWield2 = rpb.maleWield2;
itemDef.femaleWield = rpb.femaleWield;
itemDef.femaleWield2 = rpb.femaleWield2;
itemDef.modelZoom = rpb.modelZoom;
itemDef.modelRotationX = rpb.modelRotationX;
itemDef.modelRotationY = rpb.modelRotationY;
itemDef.modelOffset1 = 0;
itemDef.modelOffset2 = 0;
itemDef.itemActions = new String[5];
itemDef.itemActions[1] = "Wear";
itemDef.itemActions[4] = "Drop";
itemDef.recolorTo = new short[]{(short)62207, 0};
itemDef.recolorFrom = new short[]{75, 57};
break;
}
Another personal issue of mine is finding the right number to color items. I used
@rebecca 's
model editor to attempt to get a hex code from the colors provided. I believe 75, 57 is the color of the base model every platebody uses, but whenever I'm given a huge number color code it presents an error in Intellij, and tells me to put (short) in the number. Which gets rid of the error. I'm not sure if im doing this right tbh.. I saw there were negative values in the itemdefinitions.java recolors for other items, so I think I might be doing it incorrectly.
https://rune-server.org/threads/rs2-color-picker-for-recolors.666477/ I've been using this to convert exact hex codes into the number I need. For secretive reasons I don't want to reveal at the moment, these colors numbers need to be exact, and colors already found in game in other items. My issue is finding a way to get those colors from a specific item, so I can recolor this platebody to that specific color.
Sorry, I probably could've written this post shorter, I just want to provide context incase it may spark some advice or ideas on how I could achieve this.
To sum it up, is there a way I can increase the item definition limit for the client to support recolors and not adding anything to the cache. I saw Jire made something called RuneColor but I am quite dumb and don't really know how to actually use it, but it looks like it might be handy.
I'm quite disheveled at the moment so I'm sorry if this is incoherent. I probably shouldn't be dabbling in this kind of stuff but for some reason I can't let this idea of mine get out of my head.