SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Editing

Reply
 
Thread Tools Search this Thread
Old 07-11-2020   #1
Zipper
Killda
Judge
 
Zipper's Avatar
Default Custom Skin Colors : Starter Guide

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.



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.
__________________
Quote:
<Rob> Thok is not malaria
Zipper is offline   Reply With Quote
Old 07-11-2020   #2
Katmint
 
Katmint's Avatar
Default

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.



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



If done correctly, the results should look like this:


Last edited by Katmint; 07-11-2020 at 10:37 PM.
Katmint is offline   Reply With Quote
Old 07-11-2020   #3
Aquatic Akito
The Super Mystic Guardian
 
Aquatic Akito's Avatar
Default

For the ramp option, I use a tool on the internet where you can pick your own palette and find the ramp numbers there.


https://switchkaze.github.io/tools/colors.html
__________________
A person who tries to be cool all the time.
Aquatic Akito is offline   Reply With Quote
Old 07-16-2020   #4
RDS
 
RDS's Avatar
Default

When i tried to load my supercolor it said that the first was not found
__________________
One more shot at redemption!
Run it back, we ain't done yet.
RDS is offline   Reply With Quote
Old 07-16-2020   #5
RainbowTH
Your local lua dumbass
 
RainbowTH's Avatar
Default

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.
__________________
<Rainbow> REEEEEE
RainbowTH is offline   Reply With Quote
Old 07-20-2020   #6
ThatAzazelFire
The Ghost
 
ThatAzazelFire's Avatar
Default

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.
__________________
Just the funny Plant Person

My Twitter Account
ThatAzazelFire is offline   Reply With Quote
Old 08-23-2020   #7
ErickCiberBits
 
ErickCiberBits's Avatar
Default

How you can make Skincolor :

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

Quote:
freeslot(
"SKINCOLOR_NAME"
)

skincolors [SKINCOLOR_NAME] = {
name = "Custom Name",
ramp = {0,2,4,6,7,10,12,14,16,18,20,22,24,27,29,31},
invcolor = SKINCOLOR_WHITE,
invshade = 9,
chatcolor = V_BLUEMAP,
accessible = true
}
Now save the text file and rename to lua file.

EXAMPLE :
Quote:
MySkincolor.lua
Skincolor Pallete Maker : https://switchkaze.github.io/tools/colors.html

Skincolor Pallete Example Image :

---------- Post added at 08:03 PM ---------- Previous post was at 07:58 PM ----------

P.S : 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 / NAME" 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").

---------- Post added at 08:11 PM ---------- Previous post was at 08:03 PM ----------

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.

---------- Post added at 08:13 PM ---------- Previous post was at 08:11 PM ----------

2nd - PS : I talk Spanish AND English
ErickCiberBits is offline   Reply With Quote
Old 4 Weeks Ago   #8
TehPuertoRicanSpartan
 
TehPuertoRicanSpartan's Avatar
Default

Quote:
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.
How is index 255 making skincolors transparent then? You can't, so you don't need to worry.
__________________
Quote:
Originally Posted by Silver Sonic View Post
Rude. You could at least use the releases thread and cut the cursing...
Quote:
Originally Posted by Icarus View Post
I agree with Silver on this one, could you please refrain from using cuss words?
TehPuertoRicanSpartan is offline   Reply With Quote
Old 3 Weeks Ago   #9
RainbowTH
Your local lua dumbass
 
RainbowTH's Avatar
Default

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.
__________________
<Rainbow> REEEEEE
RainbowTH is offline   Reply With Quote
Old 3 Weeks Ago   #10
antonretrojr
 
antonretrojr's Avatar
Default

Quote:
Originally Posted by RainbowTH View Post
Anyway, picking color 255 as part of your ramp will NOT give a transparent skincolor.
In fact, Cyan (the vanilla color) uses 255 as its main color index. How'd you not notice this, Zipper?
__________________
Knuckles is disappointed in your failures.
antonretrojr is offline   Reply With Quote
Old 2 Weeks Ago   #11
Shadowater
Default

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
__________________
Wow my account was edgy. Working on a revamp of my old Tails Doll mod
Shadowater is offline   Reply With Quote
Old 1 Week Ago   #12
Kaysakado
Default

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?
Kaysakado is offline   Reply With Quote
Old 1 Week Ago   #13
Shadowater
Default

Quote:
Originally Posted by Kaysakado View Post
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 ____
__________________
Wow my account was edgy. Working on a revamp of my old Tails Doll mod
Shadowater is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:17 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.