Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

A slight prob

RaveWolf Strauss
Registered User
Join date: 1 Jan 2006
Posts: 53
02-25-2008 21:58
Im having a little problem with a scripted attachment im trying to make.Its about 41 total prims and only two of them i want to be able to have die and be able to rez a diffrent one in its place but am unsure how i can have jus the two prims die without deleting the whole object since they would need to be linked. below is the scripts im using.Is there a way to do something simular as the one below while linked but not kill the entire attachment?

ROOTPRIM SECTION

CODE
list MENU1 = [];
list MENU2 = [];
integer listener;
integer MENU_CHANNEL = 1000;


Dialog(key id, list menu)
{
llListenRemove(listener);
listener = llListen(MENU_CHANNEL, "", NULL_KEY, "");
llDialog(id, "Select one object below: ", menu, MENU_CHANNEL);
}

default
{
on_rez(integer num)
{
llResetScript();
}

touch_start(integer total_number)
{
integer i = 0;
MENU1 = [];
MENU2 = [];
integer c = llGetInventoryNumber(INVENTORY_OBJECT);
if (c <= 12)
{
for (; i < c; ++i)
MENU1 += llGetInventoryName(INVENTORY_OBJECT, i);
}
else
{
for (; i < 11; ++i)
MENU1 += llGetInventoryName(INVENTORY_OBJECT, i);
if(c > 22)
c = 22;
for (; i < c; ++i)
MENU2 += llGetInventoryName(INVENTORY_OBJECT, i);
MENU1 += ">>";
MENU2 += "<<";
}
Dialog(llDetectedKey(0), MENU1);
}

listen(integer channel, string name, key id, string message)
{
if (channel == MENU_CHANNEL)
{
llListenRemove(listener);
if (message == ">>")
{
Dialog(id, MENU2);
}
else if (message == "<<")
{
Dialog(id, MENU1);
}
else
{
llSay(1000, "die");
// todo add offsets so box sites perfect on rezzer
llRezObject(message, llGetPos(), ZERO_VECTOR, llGetRot(), 0);
}
}
}
}


THEN THE DIE SECTION

CODE

{
state_entry()
{
llListen(1000,"","","");
}

listen(integer chan, string name, key id, string msg)
{
if(msg=="die")
{
llDie();
}
}
}
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-25-2008 22:29
I've never tested so I dodn't know the effect of linking or unlinking prims in attachments, but that sounds like a really complex solution, compared to making those prims either turn invisible (llSetAlpha), or shrink out of the way (llSetScale), or both (llSetPrimitiveParamenters). my suggestion would be to go with one of those methods.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -