Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

On Touch thoughts

Lyndzay Meili
Registered User
Join date: 2 Sep 2007
Posts: 28
10-06-2008 21:07
Hi there,

Working on a build right now and have hit a point where I'm looking for opinions/ thought/work arounds for one element.

I've built a gun that uses the ready jack gun script and it uses an touch_start to Detect Owner, Get Permissions if not attached, to disarm the gun (stop the animation and release controls) if attached and finally arm the gun if attached and disarmed (Start animation and take controls) and all that works fine.

The thing is that I want to add a menu function in there by using the same touch_start, right now for testing I have the menu in place of the disarm section, so the avi always stays ready with the gun.

My question I guess is do people want the disarm so they can walk around with the gun at their side or just leave it as I have it with no disarm, or is there a way around so I could have a touch to disarm (if armed) and without calling the menu unnecessarily.

Right now when the menu closes it sends the gun back to the armed state.

here is the original code snippet

<php>
touch_start(integer x)
{
if (llDetectedKey(0) != llGetOwner())
{
return;
}
else if (!llGetAttached())
{
getPerms();
}
else if (gArmed)
{
disarm();
}
else {
arm();
}
}

</php>

I hope that made sense, I've been trying to formulate this into a question and don't know if I succeeded :)

Thanks for any input.

Lyndz~
_____________________
"Be who you are and say what you feel, because those who matter don't mind, and those that mind, don't matter."
—Dr. Seuss
Cypher Ragu
[Mad Scientist]
Join date: 6 Jul 2008
Posts: 174
10-12-2008 21:06
Well you could have "ARM" and "DISARM" as options in the menu that pops up, or if you want to make things more complicated you could require that the user holds down the mouse button while clicking on the weapon to bring up the menu.
_____________________
Life is a highway... And I just missed my exit.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
10-12-2008 22:06
That sounds more like a user feedback question than a scripting question. You may not be asking the best audience on this forum. I'm not sure how many of us play with guns a lot.