|
Servious Taiko
Registered User
Join date: 2 Aug 2006
Posts: 3
|
08-02-2006 14:58
Well what i'm trying to do is make attachable itmes switch depending what it is on. Basicaly i have 3 items. A Sword, a scabbered, and a combo of both, sword attaches to my hand the scabbered and comb to my spine, I want it so when I don't have the sword attached the combo one is auto attached and if the sword is attached it auto attaches the scabbered insted of the combo one. Is that to difficult to do, I tried to write a code but i have no scripting experience and i think i'm way off for the coding, i need some help please. my bad code: default { attach(key sword) { if (sword != NULL_KEY) { llAttachToAvatar(attach_rhand); attach(key scab) { if (scab != NULL_KEY) { llAttachToAvatar(attach_spine); } } } else { attach(key scabwsword) { if (scabwsword != NULL_KEY) { llAttachToAvatar(attach_spine) } } } } Thank you for any help, Servious
|
|
Xixao Dannunzio
Owner, X3D Enterprises
Join date: 20 Mar 2006
Posts: 114
|
08-02-2006 15:16
I did this for a friend's lightsaber. When the saber was held, it sent a message to his belt pack that changed the alpha on all the linked pieces to 0. This created the effect that the saber had been removed. Then, a spoken '/ls belt' command caused all the prims to go back to full alpha, and the handheld one detached itself.
Best way I can think of to do it.
|
|
Servious Taiko
Registered User
Join date: 2 Aug 2006
Posts: 3
|
08-03-2006 09:25
If yu didn't notice from my total lack of knowledge from my first post i'll just say it here.
I have no idea what you just said... sorry
I need some help just getting this to work.
|
|
Psyra Extraordinaire
Corra Nacunda Chieftain
Join date: 24 Jul 2004
Posts: 1,533
|
08-03-2006 09:46
Hey, Servious  Unortunately, when items are not actually rezzed inworld, they can't operate any scripts. Though a script can be used to detach an item fom an avatr, one cannot attach something from your inventory via script.  Xixao's solution is basically... you wear all the items at once. Scripts are set in the item that allow you to make one or more of the objects visible and the others invisible... so you hold an invisible sword, looking at a visible sword in a visible sheath. When you draw your sword (a voice command, or HUD button perhaps), the script tells the sword inside the sheath to turn invisible, and the one in your hand to turn visible... so it looks like the sword has been moved to your hand. These scripts are not terribly hard to make. I can drop some sample scripts on you that will let you use a channeled command (like /1 draw and /1 sheathe) to set the alphas. It'll have to wait till I'm home from work though, that's still 6 hours away.  PS: 'set the alphas' is the term for making them visible/invisible. 
_____________________
E-Mail Psyra at psyralbakor_at_yahoo_dot_com, Visit my Webpage at www.psyra.ca  Visit me in-world at the Avaria sims, in Grendel's Children! ^^
|
|
Servious Taiko
Registered User
Join date: 2 Aug 2006
Posts: 3
|
08-03-2006 10:36
Thank you that sounds like it would work. I would just have to edit the items a little to make it work like how you described. It actualy sounds liek it would be simpler your way.
I'm very grateful,
Thank you again.
|