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.