|
Cypher Ragu
[Mad Scientist]
Join date: 6 Jul 2008
Posts: 174
|
11-01-2008 21:00
Hello everyone, I have a few projects going on now and I'm beginning to get worried about how much lag they may cause on the sim. First off, which would be less laggy: 1) Several integers used to store the status of the script (for example, an integer for "listening", another for "moving", etc)... OR 2) A single string used for the same purposes as the first option I read somewhere that setting an integer is less laggy than setting a string, but I just wanted some more confirmation... Also, would it be better to use llListenControl or llListenRemove? (Note that different listens will need to be toggled on/off multiple times) Thanks for your help 
_____________________
Life is a highway... And I just missed my exit.
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
11-02-2008 01:05
your best usage would be a bitmask, which will allow several (32) on/off choices in a single integer. less memory, faster comparisons. and probably where you heard that part about setting one vs the other. you can do the same trick with strings, but don't because it will be very messy in SL (and more code).
depending on the channels used for your listens and how much use they get, it's nicer to turn them off if possible. especially true of public and low channels and it doesn't hurt if they are infrequently used (heavy/frequent/simultaneous usage you probably want to keep active so you aren't constant switching them off and on). also filter them as much as possible.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Monica Balut
Beam-Me
Join date: 18 Feb 2007
Posts: 311
|
11-02-2008 05:43
Void is perfectly correct (as usual) about using a bit mask. If you are uncomfortable with that, using integers is far better than using strings.
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
11-03-2008 06:13
me make mistakes? NEVER... well ok, maybe today would be a bad time to say that, as I managed to create a sim killer in two lines of code because I accidently put something where it never belonged, and had no need or use to be =X
/me makes lots of mistakes, just look at a few of my script samples I post here, and all the corrections that come after lol
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|