Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

bug maybe

Alberto McGettigan
Registered User
Join date: 14 Jun 2005
Posts: 57
08-04-2005 23:48
Posted before but cant seem to figure this out may be a bug but this script should chang e the texture of the top of the cube with a texture in its inv under the name it recives thru listen but dosent. if i open the edit window the texture box shows the new one but wont change on the prim till i click the texture box. is something wrong or is something not working
the way it should. The input is just 2 letters.



string type;
string size;
string Rez3;
default
{


state_entry()
{
llListen(0, "", NULL_KEY, "";);
}


listen( integer channel, string name, key id, string mess )
{
type=llGetSubString(mess,0,0);
size=llGetSubString(mess,1,1);
Rez3=type+size;



llSetTexture(Rez3,0);

}

}
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
08-05-2005 00:51
Have you tried llOwnerSay()-ing Rez3 to make sure it's actually the name of the texture? You could also check using http://secondlife.com/badgeo/wakka.php?wakka=llGetInventoryPermMask that the message you're saying is the name of an extant texture.

I assume you want to do other things to Rez3, but the moment you could also try llSetTexture(mess, 0); since Rez3 is identical to mess.

You might also want to use a non-zero chat channel. Currently it's going to listen to *everything* on channel 0 and try to change it's texture to the first two letters of everything it hears. If you're saying other things in chat the delay may just mean it's struggling to catch up, although it should eventually do so.

If you're using large texture images it may also take a while for SL to draw it.

There doesn't, at first look, appear to be anything logically wrong with the script that you've posted, but I have to say I've only just got up and haven't had a coffee yet so my brain isn't 100%.
Alberto McGettigan
Registered User
Join date: 14 Jun 2005
Posts: 57
08-05-2005 07:33
thanks for your help. I just noticed that after it should have changed and i have to do it manually the texture box has the right one as i said but it sasy multiple across it and there isnt a multiple in the content of the prim. Could it be looking in my inv as well?
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
08-05-2005 08:09
No, it is multiple in the context of the prim, since the prim has more than one texture on it - you're only changing one face the other faces have other (presumably plywood at the moment) texture. If you want to change the whole prim you need llSetTexture(Rex3, ALL_SIDES);

Have you got the edit window open (even if minimised) when using the script? It is possible that your problem comes from there, SL isn't redrawing the object until you close the edit box as it is expecting input from you and may not redraw from a script, I've not tested that theory, but have a vague memory of it working that way - opening the edit window sort of suspends the script for some things - sensible in some ways because you might be editing the script after all...
Alberto McGettigan
Registered User
Join date: 14 Jun 2005
Posts: 57
08-05-2005 08:52
thanks ELoise. Ya thought of that. Decided it was a glitch in the prim or something. I remade it and works fine now. Just one of thoes things.

THANKS SO MUCH FOR YOUR HELP. I'm sure I'll need more. :)