Jump to content

Rezzing and object if not already rezzed


LiamCablenly
 Share

You are about to reply to a thread that has been inactive for 2648 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Help Please

 

I have a very simple script to change the look of a room by rezzing 6 prims to represent new walls, floor and ceiling.  I use llrezzobject() and it works well.  The script resides in an object in the room ans is called by the Touch event

Is there a way to prevent multipe touches of the calling object from running the scipt once it has been run, or is ther a way of checking if the prims have been rezzed and exiting the script cleanly if they have

something along the lines of

If not exist (New_Floor) then  llRezObject("New_Floor", <76.01010, 112.28984, 33.91292>, <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, 0);;

The real goal would be to have the first touch of the calling object to rezz the walls etc and the second touch to de-rezz them (llDie).  Is this possible ??

 

Many thanks in anticipation ...

 

 

Link to comment
Share on other sites

Here is a little example script of a simple check if an object rezzed by a rezzer exists in-world.

https://community.secondlife.com/t5/LSL-Scripting/Preventing-a-second-rez-until-the-first-object-is-gone/m-p/2750502#M24263

To remove them on a second touch you will have to have a listen script in each of the rezzed objects, to receive the die command.

If the objects are there, send a die command on a negative channel the objects are listening on. Otherwise, rez the objects.

Link to comment
Share on other sites

Hi - sorry

 

I have looked at example script and am unsure where the uuid's of my rezzed objects is defined ...

 

and am now totally confused as to how to check if the prim has been rezzed

 

My calling script is ...

 

default
{

    touch_start(integer total_number)
    {
        llRezObject("RedWall1", <76.03231, 108.57102, 36.19455>, <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, 0);
         
         llRezObject("RedCarpet", <76.01010, 112.28984, 33.91292>, <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, 0);
         
         
         llRezObject("RedWall2", <68.57831, 112.27352, 36.19455>, <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, 0);
         
         llRezObject("RedWall3", <76.44621, 115.93255, 36.21640>, <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, 0);
        
         llRezObject("RedCeiling", <76.04484, 112.28984, 38.42974>, <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, 0);
    }
}

 

 

 

 

I will be happy just to stop a subsequent rezzing after the first calling of the script

 

I can use llDie called by touch on the rezzed objects to delete tham as and when I wish to

 

any further help appreciated

 

Many thanks ...

Link to comment
Share on other sites


LiamCablenly wrote:

;

The real goal would be to have the first touch of the calling object to rezz the walls etc and the second touch to de-rezz them (llDie).  Is this possible ??

 

 

Try something using the logic behind this fragment:

 

integer toggle;default{	state_entry()	{			}	touch_start(integer total_number)	{		if(toggle = !toggle){			//do stuff to rez objects					}		else{			//tell the objects to call llDie();					}	}}

Just to be on the safe side, you might want to do something to unrez stray objects before rezzing a new set.  It shouldn't be necessary with this script logic but it's always best to check.

Link to comment
Share on other sites

{ I will be happy just to stop a subsequent rezzing after the first calling of the script }

*Use a flag to tell if the rezzer has been clicked once.

 

integer flag;

default
{

    touch_start(integer total_number)
    { if( ! flag)      

        {
          llRezObject("RedWall1", <76.03231, 108.57102, 36.19455>, <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, 0);
         
           llRezObject("RedCarpet", <76.01010, 112.28984, 33.91292>, <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, 0);
         
         
           llRezObject("RedWall2", <68.57831, 112.27352, 36.19455>, <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, 0);
         
           llRezObject("RedWall3", <76.44621, 115.93255, 36.21640>, <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, 0);
        
           llRezObject("RedCeiling", <76.04484, 112.28984, 38.42974>, <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, 0);

           flag = 1;

          }
    }
}

Link to comment
Share on other sites

If this is going to be in a product, you probably want to use a sensor, rather than rely on any local variable (flag or rezzed object ID). That's because a user might reset your script with a copy of the objects already rezzed, and your script having lost its state will rez out new ones, none the wiser.

Also, if the objects will usually stay rezzed out for a few minutes or more, you might choose not to script them to listen for llDie commands, but rather leave them unscripted and push an llDie script into them just when needed, using llRemoteLoadScriptPin().

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2648 days.

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
 Share

×
×
  • Create New...