|
Gaberoonie Zanzibar
Registered User
Join date: 16 Oct 2008
Posts: 3
|
06-30-2009 17:30
I want to script something such that two avatars are required to trigger an event in the following way: *Avatar 1 touches and holds click on the object *Avatar 2 touches and releases while Avatar 1 is holding click down. This triggers the event, this can only happen while Avatar 1 is clicking/holding. Any pointers? Thanx! 
|
|
Cyd Woolley
Carpe Cerevisiam
Join date: 6 Jan 2007
Posts: 21
|
06-30-2009 17:50
The touch_start event is triggered whenever a user depresses the left mouse button while hovering the mouse cursor over a scripted object, and the touch_end event is triggered when the user releases the depressed left mouse button. The time between the two events directly related to how long the user holds the left mouse button down. You may be able to use those two events to watch for the conditions you mentioned and take action accordingly (assuming these events are reentrant, that is). One thing to be aware of, though, is that both the touch_start and touch_end events can be triggered in response to multiple touches during a single clock cycle (thus the total_number parameter that's passed into both).
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
06-30-2009 23:29
integer vBooMsgSend = TRUE;
default{ touch( integer vIntTotal ){ if (vIntTotal > 1) if (vBooMsgSend){ llSay( 0, "Yay, Teamwork!" ); vBooMsgSend = FALSE; } } }
touch_end( integer vInt ){ vBooMsgSend = TRUE; } }
there a small chance of multiple triggering the message if more than than 2 people click and hold.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|