Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

simulate touching event

Dominique Laville
Registered User
Join date: 24 Apr 2008
Posts: 84
07-26-2009 05:13
hi,

is possible to simulate the "touch event" from another object ?

I have a sphere and a blackboard. I wouldl iike the sphere to simulate the touching event on the blackboard (or to call a function inside a script of the blackboard).

thanks
Rygel Ryba
Registered User
Join date: 12 Feb 2008
Posts: 254
07-26-2009 05:32
Definitely not enough info here... is that sphere an attachment? Is it just loose in the world? Does it move? What event happens to the sphere that is supposed to actually simulate the touch event... I don't understand and I don't think anyone else will unless you are more specific and clear either.
Dominique Laville
Registered User
Join date: 24 Apr 2008
Posts: 84
07-26-2009 05:37
The sphere and the blackboard are 2 different objects in the world. They don't move.

The sphere is touched for the first time and then it should have a timer to send messages to the blackboard every 20 seconds.

I would like to simulate every 20 seconds what usually happen when I touch the blackboard.

I probably have to send a message and call the function inside the blackboard script which is usually called then I touch the blackboard.. this is the easier way to do it.

thanks
Rygel Ryba
Registered User
Join date: 12 Feb 2008
Posts: 254
07-26-2009 05:39
Touch the sphere - it talks. The blackboard listens.

Take a look in the wiki at 'llListen'
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
07-26-2009 05:59
this is where user functions come in handy.... your blackboard will have one that is triggered from both the touch and the listen event, so that it does the exact same action regardless of which input method is used... eg

CODE
//-- blackboard
userFunction( key vKeyAv ){
llSay( 0, llKey2Name( vKeyAv ) + " touched me" );
return;
}

default{
state_entry(){
llListen( -42, "Ball", "", "" );
}

listen( integer vInt, string vStr, key vKey, string vStrMsg ){
userFunction( (key)vStrMsg );
}

touch_end( integer vInt ){
userFunction( llDetectedKey( 0 ) );
}
}


and

CODE
//-- Ball
default{
touch_end( integer vInt ){
llSay( -42, (string)llDetectedKey( 0 ) );
}
}
_____________________
|
| . "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...
| -
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
07-26-2009 15:31
or why not llDetectedName?
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
07-26-2009 17:54
From: Ruthven Willenov
or why not llDetectedName?

because i'm too lazy to rewrite it and I figured that a key would be more likely for other uses (not that there needs to be an variable)
_____________________
|
| . "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...
| -