Skip to content

LSLCompatibility

lickx edited this page Sep 16, 2018 · 15 revisions

Vector not <0,0,0>

SecondLife: if (vMyVector)
OpenSim: if (vMyVector != ZERO_VECTOR)

Is a key:

SecondLife: if ((key)sMyString)
OpenSim: if (osIsUUID(sMyString))

Key not 00000000-0000-0000-0000-000000000000:

SecondLife: if (kMyKey)
OpenSim: if (kMyKey != NULL_KEY)

More than one negate expression:

SecondLife: if (~Expr1 && ~Expr2)
OpenSim: if ((~Expr1) && (~Expr2))

OSSL replacement for custom StrReplace function:

SecondLife: llDumpList2String(llParseStringKeepNulls((sSource = "") + sSource, [sSearch], []), sReplace);
OpenSim: osReplaceString(sSource, sSearch, sReplace, -1, 0);

If list has elements:

SecondLife: if (lMyList) or if (lMyList!=[])
OpenSim: if (llGetListLength(lMyList) > 0)

If list is empty:

SecondLife: if (lMyList==[])
OpenSim: if (llGetListLength(lMyList) == 0)

Redeclaration of variables within function scope:

integer i = 3;
for ( ; ; ) {
integer i = 4; // throws error in OpenSim
}

No cleanup of removed handles:

llTargetRemove(iMyHandle);
In OpenSim doesn't set iMyHandle to 0

llMoveToTarget is handled buggy in OpenSim

When llMoveToTarget() used in more than one script in the same object, triggers at_target and not_at_target in all scripts that have such events. LSL wiki states this should be limited to the script where the llMoveToTarget is used in. We work around this by explicitly checking for the handle and setting it to 0 when unused. For example oc_leash and oc_couple caused conflicts when using the original code.

OSSL functions

There are some interesting ossl functions but most can't be used on an unmodified opensim (apart from region owners/managers) and because we strive for maximum compatibility we keep usage of them limited. Not being able to use these functions in common scenarios begs the question why these ossl functions where invented for OpenSim at all.

llMinEventDelay(float delay)

Either works somewhat at times > 0.5 or doesn't work reliably at all. Best to comment out this function.

llSleep(float delay)

On XEngine will cause threads to lock on the simulator causing lag. Avoid this as much as possible by using the timer instead. The forthcoming YEngine script engine replacement for XEngine will solve this.

Delays

Generally delays < 0.5 such as used by llSetTimerEvent() are not reliable. Will be improved once YEngine replaces XEngine in OpenSim.

More to be added..

Clone this wiki locally