Jump to content
You are about to reply to a thread that has been inactive for 1362 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello all. Please help if you can, I have no knowledge of scripts.

I found the one above on the Wiki to put colors on my wedding ring, but do not know where I put my husband's name. Could anyone please advise me? Thanks.

//  Color Changer Plus v1.0
//  by Neo Calcutt
//
//  distributed under the Creative Commons Attribution-Share Alike 3.0 United States License.
//
//  please leave the script full permissions and keep this header intact
 
//  you might want to change this
integer listenChannel = 5;
 
default
{
    state_entry()
    {
        llListen(listenChannel, "", NULL_KEY, "");
    }
 
    listen(integer channel, string name,  key id, string message)
    {
    //  uncomment the next line to only listen to the owner
    //  if (id != llGetOwner()) return;
 
    //  uncomment the next line to only listen to the owner and other objects by the owner
    //  if (llGetOwnerKey(id) != llGetOwner()) return;
 
    //  this would be black
        vector color = ZERO_VECTOR;
 
        if (message == "navy")         color = <0.000, 0.122, 0.247>;
        else if (message == "blue")    color = <0.000, 0.455, 0.851>;
        else if (message == "aqua")    color = <0.498, 0.859, 1.000>;
        else if (message == "teal")    color = <0.224, 0.800, 0.800>;
        else if (message == "olive")   color = <0.239, 0.600, 0.439>;
        else if (message == "green")   color = <0.180, 0.800, 0.251>;
        else if (message == "lime")    color = <0.004, 1.000, 0.439>;
        else if (message == "yellow")  color = <1.000, 0.863, 0.000>;
        else if (message == "orange")  color = <1.000, 0.522, 0.106>;
        else if (message == "red")     color = <1.000, 0.255, 0.212>;
        else if (message == "maroon")  color = <0.522, 0.078, 0.294>;
        else if (message == "fuchsia") color = <0.941, 0.071, 0.745>;
        else if (message == "purple")  color = <0.694, 0.051, 0.788>;
        else if (message == "white")   color = <1.000, 1.000, 1.000>;
        else if (message == "silver")  color = <0.867, 0.867, 0.867>;
        else if (message == "gray")    color = <0.667, 0.667, 0.667>;
        else if (message == "random")
        {
            float r = llFrand(1.0);
            float g = llFrand(1.0);
            float b = llFrand(1.0);
            color = <r, g, b>;
        }
        else if (llSubStringIndex(message, "<") == 0)
            color = (vector)message;
 
        llSetColor(color, ALL_SIDES);
    }
}
Link to post
Share on other sites

Sorry, but I don't really understand the question.   

The script you found will change the colour of the whole object.    That's all it does.  Can you be more specific about why you want to put your husband's name in it?   Do you want only him to be able to change the object's colour or what?

Link to post
Share on other sites

I just want to put his name on my ring and have the name change colors. Can you please suggest a script I can put in the ring for it, and tell me where to put the name?

I am also looking at the one on http://wiki.secondlife.com/wiki/LlSetText

If I just put the name in green, where do I write it?

default
{
    state_entry()
    {
        vector COLOR_GREEN = <0.0, 1.0, 0.0>;
        float  OPAQUE      = 1.0;
 
//      prim's name (not necessarily object's)
        llSetText(llGetObjectName(), COLOR_GREEN, OPAQUE );
 
//      delete the script as we only needed it to change the floating text property
        llRemoveInventory(llGetScriptName());
    }
}


Thanks

 

Link to post
Share on other sites

I think this is it, but as it is, it does not work

default
{
    state_entry()
    vector NAVY    = <0,     0.122, 0.247>;
vector BLUE    = <0,     0.455, 0.851>;
vector AQUA    = <0.498, 0.859, 1    >;
vector TEAL    = <0.224, 0.8,   0.8  >;
vector OLIVE   = <0.239, 0.6,   0.439>;
vector GREEN   = <0.18,  0.8,   0.251>;
vector LIME    = <0.004, 1    , 0.439>;
vector YELLOW  = <1    , 0.863, 0    >;
vector ORANGE  = <1    , 0.522, 0.106>;
vector RED     = <1    , 0.255, 0.212>;
vector MAROON  = <0.522, 0.078, 0.294>;
vector FUCHSIA = <0.941, 0.071, 0.745>;
vector PURPLE  = <0.694, 0.051, 0.788>;
vector WHITE   = <1    , 1    , 1    >;
vector SILVER  = <0.867, 0.867, 0.867>;
vector GRAY    = <0.667, 0.667, 0.667>;
vector BLACK   = <0.000, 0.000, 0.000>;
 
string  hoverText   = "Gabriel";
vector  hoverColor  = LIME;//  set predefined color or any RGB color vector in float form
float   hoverAlpha  = 1.0; // Sets the text's transparency, 1.0 being opaque, while 0.0 would be transparent
}

Link to post
Share on other sites

You are almost here.  You just need a couple of changes.

First, you want to declare the variable string hoverText right at the top of the script, before default, thus:

string hoverText = "Gabriel";

default{
	
	state_entry(){
		//and so on
	}
}

That's so you can use the variable hoverText anywhere in the script and script will know it means "Gabriel".

Then, in state entry, I would simply say llSetText(hoverText,<0.004, 1.0 , 0.439>, 1.0);.    That will set his name in Lime.

Then, in the listen event, you can use the example in your first post, except that instead of saying llSetColor(color,ALL_SIDES) right at the end you say llSetText(hoverText,color,1.0);

Then if he (or anyone, in fact) says the appropriate colour name on channel 5 it will change the colour of the hovertext.

 

Link to post
Share on other sites

Are you wanting the name to appear as if it's engraved on the ring? If so, there's no script that can do that. The name would have to be built into the ring's texture, or applied to a new prim added to the ring object. The method you're currently pursuing would float a line of text in the air above the ring, just like the user name that floats over avatar heads.

  • Like 2
Link to post
Share on other sites
2 hours ago, Madelaine McMasters said:

Are you wanting the name to appear as if it's engraved on the ring? If so, there's no script that can do that. The name would have to be built into the ring's texture, or applied to a new prim added to the ring object.

Yeah. If one wanted to pursue this, I think OpenCollar includes a naming link, so maybe that could be re-purposed for this. I don't know if it is an 8-faced mesh that wraps around the curve, which would be ideal here, but whatever it is, it can likely display enough letters in some form, more realistically than hovertext -- albeit more work.

Another option might be Shared Media formatted text displayed on a curved surface. That would be relatively easy, I guess, but only works for hubbies with media enabled.

Edited by Qie Niangao
Link to post
Share on other sites

I personally would make a ring and have a slightly larger ring around it with a texture that was alpha'd out except for the name. then the base ring prim (first, inner ring) would have its nice, say, gold texture, and the name would appear on it in, say, white, so you could change its color with the script. But that's just me, and it's probably not the easiest way to get the effect.

If someone's willing to try doing this for you, it might be worth the L$ to commission them for the job. Otherwise it would probably be a bit much to do if you're new to this stuff... I'm sure there's some way to get the effect you want, tho.

Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 1362 days.

Please take a moment to consider if this thread is worth bumping.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...