|
Fearsum Vellhi
Registered User
Join date: 29 Oct 2006
Posts: 19
|
02-10-2007 08:42
Hello. Any advice would be appreciated. I put together a script for a locking sliding door, and I want to make it even easier to lock/unlock than having to edit a notecard or talk to the door. I figured that I would just use the Sit option from the right click pie. Well, it works fine, locks and unlocks the door... but I sit on the door, then jump off. Can anyone give me any advice for stopping this silly animation? Please? The 'changed' code is below: changed(integer change) { // something changed if (change & CHANGED_LINK) { // and it was a link change if (llAvatarOnSitTarget() != NULL_KEY) { // somebody is sitting on me llUnSit(llAvatarOnSitTarget()); // unsit him if (locked) { locked = FALSE; llSetSitText("Lock"); } else { locked = TRUE; llSetSitText("Unlock"); } } } }
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
02-10-2007 08:49
Your trying for the impossible. The SIT pie chart item will make your AV sit before any of your script code is called.
|
|
Scott Bristol
Registered User
Join date: 20 Jan 2007
Posts: 13
|
02-10-2007 09:12
Why don't you just add a separate prim the user can touch to lock/unlock it (assuming you already use touch on the main door to open/close it)?
|
|
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
|
02-10-2007 16:21
I put my lock/unlock/window control hud code in a control panel, just the panel near the door where only the owner knows about it. It is just another child prim in the linked set.
|
|
Fearsum Vellhi
Registered User
Join date: 29 Oct 2006
Posts: 19
|
02-10-2007 19:18
Interesting suggestion, Ed. I tried passing the locked/unlocked status through a message on a lock prim I linked to the door, and that works fine. Only thing the nitpicker in me would change is that when I lock or unlock the door, it opens because it sets off the touched message in the base door. Anyone have a suggestion about how to lock/unlock without opening the door?
Oh yeah, and it DOUBLED my door prim usage! lol. (lives in a small apt, every prim counts)
|
|
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
|
02-11-2007 01:49
how about a dialog menu? -LW
_____________________
L$ is the root of all evil videos work! thanks SL 
|
|
Fearsum Vellhi
Registered User
Join date: 29 Oct 2006
Posts: 19
|
02-11-2007 02:42
Though about a HUD menu. Would make it easier to add to, remove from the access list. But then I have to weigh the cost/benefits. Oh, and would that information get lost every time the sim restarted? Anyone know the answer to that? Notecard seems to be only persistent data storage that I know of. Well, that, and hard coding info.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
02-11-2007 07:05
From: Fearsum Vellhi Interesting suggestion, Ed. I tried passing the locked/unlocked status through a message on a lock prim I linked to the door, and that works fine. Only thing the nitpicker in me would change is that when I lock or unlock the door, it opens because it sets off the touched message in the base door. Anyone have a suggestion about how to lock/unlock without opening the door?
Oh yeah, and it DOUBLED my door prim usage! lol. (lives in a small apt, every prim counts) Dont call the open/close code just set the status to unlocked.....
|