Adam Frisby

MRM: The API, Continued.

with 7 comments

MRM is now functional to the point where you can begin to implement simple scripts in it (r9060), the following is the ‘default LSL script’ written as a MRM:

The API is slowly being documented too – it is being documented with .NET XMLDOC comments, so that our docs project site will also provide up to date information on how to write MRM scripts. For example, take a look at the documentation for IObject or IHeightmap.

As you can see, it is slowly taking shape – the areas in most need of attention are Avatar properties, defining “social entities” (eg Users, Groups, with a common interface to both for common properties) and also adding event handlers for the multitude of events we are capable of supporting. (In theory we could support the much wider array of Scene.EventManager than just what LSL exposes to you.)

The following table is my ‘in progress’ list of what will be replacing what in LSL nomenclature – functions which have no corresponding MRM properties are not listed here yet.

Appendix i. Compatibility table (as of r9060)

As you can see in the codebase, some of these functions below do not have full implementations yet (eg llSensor is only partially matched up – it would be fully matched up when we have a function to allow you to determine if something falls within a cone or sphere, and request only those from Scene).

This will be corrected over time – as will the functionality differences. An ultimate goal with MRM will be to have a feature set which overlaps completely enough that it would be possible to write an LSL to MRM translator with reasonable accuracy. It should also be possible to write an interface or translation layer which provides LSL structures similar to our LSLBase structure – but that maps underneath over to an IObject/MRM API.

Function MRM Equivilent
llGetDate DateTime.Now.*
llGetTime DateTime.Now.*
llGetTimeOfDay DateTime.Now.*
llGetTimestamp DateTime.Now.*
llGetAndResetTime Debug.Stopwatch
llGetAgentInfo IAvatar.*
llGetAgentSize IAvatar.*
llGetListEntryType ICollection
llGetListLength ICollection
llList2CSV ICollection
llList2Float ICollection
llList2Integer ICollection
llList2Key ICollection
llList2List ICollection
llList2ListStrided ICollection
llList2Rot ICollection
llList2String ICollection
llList2Vector ICollection
llListen ICollection
llListenControl ICollection
llListenRemove ICollection
llListFindList ICollection
llListInsertList ICollection
llListRandomize ICollection
llListReplaceList ICollection
llListSort ICollection
llListStatistics ICollection
llDetectedGrab IObject.* / On*Args
llDetectedGroup IObject.*
llDetectedKey IObject.*
llDetectedLinkNumber IObject.*
llDetectedName IObject.* / On*Args
llDetectedOwner IObject.* / On*Args
llDetectedPos IObject.* / On*Args
llDetectedRot IObject.* / On*Args
llDetectedTouchBinormal OnTouchArgs
llDetectedTouchFace OnTouchArgs
llDetectedTouchNormal OnTouchArgs
llDetectedTouchPos OnTouchArgs
llDetectedTouchST OnTouchArgs
llDetectedTouchUV OnTouchArgs
llDetectedType On*Args
llDetectedVel IObject.*
llGetAccel IObject.*
llGetCreator IObject.*
llGetKey IObject.*
llGetLocalPos IObject.*
llGetLocalRot IObject.*
llGetObjectDetails IObject.*
llGetObjectName IObject.*
llGetOwner IObject.*
llGetOwnerKey IObject.*
llGetPos IObject.*
llGetPrimitiveParams IObject.*
llGetRot IObject.*
llGetScale IObject.*
llSetPos IObject.*
llSetPrimitiveParams IObject.*
llSetRot IObject.*
llSetScale IObject.*
llSetTouchText IObject.*
llSitTarget IObject.*
llGetLinkKey IObject.Children.*
llGetLinkName IObject.Children.*
llGetLinkNumber IObject.Children.*
llGetObjectDesc IObject.Description
llGetStatus IObject.Is*
llSetAlpha IObject.Is*
llSetColor IObject.Materials.*
llSetLinkAlpha IObject.Materials.*
llSetLinkColor IObject.Materials.*
llSetLinkPrimitiveParams IObject.Materials.*
llSetLinkTexture IObject.Materials.*
llGetAlpha IObject.Materials.*
llGetColor IObject.Materials.*
llSetTexture IObject.Materials.*
llSetTextureAnim IObject.Materials.*
llGetNumberOfSides IObject.Materials.Count
llGetRootPosition IObject.Parent.*
llGetRootRotation IObject.Parent.*
llGetNumberOfPrims IObject.Parent.children.count + 1
llGetObjectPrimCount IObject.Parent.children.count + 1
llSetLocalRot IObject.Rotation
llSay IObject.Say
llSetText IObject.Text
llAbs Math.Abs
llFabs Math.Abs
llAcos Math.Acos
llAsin Math.Asin
llAtan2 Math.Atan2
llCeil Math.Ceil
llCos Math.Cos
llFloor Math.Floor
llLog Math.Log
llLog10 Math.Log10
llPow Math.Pow
llModPow Math.Pow + %
llSin Math.Sin
llSqrt Math.Sqrt
llTan Math.Tan
llEmail Net.MailMessage
llEscapeURL Net.URI.*
llEuler2Rot new Quaternion(Vector3)
llDumpList2String String.Concat
llToLower String.ToLower
llToUpper String.ToUpper
llSensorRepeat Timer + World.Objects
llGetUnixTime Util.*
llFrand Util.Random
llSHA1String Util.SHA1Hash
llVecDist Vector3.*
llVecMag Vector3.*
llVecNorm Vector3.*
llGround World.Heightmap[x,y]
llModifyLand World.Heightmap[x,y]
llSensor World.Objects
llSensorRemove World.Objects
llDie World.Objects.Remove(…)
11 Vote

