steph Arnott Posted January 4, 2016 Share Posted January 4, 2016 else if (start_param > 0)//if one allready rezzed so do not rezz anotherIs this valid? Link to comment Share on other sites More sharing options...
Rolig Loon Posted January 4, 2016 Share Posted January 4, 2016 You could certainly make it valid, Steph. For example: integer start_param;default{ touch_start(integer num) { if (!start_param) { llRezAtRoot("MyObject",llGetPos(),ZERO_VECTOR,ZERO_ROTATION,start_param); } else if (start_param > 0) { llSay(0,"Sorry, I have already rezzed the object once."); } ++start_param; }} EDIT: Of course, you could also just make the rezzable object no-copy. That is, make the object no-copy, give it to your alt, and have her put it in the rezzer. Once that copy is rezzed, there's nothing left in the rezzer to rez a second time. 1 Link to comment Share on other sites More sharing options...
revochen Mayne Posted January 4, 2016 Share Posted January 4, 2016 Hi Steph! The start_param of the on_rez event is the value passed by the llRezObject or llRezAtRoot function. Its not reliable to check if the object already exist in-world either by function or manual rez. If an object gets rezzed manually, start_param will return 0, no matter if its the first or second object in-world. 1 Link to comment Share on other sites More sharing options...
steph Arnott Posted January 4, 2016 Author Share Posted January 4, 2016 ++start_param;//did not think of this, which is rather obvious now you wrote it. Link to comment Share on other sites More sharing options...
Nova Convair Posted January 5, 2016 Share Posted January 5, 2016 Not sure how the start_parameter will help you since the rezzed object gets that info from the rezzer. The "object_rez" event is triggered in the rezzer when it rezzes an object. It delivers the uuid of that rezzed object. Store that in a global variable. On next rez you use llGetObjectDetails with that uuid. If you get an empty list the object is not in sim and you can rez it. If you get the requested value the object is already there and you don't rez it again. 1 Link to comment Share on other sites More sharing options...
steph Arnott Posted January 5, 2016 Author Share Posted January 5, 2016 It is to stop more than one rezzed from the menu and remove the rezzed one already rezzed before rezzing another. If that makes sense. Link to comment Share on other sites More sharing options...
Rolig Loon Posted January 5, 2016 Share Posted January 5, 2016 Aha! If that's the idea, then what you do is script the rezzed object to listen to the rezzer. When you decide to rez a new object, send a DIE! message to the rezzed copy first. Then rez the new one. You don;t need to keep track of the rezzed object's UUID or do any internal counting in your rezzer. Just send a llRegionSay message each time you are about to rez a new object. 1 Link to comment Share on other sites More sharing options...
steph Arnott Posted January 5, 2016 Author Share Posted January 5, 2016 Am making things over complicated. Thanks for the info. Link to comment Share on other sites More sharing options...
Rolig Loon Posted January 5, 2016 Share Posted January 5, 2016 :smileywink: I do that all the time. My other common mistake is to see every problem as a scripting challenge. Sometimes the best solutions have nothing to do with a script. 1 Link to comment Share on other sites More sharing options...
steph Arnott Posted January 5, 2016 Author Share Posted January 5, 2016 I will remember your example, but will for this use what i normaly do and direct the kill message to the UUID. Thanks any way. object_rez(key id) { gObject_key = []; gObject_key = llListInsertList(gObject_key, [id], 0); } missed " llRegionSayTo" Link to comment Share on other sites More sharing options...
steph Arnott Posted January 6, 2016 Author Share Posted January 6, 2016 Is this legal? list gObject_key = [];object_rez(key id) { gObject_key = []; gObject_key += id; } Link to comment Share on other sites More sharing options...
Rolig Loon Posted January 6, 2016 Share Posted January 6, 2016 Yes, but I'm not sure why you'd want to do it. If you clear the contents of the list each time you rez a new object, it will never have more than the one new object UUID that you enter in the object_rez event. You might as well just save the UUID as a single key variable and be done with it. In this particular case, though you don't truly need to save the UUID at all. If you only plan to allow one copy of your object to be rezzed at a time, all you have to do is yell, "Die!" with llRegionSay on a unique channel and have whatever was rezzed before hear it and die. You don't need to know its UUID. It's the only thing that will be listening on your channel. Just be sure to yell it before you rez the next one. Link to comment Share on other sites More sharing options...
steph Arnott Posted January 6, 2016 Author Share Posted January 6, 2016 think i am just in a forest. Think i leave it for a few days and flow chart it. Best at times to walk away and start from scratch. BTW your info is not wasted it helpfull for later things, just have tunnel vision on this. Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now