Very Important Script Information

At YrGrid, we strive to empower our creators not only to be able to design and create amazing products but to comfortably and enjoyable. This guide aims to inform and teach best practices for scripting in YrGrid.

There are varying differences between YrGrid's scripting engine and Second Life's, just as there are between Second LifeĀ® LSO and MONO. While some differences make scripts that run on other grids absolutely not compile in YrGrid, some differences cause undefined behavior and/or inefficiencies and problems which may impact the region. This section of the guide will help you be aware of the cavaets and help you write more compatible code.

Avoid llSleep()

If at all possible, avoid the use of llSleep() in your scripts. Use timers instead and refactor your code to be event driven where possible. Too many sleeps can cause tremendous lag and render a region unusuable.

Avoid llSetPos(pos) and llSetRot(rot)

It's much more efficient to use llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_POSITION,pos]) and llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_ROTAZTION,rot]) respectively.

For that matter, don't use llSetPrimitiveParams([]) or llSetLinkPrimitiveParams(link,[]) either

llSetLinkPrimitiveParamsFast(LINK_THIS,[]) and llSetLinkPrimitiveParamsFast(link,[]), again respectively, are recommended.