Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005148opensim[REGION] Script Functionspublic2010-10-26 20:242011-10-21 18:37
ReporterHaplo 
Assigned Tojustincc 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0005148: osNpcCreate and all other osNpc*** silently fail
DescriptionAll osNpc* functions are no longer functioning and now silently fail with no errors or warnings.
Additional InformationScript below works flawlessly aside from osNpcMoveTo (silent fail) in 0.6.9, however as of 0.7.x.x none of the below osNpc commands work (silent fail):

---------------------
key npc;
default
{
    state_entry(){
        llListen(10,"",NULL_KEY,"");
    }
    listen(integer channel, string name, key id, string msg){
        if (msg != ""){
            if (msg == "create"){
                npc = osNpcCreate ("Jane", "Doe", <115, 165, 23>, "d004fdd5-c08c-45c8-9ab2-7b1f4d5f6abc");
            }
            else if (msg == "remove" && npc != NULL_KEY){
                osNpcSay (npc, "You will pay for this with your liiiiiivvveeessss!!!.....");
                osNpcRemove (npc);
            }
            else if (msg == "say" && npc != NULL_KEY){
                osNpcSay (npc, "I am your worst Nightmare!!!!");
            }
            else if (msg == "move" && npc != NULL_KEY){
                osNpcMoveTo (npc, llGetPos()+<9,9,0>);
            }
            else if (msg == "animate" && npc != NULL_KEY){
                osAvatarPlayAnimation (npc, "stand_1");
                llSleep(3);
                osAvatarStopAnimation (npc, "stand_1");
            }
        }
    }
}
-----------------------
TagsNo tags attached.
Git Revision or version number1.5.6.5
Run ModeStandalone (1 Region)
Physics EngineODE
Script Engine
EnvironmentMono / Linux32
Mono Version2.4.2
ViewerHippo
Attached Files

- Relationships
duplicate of 0004064closedjustincc osNpcMoveTo does not move the bot. 

-  Notes
(0017167)
Haplo (reporter)
2010-10-29 00:05

Updated severity from 'feature' to 'minor'.
(0017252)
Haplo (reporter)
2010-11-07 14:17

After Further testing I have found the following. As of x.6.8.x aside from osNpcMoveTo, all other osNpc* commands were working through x.6.9.x

I setup MySql server standalones, tested and confirmed object and attachment persistence on all 3 test servers. On the two x.6.x that osNpcCreate did work, although the NPC is created, attachments do not persist on the av that is cloned.

The cloned av does retain normal clothing, colors, *standard* skin, shape, inventory, etc. However attachments are not retained upon creation.

I did not find osNpcMoveTo working in any release that I tested.
(0017410)
Haplo (reporter)
2010-11-28 21:03

New Information. Now testing using 7.0.2 directly from Opensimulator site. Please advise me if I need to change this.

After much trial and error I decided to just try something different in-world. Although nothing is spawning at this time I have noted something that may help run down the issue.

osNpcCreate is actually grabbing a UUID when the function is called. For whatever reason it is just never applied to a new avatar / npc in the scene presence.

The below script snippet was used in 6.9 to generate 21 npcs at random:
----------------------------
 if (msg == "create"){

               for (x = 0;x < 21; x++)
               {
                   destX = (integer) llFrand (20)-10; // Creates an area from +10 to -10 X coord around center
                   destY = (integer) llFrand (20)-10; // Creates an area from +10 to -10 Y coord around center
                   npc = osNpcCreate ("Luke", "Endemirror", llGetPos()+<destX, destY, 0>, llGetOwner());
                   npcList += npc;
                   llSleep(.25);
               }
           }
------------------

In version 7.0.2 this results in npcList being populated with 21 individual new UUIDs with no errors. using this same type of loop to run through a Remove process also returns no errors.

However, attempting to use a command such as osNpcSay after creation does still throw an error: npcCreate: Runtime error: (0): Object reference not set to an instance of an object

So obviously - nothing in-world to work with I assume.

Thanks,
- Hap
(0018725)
SinSeer (reporter)
2011-06-28 12:52

I can confirm this doesn't work :(

ALso got this in log from running oscreatenpc:


15:51:38 - [IRC-Region Discordia] heard on channel 2147483647 : System.Reflection.TargetParameterCountException: parameters do not match signature

