Jump to content

Problem... Scripting... Need help.


You are about to reply to a thread that has been inactive for 3346 days.

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

Recommended Posts

Ok so I have two object which use channels to apply textures over. prim A sends to prim b, but if another person has a copy of prim b, if someone applies prim a, it applies the texture to both copies. I need the script to apply only to the owner of the object, and not to anyone else who may have the prim in the same space.

Thank you GREATLY in advance for help.

 

Miz

Link to comment
Share on other sites

//inside prim to be textured

 

default{ state_entry() { llListen (-4444,"","",""); } listen (integer channel, string name, key id, string message){ if (llGetOwnerKey(id) == llGetOwner()) { llSetTexture("msg",ALL_SIDES); } }}//Applier:

 

string texture_0 = "UUID KEY NUMBER HERE"; //your texture Key here

 

default

{

state_entry()

{

llListen(-4444,"","",""); //channel -1000

}

 

touch_start(integer total_number)

{

llRegionSay(-4444, texture_0);

llRemoveInventory(llGetScriptName());

}

 

 

}

 Give me a minute to go back in world and get the applier script, I got dinged before I could copy it.

Link to comment
Share on other sites

No.  I assume that the texture name is the message that is being sent to your object, right?  It will be received in the listen event and called "message", since that's the label you chose.  The variable "msg" does not exist.  If you want to apply the texture named in "message", write llSetTexture(message,ALL_SIDES);

Link to comment
Share on other sites

That didn't work either.

 

I was looking around for possible scripts to compare what I am trying to do. I found Kimms remote texture script which is close, so basically I have a working formula to transfer the texture by UUID, to a linked prim. But when I do if two people in the region have the same linked prim object down one person's remote changes the texture on both instead of the owner's linked object. I need it to not do that. Since the remotes are what is going to be fore sale. 

Link to comment
Share on other sites

Try this:

default{    state_entry()    {        llListen (-4444,"","","");    }    listen (integer channel, string name, key id, string message)    {        if (llGetOwnerKey(id) == llGetOwner())        {            llSetTexture((key)message,ALL_SIDES);        }    }}

The last variable type for the listen event handler must be "string" not "key"

:smileysurprised::):smileyvery-happy:

Link to comment
Share on other sites

This is dreadfully simple.  I suppose I should ask two very basic questions:

1. "Is the receiving script in your object running?" (Look for the Running check box when you have your editor open.)

2. Same thing for the applier script plus "Is the script even there?"  Remember that that applier script deletes itself when you click on it.

Link to comment
Share on other sites

Try this, which I know works because I just tested it.

//In the transmitterinteger chan =-4444;key texture = "d522c891-f467-4c07-684a-1d7b6b074f03"; //tartan of the Independent State of Caledondefault{    state_entry()    {            }    touch_start(integer total_number)    {        if(llDetectedKey(0)==llGetOwner()){          llRegionSay(chan,(string)texture);           }    }}

 and 

//in the receiverinteger chan =-4444;default{    state_entry()    {       llListen(chan,"","","");    }    listen(integer channel, string name, key id, string message){                llOwnerSay(message); //so you know the script is actually hearing the message                 if(llGetOwnerKey(id)==llGetOwner()){            llSetTexture((key)message,ALL_SIDES);        }    }}

Rez two prims, drop one script in one prim and the other in the other, and touch the "transmitter" prim.    If it works, then compare yours with my working version, to see where yours differs.

If it doesn't work, then, as Rolig says, check that the script is running, that you're somewhere you're allowed to run scripts and so on.

Link to comment
Share on other sites

I managed to get it to work. the script unbeknownst was off. Which is weird cause I never set off.  Don't know how that happened. And it worked with a second user having the object on the round. Didn't apply to both, so good show. Thank you all so much. This was driving me crazy. I was set to release this yesterday, then check it and had to set back release. Sorry if I have inconveinanced any of you, and thank you for the direction on it.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3346 days.

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...