Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

multiple listens in one prim

tucor Capalini
Registered User
Join date: 18 Jun 2007
Posts: 44
02-24-2008 16:15
OK, this is really kicking me in the head.
Ill do some set up here....
Object 1 : A user touches this to do some stuff. It also gets their key.
Objects 2-6 : and object collides with these, after the user does some stuff.
Object 7 : Listens to object 1 to get the user key. it also needs to listen to objects 2-6 to know which object was colloded with.

Object 7 is unlinked. Objects 1-6 are linked (along with other objects)

Upon hearing which object it is collided with, it will give an paticular inventory item to the person (key) from Object 1.

here is the code for the listening/giving object (Object 7)
///////////////////////////////////////////////////////////////////////////////////////
string names;

default
{state_entry()
{llListen(-900,"","","";);
llListen(-9001,"","","";);
}

listen(integer channel, string name, key id, string mesb){
if(channel==-900) {names==mesb;
llSay(0,mesb);}
if(name=="3 Det";){llGiveInventory((key)names,"tucman";);
llSay(0,names);}
}
}
////////////////////////////////////////////////////////////////////////////
"3 Det" is one of the collision detectors. (objects 2-6)
channel -900 is the channel that Object 1 says the key
channel -9001 is what "3 Det" talks on.
the llSay(0,"";) is just for my debuging.

what is happeing is well...nothing.
No inventory item is given, and when it gets done, the string names = nothing
Ive tried about every permeutation I can come up with, but alass, I got notin'


I even tried sending the key to a listen in the dectors, so that they could say the key and their own name to the listener/giver. But that interfered with the collision_start().

Thank you very much in adavnace!
Tuc!
Daten Thielt
Registered User
Join date: 1 Dec 2006
Posts: 104
02-24-2008 19:34
if(channel==-900)
{
names==mesb;
}

your asking it is names mesb not asigning it. do 1 = not 2 plus your asking it to listen for anything on the channel not a spasific thing that could be why as well
tucor Capalini
Registered User
Join date: 18 Jun 2007
Posts: 44
02-24-2008 19:50
Grazie Molto!!! that did it!
and thank you for the explination as to why!