Bond Harrington
Kills Threads At 500yds
Join date: 15 May 2005
Posts: 198
|
09-15-2005 12:37
I was wondering what's the scripting for using texture UUID to customize items, like decals on the Cubey Terra's and Jillian Callahan's vehicles.
|
Lee Ludd
Scripted doors & windows
Join date: 16 May 2005
Posts: 243
|
09-15-2005 12:54
I don't quite know what question you're asking, but if you're asking how to use UIDs to set a texture in a script, you use them exactly the same way you use the name of a texture that is in the script's object's contents. So, llSetTexture("12345678-abc-...",ALL_SIDES) does the same thing as llSetTexture("mytexture",ALL_SIDES), if the UID of "mytexture" is "12345678-abc-...". Does that answer you question?
|
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
|
09-15-2005 16:26
Here's a simple one: integer lhan = 0; default { state_entry() { llListenRemove(lhan); } touch_start(integer l) { if ( llDetectedKey(0) == llGetOwner() ) { lhan = llListen(0, "", llGetOwner(), ""); llWhisper(0, "Say \"decal <UUID>\" to change the decal."); } } listen(integer chan, string name, key id, string msg) { llListenRemove(lhan); if ( llGetSubString(msg, 0, 5) == "decal ") { string sid = llGetSubString(msg, 6, -1); llSetTexture(sid, 0); } else { llWhisper(0, "Command not understood. Please click the decal again to try again."); } } }
|
Jessica Qin
Wo & Shade, Importers
Join date: 16 Feb 2005
Posts: 161
|
09-16-2005 10:58
Extra credit: use llGetObjectName() to get the name of the prim instead of hard-coding "decal" into the code. That way you can re-use the same code fragment all over the place and set textures on multiple component prims based on their names.
Jess
|