SRB2 Message Board  

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

Thread Tools Search this Thread
Old 10-04-2017   #1
Attempting to mod again
Yoshirocks90's Avatar
Default Super Color Cycle Rate

What is the rate, in terms of ticrate for super colors? It would be helpful if the answer were in the format of "1 * TICRATE / x", where "x" is a number that you would divide TICRATE by to get the length of time for each super color.
Yoshirocks90 is offline   Reply With Quote
Old 10-04-2017   #2
Zwip-Zwap Zapony
Please just call me Zappy.
Zwip-Zwap Zapony's Avatar

From p_user.c, lines 3400 through 3406:
switch (player->skin)
    case 1:  /* Tails    */ player->mo->color = SKINCOLOR_TSUPER1; break;
    case 2:  /* Knux     */ player->mo->color = SKINCOLOR_KSUPER1; break;
    default: /* everyone */ player->mo->color = SKINCOLOR_SUPER1; break;
player->mo->color += abs( ( (signed)( (unsigned)leveltime >> 1 ) % 9) - 4);
In other words... I don't really know for absolute certain (at time of writing that, though looking more at it, I understand it more and more). What I do know is that first the base super colour is set, and then the colour is incremented based on the leveltime.

But I can tell you that from testing it in-game, it seems like it goes SUPER5, SUPER4, SUPER3, SUPER2, SUPER1, SUPER2, SUPER3, SUPER4, and SUPER5 before looping around again (yes, having SUPER5 play two times in a row/for twice as long), with 2 tics between each swap (meaning SUPER5 lasts for 4 tics and the rest of them last for 2 tics each time they're reached). Note that SUPER5 is the darkest super colour and SUPER1 is the brightest.

What you'll want to do is probably something based upon checking the value of abs(((leveltime >> 1) % 7) - 3), with a value of 0 being for the brightest colour, 1 for the second-brightest, 2 for the second-darkest, and 3 for the darkest. Note that this is going to pulse a little faster than the vanilla 5-colour super colours, though, and also that I did not test it at all to make sure it even works that way in SRB2, but I think it should work.
Zwip-Zwap Zapony is online now   Reply With Quote
Old 10-04-2017   #3
Attempting to mod again
Yoshirocks90's Avatar

Ok... I understood none of that, but all I really needed was the part where you said there 2 tics for each color.
Yoshirocks90 is offline   Reply With Quote

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 04:49 PM.

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