[Opensim-users] Creating objects in a region module

Justin Clark-Casey jjustincc at googlemail.com
Tue Jun 14 00:22:36 UTC 2011


Unfortunately, I don't know of any good example code for this.

In principle, it could be done by first converting the LSL into an asset, storing that asset and then creating the 
relevant item.

OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.AddNotecard() provides a good template here.  You might be able to 
replace the AssetNotecard with AssetScriptText instead.

If you don't need to generate them dynamically, then you might want to consider storing scripts directly in the region 
and copying them or rezzing the containing items as appropriate.  Then you can save and load the required OAR along with 
your region module code.

This is messy but can be easier in some situations.

On 12/06/11 05:12, Karl Haas wrote:
> Hi Justin,
>
> thanks for your help!
>
> What's the best way to assign scripts to a prim that i create in the region module?
> Are there any examples for the different script types (LSL, OSSL) available?
>
> Best regards,
> karl
>
>
> On 06/09/2011 09:04 AM, Justin Clark-Casey wrote:
>> Hi Karl. There isn't a good region module example code for this yet, to my knowledge.
>>
>> However, you may want to look at OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs which contains all
>> the LSL script method implementations.
>>
>> You may also want to look at test code such as the package OpenSim.Region.CoreModules.Tests since these often contain
>> code for setting up various OpenSim structures.
>>
>> As a general point, please be aware that the OpenSim internal 'API' is very inconsistent since it has grown up
>> organically. For instance, some scene methods schedule their own updates to viewers (e.g.
>> SceneObjectPart.UpdateRotation()) whilst others leave this up to the caller. Ultimately, I believe these show all be
>> left to the caller so that callers can group update batches.
>>
>> On 08/06/11 02:28, Karl Haas wrote:
>>> Hi,
>>>
>>> I'm trying to create SceneObjectGroups in an OpenSim region module and I have some problems using the Framework.
>>> Does anyone know if there is a useful documentation or some example code available?
>>>
>>> Some questions that I have by now:
>>>
>>> - How can I rotate SOGs - how is Quaternion used correctly?
>>> - How can I set the texture of a SOG or a SceneObjectPart object?
>>> - How can I create the prims that the clients offer to create - PrimitiveBaseShape offers just a box, cylinder and a
>>> sphere?
>>> - How can I add a script to the object in order to track the position of the object?
>>>
>>> Thanks for any help in advance!!
>>>
>>> Best regards,
>>> karl
>>> _______________________________________________
>>> Opensim-users mailing list
>>> Opensim-users at lists.berlios.de
>>> https://lists.berlios.de/mailman/listinfo/opensim-users
>>>
>>
>>
>
> _______________________________________________
> Opensim-users mailing list
> Opensim-users at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-users
>


-- 
Justin Clark-Casey (justincc)
http://justincc.org/blog
http://twitter.com/justincc



More information about the Opensim-users mailing list