Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

change avatar's cloth by script

Milan Luminos
Registered User
Join date: 18 Sep 2008
Posts: 3
09-18-2008 00:33
Hi,

I am a newbie in scripting the objects in SL, and need your help.

Is there an automatic way to change, for example, the avatar's t-shirt to another one, based on the script of attached object?

For ex.,

if (event1) {avatar wears red shirt} else {avatar wears blue shirt}

Is it possible?

Thank you very much in advance!!!
Tegg Bode
FrootLoop Roo Overlord
Join date: 12 Jan 2007
Posts: 5,707
09-18-2008 00:46
I know you can remove other peoples clothing somehow using the Restrained Life viewer, i haven't seen any instances of putting on clothing yet, maybe it can be done later.
_____________________
Level 38 Builder [Roo Clan]

Free Waterside & Roadside Vehicle Rez Platform, Desire (88, 17, 107)

Avatars & Roadside Seaview shops and vendorspace for rent, $2.00/prim/week, Desire (175,48,107)
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
09-18-2008 03:15
From: Tegg Bode
I know you can remove other peoples clothing somehow using the Restrained Life viewer, i haven't seen any instances of putting on clothing yet, maybe it can be done later.

If the avatar is using the Restrained Life Viewer there are now ways for people to dress as well as undress him or her, using "shared folders" http://wiki.secondlife.com/wiki/RestrainedLifeAPI#Shared_Folders

Not otherwise, though.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
09-18-2008 18:08
translation: not via scripting, only via specialized clients (and Im not even sure you can do it to yourself via the restrained life' client, it's generally used for a specific person(s) to control actions of someone using that client... theres links for the viewer mentioned in other forums if you search... perhaps RA or resident run websites, you'd get more specific info)
_____________________
|
| . "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...
| -
Tegg Bode
FrootLoop Roo Overlord
Join date: 12 Jan 2007
Posts: 5,707
09-18-2008 23:32
I was under the impression you conuld click on an item someone was wearing or a collar and have it send a signal to RL client, so therefore I thought you could strip clothing via script but forced wearing may be another kettle of fish?
_____________________
Level 38 Builder [Roo Clan]

Free Waterside & Roadside Vehicle Rez Platform, Desire (88, 17, 107)

Avatars & Roadside Seaview shops and vendorspace for rent, $2.00/prim/week, Desire (175,48,107)
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
09-18-2008 23:48
ive done this with a bot but as for an actual avatar person it would have to be a modified client i think
_____________________
L$ is the root of all evil
videos work! thanks SL :)
Milan Luminos
Registered User
Join date: 18 Sep 2008
Posts: 3
09-19-2008 01:26
Thanks for your replies!

I did not mean to force avatar to undress.
To clarify my question:
... imagine that I attach, for example, prim hat to my own avatar. This object (prim hat) has a script: if (touch the hat) {own avatar wears red shirt} else {own avatar wears blue shirt}.

Maybe, there is no such possibility (functions) in SL, i do not know.

Can scripted object influence on the avatar's cloth?
Thanks.
Gregor Mougin
Registered User
Join date: 22 Jan 2007
Posts: 8
09-19-2008 04:24
From: Milan Luminos

Is there an automatic way to change, for example, the avatar's t-shirt to another one, based on the script of attached object?


Short answer: It can be done.

It requires the RealRestrained viewer. This viewer provides an interface between LSL scripts and some functions of the viewer that normally can't be accessed through LSL, including the detachment and attachment of clothes.

Have a look at: http://wiki.secondlife.com/wiki/Alternate_viewers#Marine_Edition
http://wiki.secondlife.com/wiki/LSL_Protocol/RestrainedLifeAPI

Feel free to contact me in world if those links sound like klingon to you ;-)
Beverly Ultsch
Registered User
Join date: 6 Sep 2007
Posts: 229
09-19-2008 06:17
From: Milan Luminos

To clarify my question:
... imagine that I attach, for example, prim hat to my own avatar. This object (prim hat) has a script: if (touch the hat) {own avatar wears red shirt} else {own avatar wears blue shirt}.


As has been said, it can be done with the restrained life viewer, and is actually quite easy.

Using your example you would creat a new folder called #RLV, then create two sub-folders, Blue Shirt and Red Shirt into which you put your shirts.

Then use the following script in the hat

CODE

integer blueShirt;

default
{
touch_start(integer total_number)
{
if(llDetectedKey(0) == llGetOwner())
{
if(blueShirt)
{
llOwnerSay("@attach:Red Shirt=force");
}
else
{
llOwnerSay("@attach:Blue Shirt=force");
}
blueShirt = !blueShirt;
}
}

attach(key attached)
{
if(attached)
{
llOwnerSay("@attach:Blue Shirt=force");
blueShirt = TRUE;
}
}
}


Now when the hat is attached you will wear the blue shirt, each time the hat is clicked it will swap between the blue and red shirts. Testing that the clicker is the owner prevents anyone else from changing your shirt. The main question is if you are happy with a solution that relys on a modified viewer :)
Milan Luminos
Registered User
Join date: 18 Sep 2008
Posts: 3
09-25-2008 04:03
From: Beverly Ultsch
The main question is if you are happy with a solution that relys on a modified viewer :)


Hi everyone!

Thanks a lot for your replies!!! :)
Special appreciation to Beverly Ultsch for detailed nice example!