SRB2 Message Board  

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

Reply
 
Thread Tools Search this Thread
Old 2 Weeks Ago   #1
Yoshirocks90
Mapping/Scripting Hedgehog
 
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 2 Weeks Ago   #2
Zwip-Zwap Zapony
Please just call me Zappy.
 
Zwip-Zwap Zapony's Avatar
Default

From p_user.c, lines 3400 through 3406:
Code:
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 offline   Reply With Quote
Old 2 Weeks Ago   #3
Yoshirocks90
Mapping/Scripting Hedgehog
 
Yoshirocks90's Avatar
Default

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
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 06:11 AM.


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