Author Topic: Rainbow Player Help  (Read 1959 times)

I recently found and fixed the rainbow player mod, it surprisingly doesn't lag servers. I've been fiddling around with the script and I'm trying to change the colors that it changes your avi to. Can someone help? Sorry, I'm not a pro at scripting.

-Answered

Currently I have the color set to shades of black.

Current Code:
//Colored Avatar
//by boomlinde
//Edited by Tylerman
//Re-edited by Erif/Baeshra/BL_ID 19049

if (!$RainbowAvatarBindings)
{
   $remapDivision[$remapCount] = "Rainbow Avatar";
   $remapName[$remapCount] = "Activate/Deactivate";
   $remapCmd[$remapCount] = "RainbowAvatarToggle";
   $remapCount++;
   $RainbowAvatarBindings=true;
}

$RainbowAvatarCount=0;
$RainbowAvatarFlag=0;
$RainbowAvatarTempPack=$pref::Avatar::PackColor;
$RainbowAvatarTempHat=$pref::Avatar::HatColor;
$RainbowAvatarTempLLeg=$pref::Avatar::LLegColor;
$RainbowAvatarTempRLeg=$pref::Avatar::RLegColor;
$RainbowAvatarTempAccent=$pref::Avatar::AccentColor;
$RainbowAvatarTempHead=$pref::Avatar::HeadColor;
$RainbowAvatarTempTorso=$pref::Avatar::TorsoColor;
$RainbowAvatarTempHip=$pref::Avatar::HipColor;
$RainbowAvatarTempLArm=$pref::Avatar::LArmColor;
$RainbowAvatarTempLHand=$pref::Avatar::LHandColor;
$RainbowAvatarTempRArm=$pref::Avatar::RArmColor;
$RainbowAvatarTempRHand=$pref::Avatar::RHandColor;
$RainbowAvatarTempSecondPack=$pref::Avatar::SecondPackColor;

function RainbowAvatarToggle(%val)
{
  if(%val) {
    if($RainbowAvatarFlag==0)
    {
        $RainbowAvatarFlag=1;
        $RainbowAvatarTempPack=$pref::Avatar::PackColor;
      $RainbowAvatarTempHat=$pref::Avatar::HatColor;
      $RainbowAvatarTempLLeg=$pref::Avatar::LLegColor;
      $RainbowAvatarTempRLeg=$pref::Avatar::RLegColor;
      $RainbowAvatarTempAccent=$pref::Avatar::AccentColor;
      $RainbowAvatarTempHead=$pref::Avatar::HeadColor;
      $RainbowAvatarTempTorso=$pref::Avatar::TorsoColor;
      $RainbowAvatarTempHip=$pref::Avatar::HipColor;
      $RainbowAvatarTempLArm=$pref::Avatar::LArmColor;
      $RainbowAvatarTempLHand=$pref::Avatar::LHandColor;
      $RainbowAvatarTempRArm=$pref::Avatar::RArmColor;
      $RainbowAvatarTempRHand=$pref::Avatar::RHandColor;
      $RainbowAvatarTempSecondPack=$pref::Avatar::SecondPackColor;
        RainbowAvatarLoop();
    }
   else if($RainbowAvatarFlag==1)
    {
        $RainbowAvatarFlag=0;
        cancel($RainbowAvatar);
        $pref::Avatar::PackColor=$RainbowAvatarTempPack;
      $pref::Avatar::HatColor=$RainbowAvatarTempHat;
      $pref::Avatar::LLegColor=$RainbowAvatarTempLLeg;
      $pref::Avatar::RLegColor=$RainbowAvatarTempRLeg;
      $pref::Avatar::AccentColor=$RainbowAvatarTempAccent;
      $pref::Avatar::HeadColor=$RainbowAvatarTempHead;
      $pref::Avatar::TorsoColor=$RainbowAvatarTempTorso;
      $pref::Avatar::HipColor=$RainbowAvatarTempHip;
      $pref::Avatar::LArmColor=$RainbowAvatarTempLArm;
      $pref::Avatar::LHandColor=$RainbowAvatarTempLHand;
      $pref::Avatar::RArmColor=$RainbowAvatarTempRArm;
      $pref::Avatar::RHandColor=$RainbowAvatarTempRHand;
      $pref::Avatar::SecondPackColor=$RainbowAvatarTempSecondPack;
        clientcmdupdateprefs();
    }
  }
}
function rainbowreset() {
cancel($RainbowAvatar);
$pref::Avatar::PackColor=$RainbowAvatarTempPack;
$pref::Avatar::HatColor=$RainbowAvatarTempHat;
$pref::Avatar::LLegColor=$RainbowAvatarTempLLeg;
$pref::Avatar::RLegColor=$RainbowAvatarTempRLeg;
$pref::Avatar::AccentColor=$RainbowAvatarTempAccent;
$pref::Avatar::HeadColor=$RainbowAvatarTempHead;
$pref::Avatar::TorsoColor=$RainbowAvatarTempTorso;
$pref::Avatar::HipColor=$RainbowAvatarTempHip;
$pref::Avatar::LArmColor=$RainbowAvatarTempLArm;
$pref::Avatar::LHandColor=$RainbowAvatarTempLHand;
$pref::Avatar::RArmColor=$RainbowAvatarTempRArm;
$pref::Avatar::RHandColor=$RainbowAvatarTempRHand;
$pref::Avatar::SecondPackColor=$RainbowAvatarTempSecondPack;
clientcmdupdateprefs();
}
function RainbowAvatarLoop()
{
        if($RainbowAvatarCount > 63) $RainbowAvatarCount=0;
        //Grejer
        $R=0.5+0.5*mSin($RainbowAvatarCount*3.14/16.0);
        $G=0.5+0.5*mSin($RainbowAvatarCount*3.14/16.0);
        $B=0.5+0.5*mSin($RainbowAvatarCount*3.14/16.0);
      $pref::Avatar::PackColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::HatColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::LLegColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::RLegColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::AccentColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::HeadColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::TorsoColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::HipColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::LArmColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::LHandColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::RArmColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::RHandColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::SecondPackColor=$R SPC $G SPC $B SPC "1";
        clientcmdupdateprefs();
        $RainbowAvatarCount++;
        $RainbowAvatar=schedule(250,0,RainbowAvatarLoop);
}

