• Do not use Works in Progress as a way of avoiding the releases system! Works in Progress can be used for sharing early betas and for getting suggestions for improvement. Releases of finished content are not allowed in this forum! If you would like to submit a finished addon, click here for instructions on how to do so.

Custom Skin Colors : Starter Guide

Zipper

:hildaGun:
Retired Staff
Just to potentially cull the many, MANY "how do I make custom color" questions that I'm sure we'll be receiving, here's a really fast tour on what to do.

You can approach this in two ways : Lua or SOC. SOC is faster and doesn't initialize the Lua interface, but Lua is much more flexible, and allows for fun stuff like animated skin colors. Personally, I'd always go with Lua.

Lua:

Make a text file, and add the following code into it.

Code:
freeslot("SKINCOLOR_CUSTOMNAME")
skincolors[SKINCOLOR_CUSTOMNAME] = {
    name = "CustomNameThatIsVisibleOnPlayerSetup",
    ramp = {146,147,148,149,150,151,152,153,154,155,156,157,158,159,253,254},
    invcolor = SKINCOLOR_ORANGE,
    invshade = 9,
    chatcolor = V_BLUEMAP,
    accessible = true
}

Here, "freeslot" allows you to register the variable name of your skincolor, so you can define it below, and perhaps even modify it using Lua code. The "CUSTOMNAME" part can be your name of choice. Ensure that it's in all caps for visual consistency.
The "name" field is what will be seen in the Player Setup menu, and what you will use in the console to switch to that color (e.g. "color red").

The "ramp" field is the most complex part. It represents the range of colors you want to use for your skincolor, going from lightest to darkest. All of these numbers may seem intimidating, but they're simply the values corresponding to the colours in the SRB2 palette.

Palette.png


Here are the values that you can pick from. Try to avoid picking 255, as it's the color used for transparency most of the time.

https://wiki.srb2.org/wiki/Palette The wiki page itself, in case you want more information about Translucency values or the PLAYPAL.

The "invcolor" field is the desired "opposite" color to your own skincolor. You might want to keep a color wheel nearby, to easily find the color opposite of your own. This is important for Goal Signs and Save Game backdrops.

https://wiki.srb2.org/wiki/List_of_skin_colors This page allows you to see all skin colors in the vanilla game. You MUST pick a SKINCOLOR_ constant.

The "invshade" field is the number deciding WHICH value of the invcolor's ramp you should take from. As seen by the above example, each skincolor has 16 color values assigned to it in its ramp. The "invshade" field chooses a specific one to be used for Goal Signs/Save Games. Ranges from 0-15, NOT 1-16.

The "chatcolor" field decides what video flag to assign to your name when speaking in Multiplayer. There are a list of constants for this, so you can't just invent a new text color all willy-nilly.

https://wiki.srb2.org/wiki/Video_flags#Color This link will give you the possible options.

The "accessible" field determines whether the player can access this color from the Player Setup menu, or from the console. By default, you should always want this to be true.

Lastly, rename the file's extension to ".lua". If you can't see the file's extension, look at the top of your file explorer, click the "View" tab, and press "Show File Extensions" near the top right of the window. Once you have successfully renamed your .txt to .lua, you're set.


SOC:

SOC follows a very similar format. Make a new text file, and paste the following code to it:

Code:
FREESLOT
SKINCOLOR_CUSTOMNAME

SKINCOLOR SKINCOLOR_CUSTOMNAME
NAME = CustomNameThatIsVisibleOnPlayerSetup
RAMP = 146,147,148,149,150,151,152,153,154,155,156,157,158,159,253,254
INVCOLOR = SKINCOLOR_ORANGE
INVSHADE = 9
CHATCOLOR = V_BLUEMAP
ACCESSIBLE = TRUE

The main difference is the lack of quotes, and using capitalizations.

Rename this file's extension to .soc. Follow the same procedure I mentioned above if you cannot see the ".txt" extension at first.

Some notes:

-You can freeslot/define multiple colors.
Code:
freeslot(
"SKINCOLOR_CUSTOMNAME1",
"SKINCOLOR_CUSTOMNAME2"
)

FREESLOT
SKINCOLOR_CUSTOMNAME1
SKINCOLOR_CUSTOMNAME2

Both of these are perfectly acceptable. Make sure to put a comma after each skincolor in Lua, except the last one. You can then define them individually in the same file.

-If you have Lua knowledge, custom skincolors are editable in real time. By making use of a ThinkFrame hook, it's possible to modify a custom skincolor's ramp values constantly, giving it an animated look. SOC does not allow you to do this.

The invcolor field can be one of your own custom skincolors.

That's all for now, I'll update this page with more info if necessary.
 
It's also possible to make custom supercolors. To do so, you'll need to create 5 new colors, each with the name value set to "Super Color 1" through "Super Color 5". These are typically ordered from brightest to darkest.

7U9MEUU.png


After that, set the supercolor in your character's S_SKIN or P_SKIN to the same color you defined previously.

cCLqnA1.png


If done correctly, the results should look like this:

srb20002.gif
 
Last edited:
When i tried to load my supercolor it said that the first was not found
 
Have you made sure the name parameter on the first supercolor ramp is set to "Super <color> 1"?

If not, that's probably your issue. If you need any more help on this matter, just say so.
 
Please keep in mind that Animated Custom Colors have a tendency to cause Memory leaks in the current Version of SRB2 (2.2.6) i advise not using mods with them until this is fixed.
 
I honestly don't get why there's a comment on the skincolor tutorial that's literally the same tutorial ._.

Anyway, picking color 255 as part of your ramp will NOT give a transparent skincolor.
 
I tried the super colours one. I'm guessing super colours requires lua and counts as an animated skin colour? Because trying it as a SOC failed spectacularly
 
Super colors should work fine in SOC, but either way they can be pretty finicky about how they're defined - can you post your script and any errors you might be getting here so we could take a look?
 
Super colors should work fine in SOC, but either way they can be pretty finicky about how they're defined - can you post your script and any errors you might be getting here so we could take a look?


Ah sorry, forgot to edit. I figured out the issue - I thought Super was part of the name so I was putting in the color for super as Super ____ instead of just ____
 
Now it's possible to edit vanilla skin colors. This is an example: Changing White's ramp

Code:
skincolors[SKINCOLOR_WHITE].ramp = {0,0,1,2,3,3,4,5,6,6,7,8,9,9,10,11}
 
I feel like this should be a pinned thread, and not audio requirements for... a version of the game from six years ago...
 
It's also possible to make custom supercolors. To do so, you'll need to create 5 new colors, each with the name value set to "Super Color 1" through "Super Color 5". These are typically ordered from brightest to darkest.

7U9MEUU.png


After that, set the supercolor in your character's S_SKIN or P_SKIN to the same color you defined previously.

cCLqnA1.png


If done correctly, the results should look like this:

srb20002.gif




i made dark sonic colors but what should be the name?
 
Great! Thanks for this! Sadly, it seems to be impossible for me to add them into netgames. Keeps saying the "sendcolor limit reached".
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top