Server stack trace:
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.Culturefo culture) [0x00000] in <filename unknown>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
  at OpenSim.Region.ScriptEngine.Shared.ScriptBase.Executor.ExecuteEvent (System.String state, System.String FunctionName, System.Object[] args) [0x00000] in <filename unknown0
  at OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass.ExecuteEvent (System.String state, System.String FunctionName, System.Object[] args) [0x00000] in <filename known>:0
  at (wrapper remoting-invoke-with-check) OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass:ExecuteEvent (string,string,object[])
  at (wrapper xdomain-dispatch) OpenSim
(0018731)
justincc (administrator)
2011-06-28 16:45

After commit 22f25fa, I was able to create and remove an NPC using the script above and get it to say things. However, these NPCs do not get the proper cloned appearance (they are always cloudy). Also, move is still not working. More fixing would still need to be done.

@SinSeer - I was able to get the script working without seeing your error before that commit. Are you trying this on the very latest OpenSim with default script engine config settings? Also, you might want to try making sure that the ScriptEngine directory is empty before you start (apart from Default.lsl).
(0018732)
SinSeer (reporter)
2011-06-28 17:02

I'm going to grab that new code and make a new build shortly... I'll clean everything up on my end and reload and see if i can give some feedback either tonight or tomorrow...
(0018734)
Haplo (reporter)
2011-06-28 20:36

@justincc - I also am able to create 'cloud' NPCs and get them to say things. Animations appear to be working as I used one that moves the NPC a copule of steps and the cloud moved a bit.

Also I am wondering - with the ups and downs of this - do you think this is a real thread that will be followed and eventually a stable addition to opensim? I really hope so because other forks that have NPCs are complicated systems and this version of simple in world scripting really opens up all sorts of possibilities for us LSL / OSSL scripters :)

