[Opensim-users] Adding Scripts to Objects on Rez in 7.1
Justin Clark-Casey
jjustincc at googlemail.com
Tue Aug 2 00:44:01 UTC 2011
On 01/08/11 17:56, Chris Stevens wrote:
> Query on adding scripts to prims on rez: I've managed to create a prim which contains an inventory item by using the
> most up to date versions of this:
>
> http://forge.opensimulator.org/gf/project/extsim/scmsvn/?action=browse&path=%2Ftrunk%2FExtSimPlugin%2FModules%2FExtSim.cs&view=markup
> <http://forge.opensimulator.org/gf/project/extsim/scmsvn/?action=browse&path=%2Ftrunk%2FExtSimPlugin%2FModules%2FExtSim.cs&view=markup>
>
> (Had to redefine a few methods that were incorrect), but i'm stuck at trying to find the definitions for
> InventoryItemBase.InvType
>
> Apparently TaskInventoryItem.InvType = 10; was scripts... but for InventoryBaseItem.InvType it's a texture, and I can't
> find anywhere in the opensim docs the value list for InventoryItemBase.InvType or any Enum for it.
>
> Anyone know the integer keys for this parameter? Or have an up-to-date method for adding Scripts to newly rezzed Prims?
Are you setting both inventory and asset types? It's 10 for both in scripts. It's 0 for textures in both, which is why
I'm thinking this.
You can find this in the libopenmetaverse code (http://lib.openmetaverse.org). It's in OpenMetaverseTypes/Enums.cs.
As you've found out, the Extsim code is old and unmaintained - and tbh I've never looked at it much. There's code which
I'm hoping to see released soon-ish that demonstrates doing a lot of things from within region modules. Unfortunately,
adding scripts isn't one of them.
And there's no regression test code that does this yet either.
Your best bet might be to look at methods such as RezScript() in Scene.Inventory.cs. A lot of these methods requires a
client object since they were written originally to serve that purpose. At some point the 'API' needs to be improved so
that region modules can do these operations. However, with some hacking and code copying you should be able to get it
to work as is (of course, patches welcome!).
>
> Regards,
> Chris.
>
> --
> Chris Stevens
> Lead Programmer
> Daden Limited
>
> t: +44 (0)121 250 5678
> e: chris.stevens at daden.co.uk <mailto:chris.stevens at daden.co.uk>
> w: www.daden.co.uk <http://www.daden.co.uk>
> skype: christopher.michael.stevens
> sl: http://www.slurl.com/secondlife/daden%20prime/160/184/26
> sl IM: Chris Taselian
>
> Daden specialise in immersive learning & training systems, built environment visualisations, and creating interactive
> virtual personalities (chatbots).
>
> Daden are a Linden Lab Gold Solution Provider for Second Life.
>
>
>
> _______________________________________________
> 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