Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Script to set the hollow-ness of a prim...

Gryphon Stonebender
Registered User
Join date: 25 Jan 2005
Posts: 24
01-29-2005 21:19
I would liek to be able to automate the "open" and "closing" of a hole in my floor. I woudl ike to touch somthing instead of editing the prim...

any way to do it?
Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
01-29-2005 21:33
you want to look at llSetPrimitiveParameters() .
Gryphon Stonebender
Registered User
Join date: 25 Jan 2005
Posts: 24
01-29-2005 21:59
OK I am reading through the guides...

I have found things I need, but I am missing a few things...

default
{
state_entry()
{
llListen(0,"",llGetOwner(),"";);
}
listen(integer channel,string name,key id,string msg)
{
if("open: "==llSetPrimitiveParams([HOLLOW, 0.35]);
{
}
}

any suggestions are most welcome as I am but a student.

Thanks,
Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
01-29-2005 22:13
well first off you'll make more friends if you make it a touch and not a listen. :D that's easier on the servers. try something like.......
CODE
integer open = FALSE;

default {
state_entry() {
}

touch_start(integer total_number) {
if (!open) {
llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_BOX, PRIM_HOLE_CIRCLE, <0.0, 1.0, 0.0>, 0.9, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>]);
// the 0.9 is how hollow to make it.
open = TRUE;
} else {
llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_BOX, PRIM_HOLE_CIRCLE, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>]);
open = FALSE;
}
}
}

llSetPrimitiveParams() is pretty nasty looking but with this example you should be able to figure out how to change it to what you need by looking at the wiki page.
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
If ya wanna do it on the fly by voice....
01-30-2005 00:52
CODE
default 
{
state_entry()
{
llListen(0, "", llGetOwner(), "");
}

on_rez(integer num)
{
llResetScript();
}

listen(integer chan, string name, key id, string msg)
{
if ( llGetSubString(msg,0,6) == "hollow " )
{
float vhollow = (float)(""+llDeleteSubString(msg,0,6)+"");
llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_BOX, PRIM_HOLE_CIRCLE, <0.0, 1.0, 0.0>, (float)vhollow, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>]);
}
}
}


just say "hollow (insert value)".
_____________________
Gryphon Stonebender
Registered User
Join date: 25 Jan 2005
Posts: 24
01-30-2005 07:29
Wow thanks guys,

I know I am missing somthing here, but how do I assign a chanel to have the "door" listen for the open comand?

thanks,
Gryphon Stonebender
Registered User
Join date: 25 Jan 2005
Posts: 24
01-30-2005 07:40
works great... seems toalways open to the same % no matter what number i put after "hollow 35"...

thanks

Never mind.. .35... damn decimals!

Thanks!