SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Kart Releases & Mods > Kart Miscellaneous

Reply
 
Thread Tools
Secondcolor for Kart Characters Details »»
Secondcolor for Kart Characters
Version: 1.4, by Lach (nanananananananananananan a) Lach is offline
Developer Last Online: Aug 2020

Category: Version: SRB2 Kart Rating: (1 votes - 3.40 average)
Released: 03-27-2019 Last Update: Never Favourites: 2
Scripts Re-Useable Content

This script lets character creators give their characters changeable secondary colors!



The instructions for usage are included in the script itself. Simply drag the script into your WAD or PK3 as a new lump and start reading!

I've done my best to make the process as easy as possible—all you need to do to get this working is import a separate set of sprites to overlay your character, then type into the script the name of your character, the name of the extra spriteset, and the list of secondcolors that you want your character to use. There are a number of extra options too, such as the ability to turn the secondcolor overlay off for certain colors, or set a default secondcolor!

When actually playing as a character that makes use of this script, the console command secondcolor can be used to choose a custom secondcolor! Not only does this let players come up with their own unique combinations during play, it makes choosing a character's color combinations a lot easier for their creators. (Of course, there are splitscreen variants of the command too! Unfortunately they're only usable in offline mode.) Creators, you can turn this feature off for your character, if you would rather players didn't mess with your selections.

If the setup process is somehow still confusing, I've included an example addon for creators to view (kl_secondcolorexample_v1.pk3). Adding this file in-game lets Eggman's cape change color.

Keep in mind that adding Lua scripts to your character disables Record Attack mode when they are added to the game!! If you would like your character to be usable in Record Attack, release a separate version without the script.

Known Issues:
Spoiler:
  • In SRB2 Kart 1.0.4, the Lua function that determines opposite colors is currently bugged for the colors between and including Purple and Lilac. The issue is purely aesthetic and will be patched out in the next release of SRB2 Kart.

Please note that the script itself is NOT a standalone addon, it is for creators to use to add secondcolor functionality to their characters.

Download Now

File Type: lua LUA_SECN_v1.4.lua (10.9 KB, 234 views)
File Type: pk3 kl_secondcolorexample_v2.pk3 (34.3 KB, 213 views)

Screenshots

Click image for larger version

Name:	kart0038.gif
Views:	4683
Size:	6.98 MB
ID:	18075   Click image for larger version

Name:	kart0037.gif
Views:	377
Size:	5.96 MB
ID:	18084   Click image for larger version

Name:	ezgif-5-55d675a1137d.gif
Views:	617
Size:	5.21 MB
ID:	18085  

Show Your Support

  • The author of this addon has given explicit permission for its content to be re-used and/or reproduced.

Comments
Old 03-29-2019   #2
D00D64
Probably Responsible
Moderator
 
D00D64's Avatar
Default

Welcome to releases!
D00D64 is offline   Reply With Quote
Old 03-29-2019   #3
gregory_house
Also known as TemporaryAl
 
gregory_house's Avatar
Default

Any reason why the splitscreen secondcolor still isn't available for online gameplay?
__________________
My friends are my strength. - Discord: TemporaryAl#4689
gregory_house is offline   Reply With Quote
Old 03-30-2019   #4
Lach
nanananananananananananan a
Moderator
 
Lach's Avatar
Default

Quote:
Originally Posted by gregory_house View Post
Any reason why the splitscreen secondcolor still isn't available for online gameplay?
As far as I know, there is no way to determine which splitscreen players are playing from the same node in a netgame.
Lach is offline   Reply With Quote
Old 03-30-2019   #5
gregory_house
Also known as TemporaryAl
 
gregory_house's Avatar
Default

Would using the value of "splitscreen" (nil, 1, 2 or 3) work, like this?


Code:
    COM_AddCommand("secondcolor", function(player, arg)
            setSecondColor(player, arg)
        end)    
    
    for i = 4, 2, -1
        local s = i - 1 and i or ""
        COM_AddCommand("secondcolor"..s, function(player, arg)
            if splitscreen >= (s-1)
              setSecondColor(players[#player+s-1], arg)
            end
        end)
    end
__________________
My friends are my strength. - Discord: TemporaryAl#4689
gregory_house is offline   Reply With Quote
Old 03-31-2019   #6
Lach
nanananananananananananan a
Moderator
 
Lach's Avatar
Default

Code:
setSecondColor(players[#player+s-1], arg)
I do not believe this method is reliable under the assumption that players joining a netgame always take the first available index in the array. Let's say that 5 players are playing in a netgame. If the 3rd one leaves, there's an open slot in the 3rd index. Then if someone joins with 4 splitscreen players, the first player probably takes that 3rd slot, and then the rest of the party takes the 6th, 7th, and 8th slots.

Spoiler:
Code:
0: Player 1
1: Player 2
2: Client's splitscreen player 1
3: Player 4
4: Player 5
5: Client's splitscreen player 2
6: Client's splitscreen player 3
7: Client's splitscreen player 4
Lach is offline   Reply With Quote
Old 03-31-2019   #7
gregory_house
Also known as TemporaryAl
 
gregory_house's Avatar
Default

Alright thanks for the insight.
__________________
My friends are my strength. - Discord: TemporaryAl#4689
gregory_house is offline   Reply With Quote
Old 11-22-2019   #8
Lach
nanananananananananananan a
Moderator
 
Lach's Avatar
Default

Updated script version to 1.4. This should fix an issue where the signpost sprites sometimes did not appear.
Lach is offline   Reply With Quote
Old 2 Weeks Ago   #9
Emgiell
Default

When using the FKart frame interpolation the recolor layer seems to get misaligned.




I disabled frame interpolation and the recolor sprite works as intended. Am wondering if a fix could be possible.

Last edited by Emgiell; 2 Weeks Ago at 01:36 AM.
Emgiell is offline   Reply With Quote
Old 2 Weeks Ago   #10
Guil
Chubby Lizard (formerly Fattata)
 
Guil's Avatar
Default

I've found out exactly what edits need to be made to make it compatible with interpolation builds, like fkart or birdhouse.

-overlay.momx, overlay.momy, and overlay.momz should be set to mo.momx, mo.momy, mo.momz respectively instead of being set to 0 (around line 210).
-pmomz should also probably be taken into account
Guil is offline   Reply With Quote
Reply

Thread Tools

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 Off
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:21 AM.


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