Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

A helping hand

Blot Brickworks
The end of days
Join date: 28 Oct 2006
Posts: 1,076
03-22-2009 03:52
I am not a good scripter, I fiddle about with them.can anybody help?
this is a regular free script that I like to use,how can I change the script to show on one side only...........is that possible?

integer choice ;

integer number;
default
{
state_entry()
{
llSetTimerEvent(.5);

number = llGetInventoryNumber(INVENTORY_TEXTURE);
choice = 1;
}

touch_start(integer numbert)
{
//llSay(0,(string)choice);
if (choice>=number)
{
choice =0;
}
string name = llGetInventoryName(INVENTORY_TEXTURE, choice);
if (name != "";)
{
llSetTexture(name, ALL_SIDES);
choice+=1;

}
}


timer()
{

if (choice>=number)
{
choice =0;
}

string name = llGetInventoryName(INVENTORY_TEXTURE, choice);
if (name != "";)
{
llSetTexture(name, ALL_SIDES);
choice+=1;

}

}

}




I think it's to do with all sides but I could use help ,Cheers
_____________________


Blots Plot @ THE OLD MERMAID INN
http://slurl.com/secondlife/Dunbeath
/206/85/26

http://phillplasma.com/2009/05/01/blots-plot-the-old-mermaid-inn/
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
03-22-2009 04:07
I'd think you'd replace the ALL_SIDES with the face number of the face you want the texture to appear on.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
03-22-2009 04:08
You are right, all prims have numbered sides or faces. If you write:
llSetTexture(name, 0); face number 0 will get the texture.
See: http://www.lslwiki.net/lslwiki/wakka.php?wakka=side
for more
_____________________
From Studio Dora
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
03-22-2009 04:12
Yeah, the tricky part is figuring out what the side number you want is.

The "easy" way to find a side number without poring through a table:

Edit the prim, pick Select Texture, and click the face you're interested in. Then Ctrl-Alt-Shift-T (or Advanced->Rendering->Selected Texture Info) will print the face number and some texture details to chat in blue.

If poring through a table is easier, try:
http://wiki.secondlife.com/wiki/Category:LSL_Face
Papalopulus Kobolowski
working mind
Join date: 11 Aug 2006
Posts: 326
03-22-2009 04:14
yes you need specify the face numer on the second value:


CODE


integer side_face=0;//0 - 1 -2- 3 - etc
integer choice ;

integer number;
default
{
state_entry()
{
llSetTimerEvent(.5);

number = llGetInventoryNumber(INVENTORY_TEXTURE);
choice = 1;
}

touch_start(integer numbert)
{
//llSay(0,(string)choice);
if (choice>=number)
{
choice =0;
}
string name = llGetInventoryName(INVENTORY_TEXTURE, choice);
if (name != "")
{
llSetTexture(name, side_face);//<---------- here
choice+=1;

}
}


timer()
{

if (choice>=number)
{
choice =0;
}

string name = llGetInventoryName(INVENTORY_TEXTURE, choice);
if (name != "")
{
llSetTexture(name, side_face);//<---------- here
choice+=1;

}

}

}


Also you can use this script to know the face number and then just remove the script.

CODE


default
{
state_entry()
{

}
touch_start(integer total_number)
{ integer x;
integer touchedFace =llDetectedTouchFace( x );
llSay(0,(string)touchedFace);
}
}

_____________________


RAW terrain files - terraform your SIM!!
http://www.wishland.info/
PD:the wiki its your friend ;)
http://wiki.secondlife.com/wiki/LSL_Portal
Blot Brickworks
The end of days
Join date: 28 Oct 2006
Posts: 1,076
03-22-2009 05:45
Thanks all for the swift reply,that should sort me out.
_____________________


Blots Plot @ THE OLD MERMAID INN
http://slurl.com/secondlife/Dunbeath
/206/85/26

http://phillplasma.com/2009/05/01/blots-plot-the-old-mermaid-inn/
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
03-22-2009 06:16
Be wary of dropping an old fashioned face numbering script into just any old prim.

I just realized the one above is a new fashioned one, very nice.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
03-22-2009 07:45
From: Papalopulus Kobolowski

default
{
state_entry()
{

}
touch_start(integer total_number)
{ integer x;
integer touchedFace =llDetectedTouchFace( x );
llSay(0,(string)touchedFace);
}
}


From: SuezanneC Baskerville
Be wary of dropping an old fashioned face numbering script into just any old prim.

I just realized the one above is a new fashioned one, very nice.


you also don't have to put it in each prim, just the root prim, you can also combine it with llDetectedLinkNumber to find out with face on which prim number you touched
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Papalopulus Kobolowski
working mind
Join date: 11 Aug 2006
Posts: 326
03-22-2009 10:58
CODE


default
{
state_entry()
{

}
touch_start(integer total_number)
{ integer x;
integer touchedFace =llDetectedTouchFace( x );
integer link_touched= llDetectedLinkNumber( x );
llSay(0,"The face number is :"+(string)touchedFace+" : "+" On the link number :"+(string)link_touched);
}
}
_____________________


RAW terrain files - terraform your SIM!!
http://www.wishland.info/
PD:the wiki its your friend ;)
http://wiki.secondlife.com/wiki/LSL_Portal