Author Topic: GetColor function  (Read 321 times)

Legacy_Snarkblat

  • Full Member
  • ***
  • Posts: 104
  • Karma: +0/-0
GetColor function
« on: June 24, 2011, 02:18:17 am »


               I've been experimenting a lot lately with the SetColor() and SetCreatureBodyPart() functions. I'd like to know if there's a way to define the PC's colors and apply them to an NPC, making family members for instance. Unfortunately, when I try to define variables, I get a ERROR: MISMATCHED TYPES error message.

Is there a better way? Or is the GetColor function patently useless to builders?

Here's what I have so far.

//Mom! Dad!
void main()
{

object oPC = GetFirstPC();

object oSkin = GetColor(oPC, COLOR_CHANNEL_SKIN);
object oHair = GetColor(oPC, COLOR_CHANNEL_HAIR);
object oTat1 = GetColor(oPC, COLOR_CHANNEL_TATTOO_1);
object oTat2 = GetColor(oPC, COLOR_CHANNEL_TATTOO_2);

SetColor(OBJECT_SELF, COLOR_CHANNEL_SKIN, oSkin);
SetColor(OBJECT_SELF, COLOR_CHANNEL_HAIR, oHair);
SetColor(OBJECT_SELF, COLOR_CHANNEL_TATTOO_1, oTat1);
SetColor(OBJECT_SELF, COLOR_CHANNEL_TATTOO_2, oTat2);

}
               
               

               


                     Modifié par Snarkblat, 24 juin 2011 - 01:31 .
                     
                  


            

Legacy_Calvinthesneak

  • Hero Member
  • *****
  • Posts: 1159
  • Karma: +0/-0
GetColor function
« Reply #1 on: June 24, 2011, 02:41:54 am »


               Probably need to use ints? I don't think colours count as objects.

Lexicon is your friend.  http://palmergames.c...n.GetColor.html
               
               

               


                     Modifié par Calvinthesneak, 24 juin 2011 - 01:43 .
                     
                  


            

Legacy_Snarkblat

  • Full Member
  • ***
  • Posts: 104
  • Karma: +0/-0
GetColor function
« Reply #2 on: June 24, 2011, 02:48:57 am »


               Then how do I save the PC's color as a variable?
               
               

               
            

Legacy_ShadowM

  • Hero Member
  • *****
  • Posts: 1373
  • Karma: +0/-0
GetColor function
« Reply #3 on: June 24, 2011, 02:50:26 am »


               Because it a int it be something like this I think
int iSkin = GetColor(oPC, COLOR_CHANNEL_SKIN);
int iHair = GetColor(oPC, COLOR_CHANNEL_HAIR);
int iTat1 = GetColor(oPC, COLOR_CHANNEL_TATTOO_1);
int iTat2 = GetColor(oPC, COLOR_CHANNEL_TATTOO_2);

SetColor(OBJECT_SELF, COLOR_CHANNEL_SKIN, iSkin);
SetColor(OBJECT_SELF, COLOR_CHANNEL_HAIR, iHair);
SetColor(OBJECT_SELF, COLOR_CHANNEL_TATTOO_1, iTat1);
SetColor(OBJECT_SELF, COLOR_CHANNEL_TATTOO_2, iTat2);
               
               

               
            

Legacy_Snarkblat

  • Full Member
  • ***
  • Posts: 104
  • Karma: +0/-0
GetColor function
« Reply #4 on: June 24, 2011, 02:58:05 am »


               Thank you, ShadowM! I plugged the script in and it worked like a charm. I didn't know about saving variables as ints until now.

Well this has certainly been illuminating. Think of the possibilities! I'm off to make a module where every time the PC "sows his seed" an illegitimate child that looks just like him shows up on his doorstep. >'<img'>
               
               

               
            

Legacy_Xardex

  • Sr. Member
  • ****
  • Posts: 414
  • Karma: +0/-0
GetColor function
« Reply #5 on: June 24, 2011, 04:32:27 pm »


               FYI, variables can be int, float, string, object, effect, itemproperty, location, vector and the illusive struct. If you get a mismatch error you propably have a wrong variable in the wrong place, or you compare two different types of variables in an if statement.
               
               

               


                     Modifié par Xardex, 24 juin 2011 - 03:32 .