A reference to a highly regarded Linux package tool). The difference between Apt-Rez and commercial packagers(at least the ones I've seen before) is that you can package more than one object into Apt-Rez. Although at this point the "move the box and the build moves with it" feature is a bit crude, I am slowly working on it as it is my first major scripting project from scratch.Without further ado, here's Apt-Rez.lsl:
//Apt-Rez v0.7 rezzing system
//(C) 2007, Antonius Misfit
//released under the GNU GPLv3 or later
integer channel=1000;
integer build_link_chan=999;
integer build_del_chan=998;
list invlist;
default
{
state_entry()
{
llListen(channel,"","",""
;llListen(build_link_chan,"","",""
;}
touch_start(integer total_number)
{
invlist=[];
integer i;
for(i=0;i<llGetInventoryNumber(INVENTORY_OBJECT);i++)
{
invlist=invlist+llGetInventoryName(INVENTORY_OBJECT,i);
}
//feel free to personalize the dialog text
if(llDetectedKey(0)==llGetOwner())
{
llDialog(llGetOwner(),"Apt-Rez menu.\n\nPlease choose one of the below options to rez.",invlist+["sync_build","del_build","Update"],channel);
}
}
listen(integer chan,string name,key id,string mes)
{
//You may have to edit the position vector and rotation, depending on your build
if(chan==channel)
{
if(mes=="sync_build"

{
llShout(build_link_chan,(string)llGetPos());
}
else if(mes=="del_build"

{
llShout(build_del_chan,mes);
}
else if(mes=="Update"

{
llLoadURL(llGetOwner(),"Get Latest Apt-Rez sources?","http://tinyurl.com/2zsbsa"
;}
else
{
//Set the rotation offset so it rezzes the right way, just behind the rezzer
llRezObject(mes, llGetPos()+<0,1,0> , ZERO_VECTOR, ZERO_ROTATION, 0);
}
}
}
}
=========
LinkBuilder.lsl
=========
//Place this script in all objects to be used with Apt-Rez
integer build_link_chan=999;
integer build_del_chan=998;
default
{
state_entry()
{
llListen(build_link_chan,"","",""
;llListen(build_del_chan,"","",""
;}
listen(integer channel,string name,key id,string msg)
{
if(channel==build_link_chan)
{
//Set the postion offset relative to the rezzer
llSetPos(((vector)msg)+<0,1,0>
;//Set the rotation offset so the build looks right
llSetRot(<0,0,0,1>
;}
if(channel==build_del_chan)
{
llDie();
}
}
}
Alternatively, you can download the latest source code here:
http://tinyurl.com/2zsbsa