[Opensim-users] NPC module?

bodzette Coignet bodzettecoignet at gmail.com
Fri Sep 17 19:14:20 UTC 2010


OK sounds reasonable as a place to start fixing.

Just one question:

Could you point me to where in the code I should go first to see how other
modules are loaded correctly?
Bearing in mind that though I know .net programming I'm not really familiar
with the structure of the opensim framework.

For example: after I got it compiled and running last night I tried hacking
it to try to instantiate an NPC to see what would happen. I didn't know
where to put the code to instantiate so... My ugly hack attempt so far only
at OpenSim.OpenSim.RunCommand.

Of course it doesn't work because it's an ugly hack but it compiles and the
parameters should be right.  If I know where in the code needs changed I'm
fairly sure I can keep hacking away at it till I can get an NPC to appear
and from there should be able  to code up something that automatically loads
some NPCs in a region based on some settings in the .ini file, perhaps
reading from an XML file to state the parameters of the NPCS such as what
avatar UUID to use, the number of NPCs to instantiate and some sequence of
instructions describing the actions the NPC should take, read from an ini or
xml file.

Right now the first thing on my agenda is to actually get an NPC to rezz so
I hacked the following into OpenSim.OpenSim.RunCommand:
(Obviously there will be a better place to put this and those who have a
better idea of the structure of the code will hopefully be able to point me
in the right direction)....

swtich (command)
{
    //ugly hack here
    case "startNPCs":
    Region.OptionalModules.World.NPC.NPCModule zombie1 = new
Region.OptionalModules.World.NPCModule();
    Vector3 zombie1_Vector3 = new Vector3(0);
    Scene zombie1_Scene = m_sceneManager.CurrentScene;
    UUID zombie1_UUID = new UUID("a0638711-3350-4b2a-aeda-c233021f2eac");
    zombie1.CreateNPC("rob","zombie", zombie1_Vector3, zombie1_Scene,
zombie1_UUID);
    break;

   case "command-script"




On Fri, Sep 17, 2010 at 12:49 PM, <diva at metaverseink.com> wrote:

> It seems to me that the way that this particular module sets itself up is a
> bit unorthodox. Most modules in OpenSim check a config flag under the
> [Modules] section to see if they are supposed to be enabled or not, and
> then, if they need specific additional configuration, they should have their
> own [MyName] section in the config file.
>
> I have no idea why on earth the NPC module is hooking up to XEngine --
> that's just... wrong. Especially now that we have a general-purpose
> mechanism to connect scripts to modules.
>
> So start by fixing that! :-)
>
> Juliana Dutra wrote:
>
>> On Opensim.ini add to xengine section
>>
>> [XEngine]
>> AllowOSFunctions = true
>> Allow_osNpcCreate = UUID (your uuid)
>>
>>
>> ------------------------------------------------------------------------
>> *From:* Justin Clark-Casey <jjustincc at googlemail.com>
>> *To:* opensim-users at lists.berlios.de
>> *Sent:* Thu, September 16, 2010 5:47:57 PM
>> *Subject:* Re: [Opensim-users] NPC module?
>>
>> On 16/09/10 23:23, bodzette Coignet wrote:
>>  > Hi Justin:
>>  > On your blog you have a post "passing data between a script and a
>> region
>>  > module with modSendCommand()"
>>  >
>>  > Is that more or less how I would go about testing whether I can invoke
>>  > this code?
>>
>> No, you would invoke the npc via normal script commands with an os prefix,
>> e.g.
>>
>> default
>> {
>>    touch_start(integer total_number)
>>    {
>>        key cloneKey = osNpcCreate("Scary", "Clone", <134, 194, 43>,
>> llDetectedKey(0));
>>    }
>> }
>>
>> There's no real documentation of these apart from the code (in OSSL_Api.cs
>> <http://OSSL_Api.cs>).  However, they are the last four in the list at
>>
>>
>> http://www.scengine.org/index.php?option=com_content&view=article&id=10:opensim-api-functions&catid=6:os-api-functions&Itemid=14<
>> http://www.scengine.org/index.php?option=com_content&view=article&id=10:opensim-api-functions&catid=6:os-api-functions&Itemid=14
>> >
>>
>>
>> It also looks like someone else already tried them without success.  Which
>> leads me to suspect that they no longer work.
>>
>> http://www.osgrid.org/forums/viewtopic.php?f=5&t=2699 <
>> http://www.osgrid.org/forums/viewtopic.php?f=5&t=2699>
>>
>>
>> Remember, you will need to enable OSSL functions at a High threat level.
>>  Information on how to do this should be
>> available via Google.
>>
>>  >
>>  > On Thu, Sep 16, 2010 at 3:36 PM, Justin Clark-Casey
>>  > <jjustincc at googlemail.com <mailto:jjustincc at googlemail.com> <mailto:
>> jjustincc at googlemail.com <mailto:jjustincc at googlemail.com>>> wrote:
>>  >
>>  >    On 16/09/10 22:27, bodzette Coignet wrote:
>>  >
>>  >        No, I'm talking about the NPC module that's in the opensim
>>  >        source code
>>  >        found at the following location in the source tree:
>>  >
>>  >        OpenSim\Region\OptionalModules\World\NPC
>>  >
>>  >        Does *nobody* know who the original dev is that did this work?
>>  >
>>  >
>>  >    That module has been there for ages.  You should be able to find out
>>  >    who created it by looking in the git logs.
>>  >
>>  >      >From a quick code inspection, it looks like the CreateNPC method
>>  >    needs to be triggered to get anything to happen.  This is hooked up
>>  >    to the osNpcCreate() command (in the OSSL_Api.cs file).  You could
>>  >    try invoking this command via an in-world script - it looks like
>>  >    you'll need the uuid of an existing avatar to get going.  There are
>>  >    some other os commands there which appear to the NPC module (say,
>>  >    move, remove).
>>  >
>>  >    It's also very possible that this module doesn't work any more - I
>>  >    haven't heard of anybody trying to use it for a long time.  The only
>>  >    way to find out is to try it.
>>  >
>>  >    --
>>  >    Justin Clark-Casey (justincc)
>>
>>>   http://justincc.org
>>>   http://twitter.com/justincc
>>>
>>  >
>>  >    _______________________________________________
>>  >    Opensim-users mailing list
>>  >    Opensim-users at lists.berlios.de <mailto:
>> Opensim-users at lists.berlios.de> <mailto:Opensim-users at lists.berlios.de<mailto:
>> Opensim-users at lists.berlios.de>>
>>
>>  >    https://lists.berlios.de/mailman/listinfo/opensim-users
>>  >
>>  >
>>  >
>>  >
>>  > _______________________________________________
>>  > Opensim-users mailing list
>>  > Opensim-users at lists.berlios.de <mailto:Opensim-users at lists.berlios.de>
>>  > https://lists.berlios.de/mailman/listinfo/opensim-users
>>
>>
>> --
>> Justin Clark-Casey (justincc)
>> http://justincc.org
>> http://twitter.com/justincc
>> _______________________________________________
>> Opensim-users mailing list
>> Opensim-users at lists.berlios.de <mailto: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
>>
> _______________________________________________
> Opensim-users mailing list
> Opensim-users at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-users/attachments/20100917/4238429c/attachment.html>


More information about the Opensim-users mailing list