group members click object and it moves
|
|
Nina Stepford
was lied to by LL
Join date: 26 Mar 2007
Posts: 3,373
|
05-29-2007 16:09
i would like to have a large cylinder have the following function: when a member of its set group clicks on it, it raises. when it is clicked again it lowers. if the member forgets to lower it, it automatically lowers itself after a given time.
is there such a script somewhere- even one i could modify? ive looked but i cannot find one. i tried using a couple of different door script but they caused the cylinder to swing rather than move linear.
|
|
Daten Thielt
Registered User
Join date: 1 Dec 2006
Posts: 104
|
05-29-2007 21:37
find a movement script then in the touch_Start event put soming like
integer group = llDetectedGroup(0); if(group) { move or somming }
i would write out the whole code but 1 i believe in learning and 2, im lazy
|
|
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
|
05-29-2007 21:52
From: Daten Thielt find a movement script then in the touch_Start event put soming like
integer group = llDetectedGroup(0); if(group) { move or somming }
i would write out the whole code but 1 i believe in learning and 2, im lazy Daten's solution is right, except it would be llSameGroup(llDetectedKey(0))  Just so you don't go hunting for a llDetectedGroup function. 
|
|
Nina Stepford
was lied to by LL
Join date: 26 Mar 2007
Posts: 3,373
|
05-29-2007 22:08
ok so now all i have to do is add movement. here's what i have so far: default { touch_start(integer total_number) { integer group = llDetectedGroup(0); if(group) { llWhisper(0, "Opening rack vault...");
} else { llSay(0, "Authentication Failed."); llSay(0, "Please ensure you are wearing your group title."); } } }
|
|
Daten Thielt
Registered User
Join date: 1 Dec 2006
Posts: 104
|
05-29-2007 22:29
ill do it the lazy way  integer group; default { state_entry() { group = llDetectedGroup(0); } touch_start(integer start) { vector open = llGetPos(); open.x = open.x +1; if(group) { llSetPos(open) state closed; } } } state closed; { state_entry() { } touch_start(integer start) { vector closed = llGetPos(); closed.x = open.x -1; if(group) { llSetPos(closed) state default; } } } sorry if there is any syntax errors havent sleped in 26 hours
|
|
Nina Stepford
was lied to by LL
Join date: 26 Mar 2007
Posts: 3,373
|
05-29-2007 22:56
ive been researching this (not sure which direction to take) and was thinking i needed to explorer 'moveToTarget'. but i am getting side tracked by all this physical/non physical and damening and bouyancy and what not. is there a way of simply saying 'move this prim from x to y at such and such velocity'?
|
|
Nina Stepford
was lied to by LL
Join date: 26 Mar 2007
Posts: 3,373
|
05-30-2007 00:08
ok, i now know why movetotarget isnt the solution. i did manage to hack together something to make this happen. i found aome code some guy had been asking about and adapted it to do what i needed vector down = <207.774,194.094,45.774>; vector up = <207.774,194.094,47.744>; float time = 60.0; default { state_entry() {
llSetPos(up); }
touch_start(integer total_number) { integer group = llDetectedGroup(0); if(group) { llWhisper(0, "Opening rack vault..."); llPlaySound("vaultsound", 1.5); llWhisper(0, "The vault will remain open for 60 seconds."); llSetPos(down); llSleep(time); llWhisper(0, "Closing the vault."); llPlaySound("vaultsound", 1.5); llSetPos(up); } else { llSay(0, "Authentication Failed."); llSay(0, "Please ensure you are wearing your group title."); } } }
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
05-30-2007 13:21
From: Nina Stepford ok, i now know why movetotarget isnt the solution. i did manage to hack together something to make this happen. i found aome code some guy had been asking about and adapted it to do what i needed Although the code you have posted will move the object up, wait a bit then move it down it wont allow the Avatar to retouch it to set it back down. LSL is monotonic, i.e. only a single event handler can be running at a time and it cannot be interupted while it is running. So while its in the current event touch and sleeping, any other touches will just get queued up, pobably causing the object to be put back into the open position again.
_____________________
I'm back......
|