Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

communications between objects - Shout/Listen

Xiaonan Aeon
Registered User
Join date: 10 Apr 2008
Posts: 10
05-12-2008 01:39
Hi

Could someone help please? I am trying to use shout/listen function to make two objects communicate with each other, but the receiver seems not pick up the message and does nothing.

Caller object:

touch_start(integer total_number)
{
//get object attributes first
string desc = (string) llGetObjectDetails(llGetKey(),[OBJECT_DESC]);
string OType = llGetSubString(desc, 0, 1); //ge the first two letters as the type id
llShout(401, "callDatabase" +OType);
}


Receiver object:

integer lchannel = 401;

default
{
state_entry()
{
//listen_handle=llListen(lchannel, "", NULL_KEY, "";);
llListen(lchannel, "", "", "";);
}


listen( integer channel, string name, key id, string message )
{
llSay( 0, message );
string command = llGetSubString(message, 0, 11);

llSay( 0, message );

if( command== "callDatabase" )
{

llSay( 0, "A call is received " );
}


}
}
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
05-12-2008 01:48
Yes, what happens? what do you see? what is the problem? Do you want someone to read, edit and test your script for you?
_____________________
From Studio Dora
Ron Khondji
Entirely unlike.
Join date: 6 Jan 2007
Posts: 224
05-12-2008 01:55
You seem to have forgotten the closing bracket in the llShout.
Also if the distance between the objects is more then 100 m you'ld better use llRegionSay.
Django Yifu
Beat Island Gaffer
Join date: 7 May 2007
Posts: 189
05-12-2008 03:00
From: Xiaonan Aeon



llShout(401, "callDatabase" +OType;


Needs a closing bracket

In all honesty I am having trouble deciphering your code without some more information and knowing what this script is communicating with and what the outcomes are supposed to be.
_____________________
Tread softly upon the Earth for you walk on my face.
Ollj Oh
Registered User
Join date: 28 Aug 2007
Posts: 522
05-12-2008 03:26
http://wiki.secondlife.com/wiki/LlShout
A prim can not hear itself with llShout, say, whisper, regionsay, to prevent problems with recursion.

make sure both scripts are running, by making them llOwnerSay("idostuff";); when they do something. They can stop running on some errors.

use negative channels, they have the advantage that agents can not chat on negative channels.
Xiaonan Aeon
Registered User
Join date: 10 Apr 2008
Posts: 10
05-12-2008 04:14
thank Ollj Oh

Just found that the receiver's script was not runing.