Jump to content

Tutorial: An introduction to rezzing objects by script


Innula Zenovka
 Share

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

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

Recommended Posts

Ok, what if the objects yes multiple objects are  no copy items set for sale. 

I already have a script that will  rez and position  the objects  but it only works  in one direction.  As the  script is modify is there a way to  put a few lines into the script   only in the rezzer to read that no matter  how it is positioned the objects will  rez out as the script  already  has been set up to rez the defined objects in it (ie 5 across 3 up/down on a shelving unit that is acting as the rezzer)  ? 

Currently  they only will  rezz out properly   from west to east   like that  but    if you move the   shelves  the script doesn't want to keep the different position (wall is a diagonal or  it should rez  E to W   as an example_ it still thinks the shelving unit is  facing  the original direction  

The only thing I am able to get to  function atm is the rotation of the  objects  individually and it  rez them out  correctly in a 5x3  rows but  only in one direction  

The objects can not have additional scripts  added to it  as they  are one of a kind items no copy no modify 

Edited by Chantilly Levee
attempting to be more clear and additional information
Link to comment
Share on other sites

  • 4 weeks later...

@Chantilly Levee

just don't multiply by the rezzer's rotation?

 touch_start(integer total_number)
    {    string myObj    = llGetInventoryName( INVENTORY_OBJECT,0 );        
         vector myPos    = llGetPos();       
         vector rezPos   = myPos + <2.0, 0.0, 0.2>; // or region coordinates
         vector rezVel   = <1.0, 0.0, 0.0>;
         rotation rezRot =  llEuler2Rot(<0.0, 0.0, 0.0> * DEG_TO_RAD );         
         integer param   = 10;        
         llRezAtRoot(myObj, rezPos, rezVel, rezRot, param);
    }

 

Link to comment
Share on other sites

  • 10 months later...
  • 1 month later...

@finiks66   sorry so late, but it may help others, so..

You can pass things thru the rez functions.

In the above code, the "param" variable can pass a channel to the rezzed object.

:: ignore accidental quote ::

Quote

if anyone knows how to get rid of a quote, ...i sure cant figure out how to remove this.

integer itemChan = 0x80000000 | (integer)("0x" + (string)llGetKey() );
llRezAtRoot(myObj, rezPos, rezVel, rezRot, itemChan);

 

 

and in the rezzed object...

on_rez(integer param)
{ // integer passedChan = param;
}

etc etc ..

Edited by Xiija
Link to comment
Share on other sites

2 hours ago, Xiija said:
integer itemChan = 0x80000000 | (integer)("0x" + (string)llGetKey() );
llRezAtRoot(myObj, rezPos, rezVel, rezRot, itemChan);

If your channel is based on they key of the rezzer, you can actually calculate that in the on_rez event of the child and save the parameter for some other information:

// rezed item script
on_rez(integer i)
{
  key parent = llList2Key(llGetObjectDetails(llGetKey(),[OBJECT_REZZER_KEY]),0);
  integer itemChan = 0x80000000 | (integer)("0x" + (string)parent );
  /// use itemchan in a listen etc. etc.
}

 

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 338 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...