Thread: How to recolor an item and find the color you are recoloring.

Results 1 to 6 of 6
  1. #1 How to recolor an item and find the color you are recoloring. 
    Extreme Donator

    nbness2's Avatar
    Join Date
    Aug 2011
    Posts
    687
    Thanks given
    268
    Thanks received
    132
    Discord
    View profile
    Rep Power
    405
    In Runescape, you can color text on interfaces using <col=HEX_CODE>*text*</col> or <col=number>*text*</col>, but in the cache's itemdefs, colors are defined using a Short. You can use this method if you want to create some recolors or dont have the know how on how to add models, but overusing this recolor method will eventually have effects on a client's performance, so beware.

    Now, the most easily understood color scheme (or color space\color gamut if you want to sound fancy) is RGB\RGBA. RGB\A has existed in nearly the same format since it was conceived, and it is quite simple to look at and understand.

    Here's an example



    The black characters represent the alpha value. The lower the alpha value, the more transparent the color is.
    The other characters represent their specific color values, higher being more of that color's presence in the current color.

    If RGB were to be a 3d graph, here is what it would look like (ty wikipedia)
    Spoiler for image:


    You may recognize this if you know how to color your yells in a servers chatbox (if allowed of course). Important to note, the runescape chatbox doesn't care about alpha value, so you only ever have to put in 6 characters.

    Code:
    ::yell <col=FF0000> hi </col>
    ...
    nbness2: hi
    Back to the main point. The runescape model renderer uses a different color space in a customized size to render colors on models, it uses the HSL (Hue, Saturation, Luminosity) color space (at least up to client revision 718) and takes up 16 bits.

    Here is how HSL is represented in the data

    Spoiler for image:


    You can see that I only used 1s and 0s, and thats because this 16 bit HSL format has an irregular amount of bits for each value and it would be extremely inconvenient trying to find out the values solely from looking at the hexadecimal values like you can easily do with RGB.

    Take a look back at the RGB cube, the HSL graph is quite different.

    Spoiler for image:


    This is how runescape reads colors, using a graph very much like this.

    Now, here's some code you can use to convert your RGB to HSL, or RGB to Short

    Repl.it link HERE. (Repl.it is a free easy online way to run python code, you don't have to download python, don't have to trust the code because it won't be running on your machine it runs on repl.it's machines probably in sandboxes).

    Now, how do you use this?

    The first way I will show you is using RSCEdit, a really neat tool made by @Admiral_Slee that you can use to edit nearly all 508+ revision caches almost flawlessly, osrs coming soon i think.

    Here, I am looking at the data for Green dye (id 1771). Most of the dyes using this same model are actually the same model, but runescape's itemdefs allow you to change specific colors if you know the color you want to change. The default color that is changed to green is color 61. Putting that in to my converter returns a really boring grey (123, 123, 123) or #7B7B7B.

    Spoiler for image:


    And lo and behold, putting 22449 in to the converter returns the same vivid green as seen on Green dye TV.

    Say I want to change this green dye to a... dark cyan dye... uh turqoise thats the one. picking a roughly turqoise color on any ol color picker with an RGB value box gave me (55, 163, 190). Put that in to the ol converter, you should get 25169. Replace the 22449 with 25169.

    Spoiler for image:


    boom its turqoise. it will probably look different in game, as the ingame renderer has some rendering differences compared to the rscedit renderer.

    But nbness, what if i don't have $25 to use RSCEdit to edit my cache to make a lime whip? I gotchu.

    Somewhere in your client, if you have custom items there should be a section where you can define custom itemdefs (if your client is modified enough to allow it, that is. not all clients may have this ability).

    Your custom itemdefs should look similar to this. i took this off a google search, but it said lime whip so im sticking with it. The red lines are the important ones here.

    Code:
    case 15298:
    	itemDef.actions = new String[5];
    	itemDef.modifiedModelColors = new int[1];
    	itemDef.originalModelColors = new int[1];
    	itemDef.actions[1] = "Wield";
    	itemDef.modelID = 5412;
    	itemDef.maleEquip1 = 5409;
    	itemDef.femaleEquip1 = 5409;
    	itemDef.modelZoom = 840;
    	itemDef.modelRotation1 = 280;
    	itemDef.modelRotation2 = 0;
    	itemDef.modelOffset1 = -2;
    	itemDef.modelOffset2 = 56;
    	itemDef.anInt204 = 0;
    	itemDef.name = "Lime Whip";
    	itemDef.description = "A Lime Abyssal Whip".getBytes();
    	itemDef.modifiedModelColors[0] = 17350;
    	itemDef.originalModelColors[0] = 528;
    	break;
    itemDef.modifiedModelColors = new int[1]
    itemDef.originalModelColors = new int[1]
    [code]
    These 2 lines set the amount of colors you are able to change. Right now, it is set to 1, but if you want to change 2 colors, change the 1 there to 2. 3 colors to 3. etc.

    Code:
    itemDef.modifiedModelColors[0] = 17350
    idemDef.originalModelColors[0] = 528
    528 is the original color, and looks like its the dark part of the whip. They are replacing color 528 with color 17350, which is a green.

    If you want another color, add another line but with a number up in the brackets next to the modifiedModelColors and originalModelColors e.g. originalModelColors[1], modifiedModelcolors[1]

    The numbers in the brackets must match if you are wanting to replace the colors correctly.

    Now, how do you find the color? This will require you to have some sort of tool to dump or extract models from a cache, as well as a tool called (click here for) DatMaker and a program called (click here for) MetaSequoia. My extractor tool is RSCEdit.

    For an example, I will be using the Divine Sigil.

    The first step is to extract your model from your cache into .dat format and open it in DatMaker. It should look like this.

    Spoiler for image:


    Now, click File, click Export, click MQOv2. This creates a file where your previous file is that can be opened in Metasequoia. The file will be named the same thing but with a V2 at the end and a .MQO extension instead of a .DAT extension.

    Now open Metasequoia and open your newly created file, your screen should look similar

    Spoiler for image:


    in the bottom right hand side, you see a bunch of colors with numbers next to them, these are called Materials. Scroll all the way to the bottom of that and you will find the materials you need to investigate. Notice how I have 2 materials, that is because the divine sigil isnt actually shaded with lighting, its because the divine sigils sides are different colored materials.

    Spoiler for image:


    the important part is to look at the numbers, these are the numbers you want to put in the originalModelColors array. If there are a lot of different colors, I do advise you to change the material colors (the name wont change, don't worry) so you know exactly which color you are changing and where it will be changed.

    say i wanted to change my divine sigil in to a lime sigil, I would add 20643 to originalModelColors and then I would find the RGB for a really obnoxious lime color say (85, 255, 0) or 18431. This is what it would look like in the client, without the skeleton lines and dots and whatever.

    Spoiler for image:


    Hope you enjoy
    d


    KT/JAVA - NBX 637 - HERE!
    KT - Drop table 4: Flexible, Powerful - HERE!
    KT - Command: Simplify writing commands - HERE
    KT - NbUtil: Make your kotlin easier - HERE
    KT - Hopping Islands: From Java to Kotlin - P1 - P2 - P3 - P4 - P5
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    ✥Augury RSPS - Soon✥

    TeJay's Avatar
    Join Date
    Jul 2017
    Posts
    613
    Thanks given
    199
    Thanks received
    266
    Discord
    View profile
    Rep Power
    1480
    Well guess it might be useful for people who can't recolor an item.
    Ty for the contribution.
    Reply With Quote  
     

  4. #3  
    Contributor


    Join Date
    Dec 2009
    Posts
    774
    Thanks given
    365
    Thanks received
    447
    Discord
    View profile
    Rep Power
    929
    I should add a color picker in there.
    link removed
    Reply With Quote  
     

  5. Thankful user:


  6. #4  
    Extreme Donator

    Patrity's Avatar
    Join Date
    Jul 2008
    Age
    28
    Posts
    937
    Thanks given
    174
    Thanks received
    315
    Discord
    View profile
    Rep Power
    882
    Thank you for your contribution. R-S needs more up-to-date guides. This helps.
    Free map releases: HERE



    Reply With Quote  
     

  7. Thankful user:


  8. #5  
    Registered Member

    Join Date
    Jul 2016
    Age
    22
    Posts
    127
    Thanks given
    202
    Thanks received
    64
    Discord
    View profile
    Rep Power
    303
    Interesting tutorial, thank you for your contribution!
    Reply With Quote  
     

  9. Thankful user:


  10. #6  
    Registered Member
    Join Date
    Nov 2011
    Posts
    8
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Bumping this old Thread. What would one do if the mat in metaseq shows a number that exceeds 32767?
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 3
    Last Post: 05-31-2016, 01:19 AM
  2. Replies: 8
    Last Post: 09-24-2013, 05:34 AM
  3. [PI] How to add an item to the ground?
    By Crispytoast in forum Help
    Replies: 3
    Last Post: 12-10-2010, 06:46 PM
  4. Replies: 27
    Last Post: 03-30-2009, 09:51 PM
  5. how to give an item when you pk someone
    By Vox' in forum Requests
    Replies: 8
    Last Post: 12-30-2008, 11:56 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •