|
Barrington John
Yorkshire guy
Join date: 17 Nov 2007
Posts: 119
|
03-13-2009 07:07
This is bound to be something stupidly simple and obvious that I'm not seeing after several frustrating hours, so apologies in advance for my tiny little brain and its mistakes. In my defence, I'll just say I've not done any LSL scripting for a while. Anyway, on to the moronic mistake ...
I'm trying to extract texture information from the host prim by using llGetPrimitiveParams(). I'm not using llGetTexture() because I need to get other information at the same time. It ain't working - I always get NULL_KEY - and I don't know why. Here's some cut-down sample code that demonstrates the problem I'm having; sorry about the lack of formatting:
list Params = [] ; integer Side ; integer Sides = llGetNumberOfSides() ; for(Side = 0 ; Side < Sides ; Side++) { Params = llGetPrimitiveParams([ PRIM_TEXTURE, Side ]) ; if (llGetListEntryType(Params, 0) == TYPE_KEY) llOwnerSay("side: " + (string)Side + " key: " + (string)llList2Key(Params, 0)) ; else llOwnerSay("side: " + (string)Side + " string: " + llList2String(Params, 0)) ; }
If I put that in the touch_start() event of a prim, then texture each side of the prim with full-perm textures from my inv (or even plywood or blank), it reports each side as a key of value NULL_KEY (all zeroes).
So, folks, please help me out. Where have I gone wrong?
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
03-13-2009 07:13
From: Barrington John I'm trying to extract texture information from the host prim by using llGetPrimitiveParams(). I'm not using llGetTexture() because I need to get other information at the same time. It ain't working - I always get NULL_KEY - and I don't know why. If you do not have ALL permissions for the prim you will get a NULL_KEY 
_____________________
From Studio Dora
|
|
Barrington John
Yorkshire guy
Join date: 17 Nov 2007
Posts: 119
|
03-13-2009 07:34
From: Dora Gustafson If you do not have ALL permissions for the prim you will get a NULL_KEY  Damn, so it seems. I thought that just referred to the perms of the texture. And my goodness isn't it strict? In the case of the prim I was using for testing, I don't have transfer permission on the prim, even though I do have copy/mod, and the scripts in the prim are full-perm, as are the textures, and - this is where I realise I'll probably never understand the SL permissions model - I'm both the owner and the creator of the prim, the scripts in it, and all the textures on it . The prim's unlinked, too. But somehow I've lost the ability to change "next owner" permissions on the prim. So the only permission lacking seems to be transfer permission on the prim itself, and even as owner and creator I can't do anything about that. How strange! But yes, making an entirely fresh prim with the same script and textures works fine. Presumably, since llGetTexture() has the same restriction, there's no way to reliably use a script to find out which of my textures I've put on my prim, simply because for some reason I can't give that prim to anyone else. I'll have to redesign the application to take account of that. Thanks for your help!
|