Feedback

If you found this post useful and want me to write more on this topic, please use the vote button to the left or leave me a comment below.

Written by Adam Frisby

April 9th, 2009 at 8:05 am

Posted in OpenSim

Tagged with , ,

7 Responses to 'MRM: The API, Continued.'

Subscribe to comments with RSS or TrackBack to 'MRM: The API, Continued.'.

  1. Wanted to vote this up, but the “Vote” link leads to a directory listing.

    I tried the example script under r9068, and while Start() works (the object says “Hello, Avatar!”), it doesn’t seem to make the object touchable (the mouse pointer doesn’t change when you move it over the prim containing the script, and clicking the prim produces no visible results).

    Warin Cascabel

    9 Apr 09 at 3:18 pm

  2. Hi Adam,
    Is this functional in either 0.6.3 or 0.6.4 ?

    I don’t see an ‘MRM’ section in the opensim.ini file.

    Mike

    Mike Stramba

    9 Apr 09 at 8:48 pm

  3. Warin: Yes sorry about that – one of those things corrected locally but not in SVN. If you wanted the touch to ‘route’ correctly, you would need a LSL script in there too so it knows to make the object touchable. I will commit that momentarily. (Re: the button, it does need javascript, do you have it off?)

    Mike: It might have snuck into 0.6.4, but it would have been fairly nonfunctional as most of the major work has been in the last few days. For this you need to go to trunk, so I wouldnt recommend testing this on any production system.

    Adam Frisby

    10 Apr 09 at 5:04 am

  4. Updated in r9087

    Adam Frisby

    10 Apr 09 at 5:13 am

  5. Adam: Yes, NoScript was blocking the javascript from working.

    The script now works like a charm (as long as I add a //MRM:C# line at the top).

    However, if I recompile the MRM from the prim, it responds to touch events once for each previous version of the MRM (I can change the Host.Object.Say() text, and see each of the versions spoken whenever I touch it). Deleting the script out of the prim’s inventory does not stop the MRM from responding to touch, either.

    Warin Cascabel

    10 Apr 09 at 11:45 pm

  6. Yeah, the recompile / still-have-old-script-running bug is a known issue. It’s basically caused by the fact there’s no methods yet to unload the assembly for the old script.

    Fixing it is a little more painful since it requires deregistering events in the proxy wrappers (SOPObject, World, SPAvatar, etc), then making sure the garbage collector takes it out wholesale. But it’s on the TODO.

    Adam Frisby

    11 Apr 09 at 7:02 am

  7. Hi Adam,
    I found MRM scripting very useful in the context I am working. I am currently in the process of porting my LSL code to MRM.
    I would like to know whether functions have been implemented for tasks such as
    1. Inventory/Notecard reading
    2. Send Http requests and get back responses

    Also it would be really great if you could publish an MRM API documentation (eventhough it is not yest complete). It would help us to get an understanding of what information can be extracted out and how.

    In particular, I am interested in finding out what information of avatars that we can take out.
    At the moment I only know how to get the Avatar name using IAvatar.Name.
    What other Avatar information that we can take out?
    Can we identify their gestures and animations, and if so, what are the corresponding Iavatar properties?

    Also, I would like to know whether you are going to make it possible for MRM scripts to modify Notecards at runtime. currently we cannot do this in LSL and I think it is a major limitation.

    surangika

    15 Sep 09 at 2:21 am

Leave a Reply

 

You need to log in to vote

The blog owner requires users to be logged in to be able to vote for this post.

Alternatively, if you do not have an account yet you can create one here.

Powered by Vote It Up