|
Artemis Cain
Take it or Leave it
Join date: 11 Apr 2005
Posts: 116
|
05-15-2006 12:44
This is probably really easy and I am just not quite grasping it. I have a script that changes the texture of an object(T). It is randomly getting an object from a "master object"  B). Once I changed the texture for (T), I wanted to be able to set it back to its original texture. I put the original texture in the object and set it up to listen for "reset" to set (T) back to its original texture. the problem is that once I do that, I can no longer get the texture changing part of the script to run again. the Objects are linked. and the only thing I have been able to do thusfar is unlink and manually reset the script. Is there an easier way to do this?
|
|
Leonard Churchill
Just a Horse
Join date: 19 Oct 2005
Posts: 59
|
05-15-2006 15:20
From: Artemis Cain This is probably really easy and I am just not quite grasping it. I have a script that changes the texture of an object(T). It is randomly getting an object from a "master object"  B). Once I changed the texture for (T), I wanted to be able to set it back to its original texture. I put the original texture in the object and set it up to listen for "reset" to set (T) back to its original texture. the problem is that once I do that, I can no longer get the texture changing part of the script to run again. the Objects are linked. and the only thing I have been able to do thusfar is unlink and manually reset the script. Is there an easier way to do this? It would really help if you posted the code from object T (where it sounds like your problem is) and clarified this a bit. Are objects T and B linked? What is the object that is transferred, a texture to display? If you are really doing a llResetScript, it will not change the texture of the prim unless you tell it to. Are you really doing a listen in T, because you don't need to. Like I said, post the code (don't forget to use the php code tags) and you'll get lots of good answers. Folks here can't help themselves when given an opporunity to fix someone else's code. =)
_____________________
"Give me a fish and I eat for a day. Teach me to fish and I eat for a lifetime." - Chinese Proverb Always check the Wiki and/or Script Library
|
|
Artemis Cain
Take it or Leave it
Join date: 11 Apr 2005
Posts: 116
|
05-15-2006 15:57
sorry bout that. Here is the code
integer giTouched; integer giMynumber; default { touch_start( integer num ) { llListen(0,"",llGetOwner(), "reset"); // Tile hasn't been touched yet! if( !giTouched ) { // Mark the tile as touched! giTouched = TRUE ; // Request a texture from the main script, B, in the root prim. llMessageLinked( LINK_ROOT, giMynumber, "tex_req", "" ) ; } }
link_message( integer sender, integer num, string message, key id ) { // I just received a reply to my texture request from the root prim! if( ( sender == LINK_ROOT ) && ( message == "tex_req" ) ) { // Set my texture to the texture name contained in 'id'. llSetTexture( id, ALL_SIDES ) ; } }
listen(integer chan, string name, key id, string mes) { llSetTexture("case5", ALL_SIDES) ; } }
|