Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llSetMessageQueueLength( iMessageType, iQueueLength);

Azelda Garcia
Azelda Garcia
Join date: 3 Nov 2003
Posts: 819
05-16-2004 01:45
CODE

llSetMessageQueueLength( iMessageType, iQueueLength);


You'd use this to remove message queuing for a particular message type so that you only process messages as they arrive, in real-time.

Message-type is MESSAGETYPE_LISTEN, MESSAGETYPE_LINKMESSAGE, MESSAGETYPE_CONTROL, MESSAGETYPE_SENSOR and MESSAGETYPE_TOUCH.

Examples of where you'd use this:

You have a FireControl script in a primary prim, that sends linkmessages such as "FIRE" to linked gun prims.

If you try this in practice right now, if you send the FIRE messages fast enough, they get queued up by the guns - which cant process them fast enough - and the gun continues to fire for many seconds after you release the trigger.

By setting llSetMessageQueueLength( MESSAGETYPE_LINKMESSAGE, 1 ); within the gun prim script, it'd just dump new linkmessages if they arrive while it's processing an earlier one.

Similarly, if you have a vehicle with wheels, you're probably sending "SETROT" linkmessages to the wheels. SetRot in a subprim takes a certain amount of time, so you can see the vehicles continuing to move around pseudo-randomly for many seconds after you stopped steering.

Same solution: put a llSetMessageQueueLength( MESSAGETYPE_LINKMESSAGE, 1 ); in the wheel script.

Last example: a lift which receives touch_start events. You dont want them queued, so you set llSetMessageQueueLength( MESSAGETYPE_TOUCH, 1 );

Azelda
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
05-16-2004 08:40
Seems like Julian did some testing that might indicate the function llMinEventDelay may do what you need? If your testing shows otherwise, please update Wiki.
_____________________
--
010000010110110101100001001000000100111101101101011001010110011101100001
--
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
05-16-2004 15:41
I would like to suggest a new LSL command, llMakeAllScriptingCommandsLessVerbose()