Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

What happens to a script when i sell the container?

Sergio Carlucci
Registered User
Join date: 2 Feb 2009
Posts: 4
02-04-2010 07:45
I made a script, a simple texture changer on touch on a side of a prim;

before the selling all works good, after the selling the script works wrong.

It works but doesn't changes texture.

Thank you in advance.
Pete Olihenge
Registered User
Join date: 9 Nov 2009
Posts: 315
02-04-2010 07:52
Are you testing the toucher's key against a stored owner's key that isn't updated on a change of ownership?

Are you using no copy or no transfer textures from the object's inventory that aren't making it through the change of ownership? (Though I don't really think this is possible without some other warnings or notifications.)
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
02-04-2010 08:04
All that happens to the script when you sell it is that it changes to "next owner" perms, same as the prim it's in. Pete's pointed out the most likely failure, but if you post the script ... quickly! ... we can tell you what's wrong.
Sergio Carlucci
Registered User
Join date: 2 Feb 2009
Posts: 4
02-04-2010 08:17
From: Pete Olihenge
Are you testing the toucher's key against a stored owner's key that isn't updated on a change of ownership?

Are you using no copy or no transfer textures from the object's inventory that aren't making it through the change of ownership? (Though I don't really think this is possible without some other warnings or notifications.)


no owner checks, and the permissions are full.
Sergio Carlucci
Registered User
Join date: 2 Feb 2009
Posts: 4
02-04-2010 08:19
From: Nika Talaj
All that happens to the script when you sell it is that it changes to "next owner" perms, same as the prim it's in. Pete's pointed out the most likely failure, but if you post the script ... quickly! ... we can tell you what's wrong.


string textureOne = "64feac94-3a4f-0bad-f924-9b648cd57437";
string textureTwo = "1a262056-6742-1fc2-024c-fdf41fab8a60";
default{
touch_start(integer total_number){
llSay(0,"Changing textures";);
string loadedTexture = llGetTexture(1);
if (loadedTexture != textureOne){
llSay(0,"Texture One";);
// Y axis (grey arrows)
llSetTexture(textureOne,1);
llSetTexture(textureOne,3);
// X axis (red arrows)
llSetTexture(textureOne,2);
llSetTexture(textureOne,4);
// hollow (if hollow)
llSetTexture(textureOne,5);
}
else{
llSay(0,"TextureTwo";);
// Y axis (grey arrows)
llSetTexture(textureTwo,1);
llSetTexture(textureTwo,3);
// X axis (red arrows)
llSetTexture(textureTwo,2);
llSetTexture(textureTwo,4);
// hollow (if hollow)
llSetTexture(textureTwo,5);
}
}
}
Pete Olihenge
Registered User
Join date: 9 Nov 2009
Posts: 315
02-04-2010 08:56
From :
From: someone
If the host object does not have full permissions and the texture is not in the prim's inventory, the returned value is NULL_KEY.
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
02-04-2010 09:04
When you say "it works but ..." I bet you mean that you see it say "Texture One", but the texture doesn't actually change, and it never says "Texture Two"?

The script looks fine. It sounds like either the box or the texture you're using does not have 'next owner' mod perms, even though the script is full perm. If that was the case, llGetTexture will return NULL_KEY, the texture won't change, and also your script will always say "Texture One" (will never get to the "Texture Two" clause).

Take a good look at the next owner perms in the inventory of your vendor (I always have Debug Permissions on, see Tools menu). The foolproof test is to bring in an alt and have them buy a copy!

ETA: Pete beat me! That's what I get for being wordy
:)
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
02-04-2010 10:31
Incidentally, assuming that the perms are set as Pete and Nika suggest, the following script is more compact and slightly more elegant than the one you posted. Does the same thing..... ;)

CODE

list textures = ["64feac94-3a4f-0bad-f924-9b648cd57437","1a262056-6742-1fc2-024c-fdf41fab8a60"]; // You (owner of object) need full permissions for these textures
integer Tkey;
default
{
touch_start(integer num)
{
if (llGetTexture(1) == llList2String(textures,1))
{
Tkey = TRUE;
}
else
{
Tkey = FALSE;
}
llSay(0,"Changing textures from texture #" + (string)(Tkey+1) + " to texture #" + (string)(!Tkey+1));
// Y axis (grey arrows)
string NewTexture = llList2String(textures,!Tkey);
llSetTexture(NewTexture,1);
llSetTexture(NewTexture,3);
// X axis (red arrows)
llSetTexture(NewTexture,2);
llSetTexture(NewTexture,4);
// hollow (if hollow)
llSetTexture(NewTexture,5);
}
}
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at