ll Functions
Compatibility, library llcompat
Some LL functions change they behaviour. These changes are explained in the next four sections.
We have the library llcompat with the LL functions unchanged. To use them as in LSL we need to add, at the start of the script:
ll = llcompat
Removed functions
These functions doesn’t exist in SLua:
| ll.SetTimerEvent |
| ll.ResetTime |
| ll.GetAndResetTime |
| ll.SetMemoryLimit |
We can still use them in the llcompat library, but the 3 time-related functions are not compatible with the LLTimers object. We can’t use the old timer functions and LLTimers together because LLTimers would fail.
The old timer event, to be used with llcompat.SetTimerEvent(), is:
-- using the old event timer
function LLEvents.timer()
-- do something
end
llcompat.SetTimerEvent(1)
1-based LL functions
The LL functions that have some kind of 0-based index are now 1-based.
- Negative indexes don’t change, the last element is still -1.
These are the functions and the parameters that change. The “*” added to the parameter name means that it can use negative values, we can’t just add 1 to rewrite our scripts if we are using negative values:
| ll.AdjustDamage(number, new_damage) | number |
| ll.DeleteSubList(src, start, end) | start*, end* |
| ll.DeleteSubString(src, start, end) | start*, end* |
| ll.DetectedDamage(number) | number |
| ll.DetectedGrab(number) | number |
| ll.DetectedGroup(number) | number |
| ll.DetectedKey(number) | number |
| ll.DetectedLinknumber(number) | number |
| ll.DetectedName(number) | number |
| ll.DetectedOwner(number) | number |
| ll.DetectedPos(number) | number |
| ll.DetectedRezzer(number) | number |
| ll.DetectedRot(number) | number |
| ll.DetectedTouchBinormal(index) | index |
| ll.DetectedTouchFace(index) | index |
| ll.DetectedTouchNormal(index) | index |
| ll.DetectedTouchPos(index) | index |
| ll.DetectedTouchST(index) | index |
| ll.DetectedTouchUV(index) | index |
| ll.DetectedType(number) | number |
| ll.DetectedVel(number) | number |
| ll.GetInventoryName(type, number) | number |
| ll.GetListEntryType(src, index) | index* |
| ll.GetNotecardLine(name, line) | line |
| ll.GetNotecardLineSync(name, line) | line |
| ll.GetSubString(src, start, end) | start*, end* |
| ll.InsertString(dst, pos, src) | pos |
| ll.KeysKeyValue(first, count) | first |
| ll.LinksetDataFindKeys(pattern, start, count) | start |
| ll.LinksetDataListKeys(start, count) | start |
| ll.List2Float(src, index) | index* |
| ll.List2Integer(src, index) | index* |
| ll.List2Key(src, index) | index* |
| ll.List2List(src, start, end) | start*, end* |
| ll.List2ListSlice(src, start, end, stride, slice_index) | start*, end*, slice_index* |
| ll.List2ListStrided(src, start, end, stride) | start*, end* |
| ll.List2Rot(src, index) | index* |
| ll.List2String(src, index) | index* |
| ll.List2Vector(src, index) | index* |
| ll.ListFindList(src, test) | <return> |
| ll.ListFindListNext(src, test, instance) | <return>, instance* |
| ll.ListFindStrided((src, test, start, end, stride) | <return>, start*, end* |
| ll.ListInsertList(dest, src, start) | start* |
| ll.ListReplaceList(dest, src, start, end) | start*, end* |
| ll.ListSortStrided(src, stride, stride_index, ascending) | stride_index* |
| ll.Ord(val, index) | index* |
| ll.SubStringIndex(source, pattern) | <return> |
LL functions return nil when not found
The LL functions that returned -1 meaning “not found” now return nil.
These are the functions that change:
| ll.ListFindList |
| ll.ListFindListNext |
| ll.ListFindStrided |
| ll.SubStringIndex |
Boolean LL functions
The LL functions that return a boolean value now return type boolean instead of type number.
Functions like ll.GetPrimitiveParams() and ll.GetObjectDetails() that return boolean values inside lists also return type boolean instead of type number.
LL functions with integer parameters that are a boolean value can receive boolean or number (this already worked in SLua Alpha).
These are the functions that change:
| ll.AgentInExperience |
| ll.DerezObject |
| ll.DetectedGroup |
| ll.EdgeOfWorld |
| ll.GetScriptState |
| ll.GetStatus |
| ll.IsFriend |
| ll.IsLinkGLTFMaterial |
| ll.ManageEstateAccess |
| ll.OverMyLand |
| ll.SameGroup |
| ll.ScaleByFactor |
| ll.ScriptDanger |
| ll.SetMemoryLimit |
| ll.SetRegionPos |
| ll.VerifyRSA |
Linked messages and uuid’s
In LSL, the parameter id can be used to pass any string. In SLua, uuid’s can’t store strings that are not in uuid format.
Linked messages have a string instead of an uuid in their fourth parameter.
- the function ll.MessageLinked( link, num, str, str2 )
- the event link_message( sender_num, num, str, str2 )
- linked messages with LSL scripts are internally typecasted.