Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
|
08-23-2005 08:04
Hello there, I want an object to count numbers by using control. integer n;
default { state_entry() { llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS); n = 0; } run_time_permissions(integer perm) { if (perm & PERMISSION_TAKE_CONTROLS) { llTakeControls(CONTROL_FWD TRUE, FALSE); } } control(key id, integer level, integer edge) { if(level & CONTROL_FWD) { n = n + 1; llMessageLinked(LINK_SET, n, "", ""); if(n > 3) n = 0; } } } I want this to stop counting just when I release the FWD key. But it didn't stop dead. Counting message left a bit and was executed. How can I let it come to a complete stop? Thank you.
_____________________
 Seagel Neville 
|
Upshaw Underhill
Techno-Hobbit
Join date: 13 Mar 2003
Posts: 293
|
08-23-2005 08:11
I'd bet your linkmessages queued a bit. Yes, LSL can occasionally be to fast (hard to believe I know.)  Put a bit of an llSleep or if you want to get fancy, a check since last message sent time. L8r, UU
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
08-23-2005 13:17
Control events happen at twice the rate of the llMinEventDelayI have a prototype vehical i'm constructing that uses duel control by passing the messages over linked messages. In the secondary script i've increased the event delay as to reduce the chances of link message buildup.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
|
08-23-2005 15:34
Thank you, guys. I tried to replace llMessageLink by llOwnerSay and see. It looked good. So this is the problem that messages are queued a bit as Upshaw said. It was, however, little difference if I put llSleep(1) after llMessageLinked. Or should I have put down it in the receiver script? Strife, I've not tried llMinEventDelay you said yet, but should I use it like llSleep? I guess what I want to do is to kill a couple of last messages queued at the receiver script, isn't it? EDITSorry, I was wrong! Hey Upshaw, I made a mistake where I should put llSleep. It worked fine. Thank you very much. And Stiife, llMinEventDelay was also worked. hmm... just a bit odd though. I didn't think I put it proper place. ok, I'll try to teak. Anyway, I learnd. 
_____________________
 Seagel Neville 
|