I have tried my best to learn some coding so I couuld help but just as I am able to start figuring out how things are being implemented and follow the threads - things change and the progress I made on getting moveto to work or what have you is lost. :\ (Not that it is ever that great. I've never gotten the hang of threading yet - I am usually using a timer hack to check location, keep moving, release to thread, check again, etc. until within 5m of end coords and stop. and even then sometimes they will still keep trucking as they miss the end coords - never fulfilling the 'if' and go offworld - watching the console errors fly by. So obviously horrible server load, and bad n00b coding skills)

I wish I could help more so I could fix this but I am just not advanced enough of a coder to do it. I can't keep track of all the jumping between the different files and calls and how they work together. Let me know if there is anything else I could do to help and I will do it for sure.

Take care,
- Hap
(0018737)
SinSeer (reporter)
2011-06-29 08:30

Well I don't know enough to immediately solve these problems either, but I can help to look for causes...

First off, yeah, I can confirm we can call bots, they appear (as clouds), and they can talk.

The cloudiness looks to be because when it is duplicating the appearance of someone, it is grabbing the asset id's but can't access them because it doesn't know what hypergrid the bot is from, and know which server to use for that?

For instance, I get

[HG INVENTORY CONNECTOR]: User 968f4d57-d6f1-45b7-ac4e-3a86c696841d does not have InventoryServerURI. OH NOES!

when the bot appears, which makes me think thats the reason that this fails.

[ASSET SERVICE]: Could not parse requested asset id /80620fa8-9334-4d87-9185-93346ec58912

I also notice the bots appear as "Bot.Name@unknown" in the radar.

I noticed the bots don't get added to the mysql table UserAccounts; which I believe is where the hg gets the information for the inventoryserveruri - I'm not saying they SHOULD get added to the UserAccounts table, but I think it's looking for information that isn't there when trying to clone the appearance?

As far as stability goes, I had three bots on all night in my little sim with no issues; granted they were just clouds but they didn't cause anything weird to happen.

Of course I could be way off base; I'm still playing with it and will probably start playing with my own local source to see if i can force them to at least take on appearance. Even non-moving, but talking and visible bots would be useful in some situations.

I'm going to continue playing with this today, but if there's any more information you specifically need please do let me know, I'm free to test this stuff out anytime.
(0018741)
justincc (administrator)
2011-06-29 15:44

@Haplo - My plan is to get the existing osNpc* functions working again (and osMoveTo() if it wasn't working in the first place). This is quite a good discipline since it gives me an excuse to tidy up some OpenSim internals in this area - the complexity of these internals, as you've seen, is one of OpenSim's problems in my opinion. However, doing this might take quite some time when other priorities pop up.

When I do make changes, testing these and providing feedback here would be very valuable.

@SinSeer - I hadn't tested under HG. Those HG messages should hopefully disappear since I want to strip bots of their ultimately unnecessary client objects (which I think is what is triggering those HG messages).

But there is a general problem with cloning appearance. This information is copied from an in-region avatar and doesn't go through UserAccounts. But it still isn't working.

Any patches are welcome. It might be a short while before I do the next changes - I'm hoping to do a little bit of work on this on Friday. Thanks for the test offer - if you could test any commits that I do make on this area and post any information here that would be very welcome.
(0019340)
aiaustin (developer)
2011-08-04 08:21
edited on: 2011-08-05 04:50

What commit of OpenSim 0.7.2 dev master is this meant to be working in Justin. I have r/16430 in place and NPC enabled...

(0019341)
justincc (administrator)
2011-08-04 18:39

If it is working then "/10 create" should result in a good chunk of output on the console.

You need [NPC] Enabled = true and the OSSL functions enabled (all ThreatLevel high).

This should work in r/16430 but later revisions also have fixes for npc target reaching.
(0019347)
aiaustin (developer)
2011-08-05 04:50
edited on: 2011-08-05 04:51

Working fine on tests now in r/15430. Thanks.

(0019355)
Haplo (reporter)
2011-08-05 15:27

I just reinstalled my local system and server and am getting ready to install opensim again. from the latest notes I am a bit confused as to what has exactly been tested and what is being said....

Are you all saying that the osNpc functions are now all working including MoveTo? and in the latest revision? Or a specific earlier revision I should grab to help test with?

I've finally gotten a regular schedule so I can start testing and working on my opensim projects again!

Thanks justin, Sin, and ai for picking this back up I really appreciate it.
(0019356)
justincc (administrator)
2011-08-05 15:30

I recommend waiting before testing - things are not yet complete and I plan to do more work next week. For more info, please look back in the recent dev mailing list.
(0019375)
aiaustin (developer)
2011-08-06 01:20
edited on: 2011-08-06 01:20

I used r/16453 in my latest tests, but heed Justin's advice.

The example code in the Mantis report works, as do the two demo scripts on the wiki.

http://opensimulator.org/wiki/OsNpcCreate. [^] A good one

http://opensimulator.org/wiki/OsNpcRemove [^] A useful one to tidy up

(0019464)
justincc (administrator)
2011-08-11 18:58

Current implementation completed on Friday 12th August in git devel master. New functions and examples detailed on http://opensimulator.org/wiki/OSSLNPC. [^] Existing scripts should now also work, though no guarantees.

- Issue History
Date Modified Username Field Change
2010-10-26 20:24 Haplo New Issue
2010-10-26 20:24 Haplo Git Revision => 1.5.6.5
2010-10-26 20:24 Haplo SVN Revision => 32289
2010-10-26 20:24 Haplo Run Mode => Standalone (1 Region)
2010-10-26 20:24 Haplo Physics Engine => ODE
2010-10-26 20:24 Haplo Environment => Mono / Linux32
2010-10-26 20:24 Haplo Mono Version => 2.4.2
2010-10-26 20:24 Haplo Viewer => Hippo
2010-10-29 00:05 Haplo Note Added: 0017167
2010-10-29 00:05 Haplo Severity feature => minor
2010-10-29 00:05 Haplo Description Updated
2010-11-07 14:17 Haplo Note Added: 0017252
2010-11-07 14:18 Haplo Additional Information Updated
2010-11-28 21:03 Haplo Note Added: 0017410
2011-06-28 12:52 SinSeer Note Added: 0018725
2011-06-28 16:45 justincc Note Added: 0018731
2011-06-28 17:02 SinSeer Note Added: 0018732
2011-06-28 20:36 Haplo Note Added: 0018734
2011-06-29 08:30 SinSeer Note Added: 0018737
2011-06-29 15:44 justincc Note Added: 0018741
2011-06-29 15:44 justincc Status new => assigned
2011-06-29 15:44 justincc Assigned To => justincc
2011-06-30 05:43 makopoppo Relationship added duplicate of 0004064
2011-08-04 08:21 aiaustin Note Added: 0019340
2011-08-04 18:39 justincc Note Added: 0019341
2011-08-05 04:50 aiaustin Note Edited: 0019340
2011-08-05 04:50 aiaustin Note Added: 0019347
2011-08-05 04:51 aiaustin Note Edited: 0019347
2011-08-05 15:27 Haplo Note Added: 0019355
2011-08-05 15:30 justincc Note Added: 0019356
2011-08-06 01:20 aiaustin Note Added: 0019375
2011-08-06 01:20 aiaustin Note Edited: 0019375
2011-08-11 18:58 justincc Status assigned => resolved
2011-08-11 18:58 justincc Resolution open => fixed
2011-08-11 18:58 justincc Note Added: 0019464
2011-10-21 18:37 justincc Status resolved => closed


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker