Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Dropped Chat Messages?

Luciftias Neurocam
Ecosystem Design
Join date: 13 Oct 2005
Posts: 742
04-18-2007 08:12
I have a problem that I haven't seen before, and maybe someone who has seen it before can enlighten me as to the cause.

I have a script I use for communication between potential predators and prey in one of my ecosystems. I use a somewhat complicated protocol that involves each animal listening
on a unique channel (defined by that animals key) for food request messages or confirmation of receipt messages from animals interacting with them.

so in my script I'll somewhere have some code that looks like this:
CODE
state Eaten
{
state_entry()
{
OpenListen(); //defines channel to listen on.
EATMECOUNT=0;
llSetTimerEvent(5);
}

timer()
{
EATMECOUNT++;
//llOwnerSay((string) chan);
llSetObjectDesc((string) EATMECOUNT);
llSay(0,"Someone is attacking me.");
llSay(PREDCHAN ,(string) msgEatMeatConfirm + "|" + (string) FOODROOTVALUE);
if(EATMECOUNT==15)
state default;

}

listen(integer channel,string name, key id, string message)
{
if(message=="CONFIRMRECEIPT")
{
ModifyENERGY(-0.99*ENERGY);
llSay(0,"Oh no, I'm being eaten");
Die();
}
}
}


thing is, the animal will always receive the initial message (to which it responds with llSay(0,"Someone is attacking me.";); ). However, it doesn't seem to actually respond on the PREDCHAN channel as it should. I've got listeners listening on that channel and I get nothing.

Do chat channels other than 0 have much lower priority than channel 0 itself? So that they are the first dropped in a busy sim?

What's odd is that I use the same code in my herbivores for interacting with their plant food. and there is no problem there. It's only in animal on animal interactions I see this problem. The only difference is that the animals have more scripting overhead (sensor scans, targetting loops, etc) than do the plants.
_____________________
wa
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
04-18-2007 10:04
You shouldn't be having any problem. I would imagine there is something in your code that you're accidentally overlooking that makes the return-message either a)not fire or b)return in an unexpected manner.

I would place a few llSay() lines in your script around lines of your problem code...find out EXACTLY where--between the two scripts--the script fails...and find out exactly what the script is saying before it fails. Usually, that will end up giving you just the hint you need to break through the difficulty.
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.