Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

multiple weapons without rezzing question

Bizcut Vanbrugh
Registered User
Join date: 23 Jul 2006
Posts: 99
06-21-2007 18:42
i have a question about multiple melee weapons being made avalible with out the rezz and attach. I got ahold of a acme draw sheath script package and it has gotten me to think that it shouldnt be to hard to accomplish this. the sheathed weapons you wear in there various locations. then all of the drawn weapons would have to be linked into one object and worn in one hand. i am thinking that you would need a seperate prim for the held weapons as a control prim that would listen to for the draw command then pass that information to the proper prims to do there job. the main question comes in the takeing controls if you would have weapons that use different animations. i guess there would be a couple different ways to set this up but i was wanting to get some good scripting advice on how to do it thru scripting. any help would be nice.
Mortus Allen
Registered User
Join date: 28 Apr 2007
Posts: 528
06-26-2007 12:42
You mean you had a sword and a gun, both that would attach to the same hand and could be holstered or drawn, and you wanted to be able to draw each of them without having to switch which weapon is attached to the hand? If so let me know if you find a solution, I would be interested in such a gadgit.
BamBam Rockin
Registered User
Join date: 29 May 2007
Posts: 13
06-26-2007 13:57
llGetLinkName
llSetLinkAlpha

Coupled with a Global Var to specify which weapon (if any) should be out atm.
Bizcut Vanbrugh
Registered User
Join date: 23 Jul 2006
Posts: 99
06-26-2007 15:45
From: Mortus Allen
You mean you had a sword and a gun, both that would attach to the same hand and could be holstered or drawn, and you wanted to be able to draw each of them without having to switch which weapon is attached to the hand? If so let me know if you find a solution, I would be interested in such a gadgit.




yes that is exactly what i am looking for
Pip Helios
Registered User
Join date: 29 Sep 2006
Posts: 22
06-26-2007 17:12
Here's what it would look like for the alpha part.... I'm kind of too lazy to write up the anim part, sorry. But you would request perms to animate then add in something like in your sword but with a global variable to let it know which anims to use.

(weapon 1 script in all prims of that one weapon)
default
{
link_message(integer sender_num, integer num, string str, key id)
{
if (num=2)
llSetAlpha(0,ALL_SIDES);
else if (num=1)
llSetAlpha(1,ALLSIDES);
}
}

(weapon 2 script in all prims of that one weapon)
default
{
link_message(integer sender_num, integer num, string str, key id)
{
if (num=2)
llSetAlpha(0,ALL_SIDES);
else if (num=0)
llSetAlpha(1,ALLSIDES);
}
}

(master prim script)
default
{
on_rez(integer params)
{
llResetScript();
}

state_entry()
{
llListen( 0, "",llGetOwner(), "" );
llSetAlpha(0,ALL_SIDES)
}

listen( integer channel, string name, key id, string msg )
{
if (msg == "draw weapon 1";)
llMessageLinked(-1, 1, "", "";);


else if (msg == "draw weapon 2";)
llMessageLinked(-1, 0, "", "";);

else if (msg == "sheath";)
llMessageLinked(-1, 2, "", "";);
}
}
Bizcut Vanbrugh
Registered User
Join date: 23 Jul 2006
Posts: 99
06-28-2007 16:28
thanks i will try this out .
Mortus Allen
Registered User
Join date: 28 Apr 2007
Posts: 528
07-11-2008 13:12
Revisiting this question with some thought inspired other unrelated products that attach items from their inventory on request, such as vehicles giving huds that attach themselves. Thought the thought may be a little off topic but. Why are weapons made that are attached to ones hand using transparent textures when sheathed and appearing when unsheathed rather than detached when when sheathed and attached when drawn? One would think that this would be looked into my weapon makers especially now with ARC coming to light and the knowledge that invisible prims can still greatly impact client side FPS, and would be a great feature for those seeking dynamic combat with multiple weapons. No I am sure some will state Attach permissions may be an issue, but is there not a way to make these permissions persist for as long as that avatar is the owner?
Nexii Malthus
[Cubitar]Mothership
Join date: 24 Apr 2006
Posts: 400
07-11-2008 18:14
You can not force or request to attach to a position or switch attachment points. Unless we start getting a mainstream viewer that allows this, this is the only efficient way to go about it.
_____________________

Geometric Library, for all your 3D maths needs.
https://wiki.secondlife.com/wiki/Geometric

Creator of the Vertical Life Client
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
07-11-2008 21:54
Right. The thing is that you can only detach to avatar inventory, and there's no way to reattach from there via script. You cannot do the equivalent of a "drop" that leaves the object in-world from a script. You cannot switch from one attachment point to another from script. You can only use a script to attach an object to the avatar when it starts out in-world.

In other words it is a one-way street: in-world -> attached -> inventory.

You could rez a new object each time and have it attach to the desired location, then detach it to inventory when done, but that'll leave a ton of objects in your "Objects" folder and won't allow the weapon to save its state when you "sheath" it.