Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: Touch on and off for Light and Phantom

ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
01-11-2006 15:14
As someone very new to scripting I'm thrilled to be able to contribute something here.

CODE

//LIGHT ON OFF by ArchTx Edo
//Changes a prim from wood to light and back again each time it is touched.

default
{
touch_start(integer total_number)
{
llSetPrimitiveParams([PRIM_MATERIAL, PRIM_MATERIAL_WOOD]); state unlit;
}
}

state unlit
{
touch_start(integer total_number)
{
llSetPrimitiveParams([PRIM_MATERIAL, PRIM_MATERIAL_LIGHT]); state default;
}
}




CODE

//PHANTOM ON OFF by ArchTx Edo
//Changes and object from solid to phantom and back again each time it is touched

default
{
touch_start(integer total_number)
{
llSetPrimitiveParams([PRIM_PHANTOM, FALSE]); state phantom;
}
}
state phantom
{
touch_start(integer total_number)
{
llSetPrimitiveParams([PRIM_PHANTOM, TRUE]); state default;
}
}


_____________________

VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30
http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240
http://shop.onrez.com/Archtx_Edo
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Original Thread
01-12-2006 09:46
/15/44/82003/1.html
_____________________
i've got nothing. ;)
Lora Morgan
Puts the "eek" in "geek"
Join date: 19 Mar 2004
Posts: 779
01-12-2006 13:55
Thanks for posting these. Even after doing a few scripts I never really thought to use states like that. Lots to learn!