Jump to content

llListen


mansoor50
 Share

You are about to reply to a thread that has been inactive for 2361 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Good Morning

so, i have become comfortable with KFM.

my next step is to make one prim chase another. i had planned on having one root and 2 child prims...and was hoping that the root will be able to control the chase. so i used Messagelinked and put the KFM in the linkmessage event in the child.

this did not work since the KFM gets applied to the whole object, rather than just the child.

then i read about llListen and it may be a better solution, in that i dont even need linking.

before i use it i have a question:

do we need any input from the local chat to trigger the listen event? 

Basically, i dont want any user input and in that respect, Messagelinked worked well since i cd put conditions within the parameters.

Thank u and regards

Link to comment
Share on other sites

Yes. Listen() event responds to local chat. Objects can "chat" to each other. Others will advise you to pick a random channel. Of course, you can test and debug on channel 0 (public) but it will annoy anyone in your area so do it in a region where you are alone.  Or, just add "llOwnerSay()" messages echoing the messages sent and received so nobody else sees them.

Link_Message() event responds to linked messages.

 

Link to comment
Share on other sites

Here's a very simple pair of scripts that will have two objects chase each other randomly.  You can try making a KFM version.  :)

Here's the leader ...

vector  Home;

default
{
    state_entry()
    {
        Home = llGetPos();
        llSetTimerEvent(10.0);
    }
    
    timer()
    {
        llSetRegionPos(Home + <3.0 - llFrand(6.0), 3.0 - llFrand(6.0), 0.0>);
        llSetRot(llEuler2Rot(<0.0,0.0,llFrand(TWO_PI)>));
    }
}

And here's the follower ...

default
{
    state_entry()
    {
        llSensorRepeat("Thing 1","",ACTIVE|PASSIVE,10.0,PI,2.0);
    }
    
    sensor(integer num)
    {
        llSetRegionPos(llDetectedPos(0) + <-0.7,0.0,0.0>*llDetectedRot(0));
        llSetRot(llDetectedRot(0));
    }
}

No "speaking" or "listening" involved.  Just remember to name your objects Thing 1 and Thing 2.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2361 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...