« Last Edit: January 04, 2011, 11:51:29 PM by Baeshra »

        $RainbowAvatar=schedule(100,0,RainbowAvatarLoop);
i suggest you change that, as the minimum avatar change time is 1 second

Ok, I changed the loop time to 500, now it goes through several more shades. I still want to know how to change the colors it cycles through. I want to make it so my script cycles through shades of white or black for example. Thanks for the help.

$RainbowAvatar=schedule(500,0,RainbowAvatarLoop);
-Edit
This is one of the first times I've looked at codes and I was wondering how to get the bottomprint function to work so I could see the values of R and G. Help would be appreciated.
« Last Edit: January 03, 2011, 12:53:39 AM by Baeshra »

as this:
Code: [Select]
if($RainbowAvatarCount > 63) $RainbowAvatarCount=0;
        //Grejer
        $R=0.5+0.5*mSin($RainbowAvatarCount*3.14/16.0);
        $G=0.5+0.5*mSin($RainbowAvatarCount*3.14/16.0+21.0);
i think does the colors, try making the R and G be the same thing, as well as then making there be a B which is the same
ie:
Code: [Select]
if($RainbowAvatarCount > 63) $RainbowAvatarCount=0;
        //Grejer
        $R=0.5+0.5*mSin($RainbowAvatarCount*3.14/16.0);
        $G=0.5+0.5*mSin($RainbowAvatarCount*3.14/16.0);
        $B=0.5+0.5*mSin($RainbowAvatarCount*3.14/16.0);

Interesting. This actually helps me.
« Last Edit: January 03, 2011, 10:59:05 PM by Welknair »

Thanks phflack, I'm testing it now.



-Testing Complete

I modified what you suggested and modified the loop time so it cycled through the shades faster. Why hasn't anyone posted a fixed version of the Funky Shirt/Rainbow Player/ColoredAvi? Would it be a good idea to post it? Thanks for the help

The current modified code is as follows

{
        if($RainbowAvatarCount > 63) $RainbowAvatarCount=0;
        //Grejer
        $R=0.5+0.5*mSin($RainbowAvatarCount*3.14/16.0);
        $G=0.5+0.5*mSin($RainbowAvatarCount*3.14/16.0);
        $B=0.5+0.5*mSin($RainbowAvatarCount*3.14/16.0);
      $pref::Avatar::PackColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::HatColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::LLegColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::RLegColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::AccentColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::HeadColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::TorsoColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::HipColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::LArmColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::LHandColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::RArmColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::RHandColor=$R SPC $G SPC $B SPC "1";
      $pref::Avatar::SecondPackColor=$R SPC $G SPC $B SPC "1";
        clientcmdupdateprefs();
        $RainbowAvatarCount++;
        $RainbowAvatar=schedule(250,0,RainbowAvatarLoop);
}

It successfully cycles through the correct shades, of course if I was to post it I would give instructions on how to switch between the black/white and rgb shades as well as instructions on how to change the modified body parts.
« Last Edit: January 03, 2011, 11:43:14 PM by Baeshra »

Why hasn't anyone posted a fixed version of the Funky Shirt/Rainbow Player/ColoredAvi?
what is there to fix?
and increasing the speed makes larger jumps between colors

There was a reason that the 1 second restriction on avatar changes was added. These scripts make you look stupid, stop using them.

Yes I know phflack, when I first found the script I had to change a couple of things to get it working. They were small things like I had to change the word Player to Avatar and change the word Chest to Torso.

And Amade, I haven't been using this script, I've just been learning about how to script in general and I thought that it would be good to start here.

Jesus christ how many versions of this script is it going to take for somebody to point out that it's spelled ACTIVATE not loving ACTICATE fuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu-


look at the keybind name.

There was a reason that the 1 second restriction on avatar changes was added.

I always assumed that Badspot made the change because too many forgettards complained to him about how it caused lag on servers. I never experienced any lag when anyone used to use this mod.

I'll change that now, lol. Also, would it be possible for me to add "/" commands to easily toggle the color and which body parts it affected?