Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Library: Apt-Rez open source build packager/rezzer

Antonius Misfit
Certifiable Linux Addict
Join date: 13 Jun 2006
Posts: 97
10-06-2007 22:12
As there doesn't seem to be one yet, I've created a simple open source build packager and rezzer I call "Apt-Rez";(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:
From: someone

//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
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
10-09-2007 16:39
Missed this when it was 1st posted. New admissions are always more then welcome to the library. Fantastic resource for the ones just learning LSL. Just wanted to point out that this actually isn't the 1st build rezzer in the library:

/15/ff/96777/1.html

Builder's Buddy has been around for awhile now and is equivalent to Rez-Fauz et al.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum