Inquiry about OpenSim NPC

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Inquiry about OpenSim NPC

TanLu

Hi, OpenSim users and Justin

 

I’m a PhD student and my research focus on agent-based simulation of crowd evacuation in fire emergency. Now I’m trying to implement such a simulation in OpenSim and I found the NPCs are really useful which can be used to mimic the pedestrian behavior. So far I am able to create NPCs using the script-based approach and make them moving around according to some designed rules, but I still have some problems.


(1) I wander if the NPCs can be treated like an object, which can be scripted? Now, I can only use a NPC List in the main script to control several NPCs at once, and this leads to a lot of “for-loop”. Is it possible to make each NPC to have its own script, so that I can use the llRezObject function in the main script to generate NPCs with script?


(2) When I click the NPC under the building mode, the three axes appear as usual. But when I try to move the NPC by dragging it along the axis, the NPC disappears once I release the mouse button. Moreover, through the osGetAvatarList() function, I find the NPC is still in the region! I wander is this a bug on the current NPC function, or did I do something wrong?


Could you please kindly help to solve my problems? Any comments or suggestions would be highly appreciated.


Many thanks for your attention and look forward to your reply.

 

Best regards,

 

Tan Lu

*****************************************************
Tan Lu
Institute of Space and Earth Information Science
Fok Ying Tung Remote Sensing Science Building
The Chinese University of Hong Kong
Shatin, Hong Kong
Tel: 852-2609 7257
Fax: 852- 2603 7470
Email:
[hidden email]


_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Inquiry about OpenSim NPC

Nicky Perian
This seems like the behavior of a prim with the physical attribute active / checked. As a test rez a default cube and set the physical attribute and attempt to move,

I have no experience with NPC's.


From: TanLu <[hidden email]>
To: [hidden email]
Sent: Wednesday, December 7, 2011 4:30 PM
Subject: [Opensim-users] Inquiry about OpenSim NPC


Hi, OpenSim users and Justin
 
I’m a PhD student and my research focus on agent-based simulation of crowd evacuation in fire emergency. Now I’m trying to implement such a simulation in OpenSim and I found the NPCs are really useful which can be used to mimic the pedestrian behavior. So far I am able to create NPCs using the script-based approach and make them moving around according to some designed rules, but I still have some problems.

(1) I wander if the NPCs can be treated like an object, which can be scripted? Now, I can only use a NPC List in the main script to control several NPCs at once, and this leads to a lot of “for-loop”. Is it possible to make each NPC to have its own script, so that I can use the llRezObject function in the main script to generate NPCs with script?

(2) When I click the NPC under the building mode, the three axes appear as usual. But when I try to move the NPC by dragging it along the axis, the NPC disappears once I release the mouse button. Moreover, through the osGetAvatarList() function, I find the NPC is still in the region! I wander is this a bug on the current NPC function, or did I do something wrong?

Could you please kindly help to solve my problems? Any comments or suggestions would be highly appreciated.

Many thanks for your attention and look forward to your reply.
 
Best regards,
 
Tan Lu
*****************************************************
Tan Lu
Institute of Space and Earth Information Science
Fok Ying Tung Remote Sensing Science Building
The Chinese University of Hong Kong
Shatin, Hong Kong
Tel: 852-2609 7257
Fax: 852- 2603 7470
Email:
[hidden email]


_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users



_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Inquiry about OpenSim NPC

GarminKawaguichi
In reply to this post by TanLu
1) Yes of course it is possible to "script" a NPC individually.
   For that I use an object attached to the NPC and containing 1 or more scripts! It's a great idea to program a Listen/RegionSay between the NPC and the scipt of the "creator", for example to gather all NPC at a place, to stop or "go" them ... or ... to kill :( them
Note that (according to your project) : you can have several notecards in the same generator object to create NPC with different behaviors depending on the embedded scripts.
 
2) ??? I'll try that when I'll have a few time
 
GCI
----- Original Message -----
Sent: Wednesday, December 07, 2011 9:30 AM
Subject: [Opensim-users] Inquiry about OpenSim NPC
(1) I wander if the NPCs can be treated like an object, which can be scripted? Now, I can only use a NPC List in the main script to control several NPCs at once, and this leads to a lot of “for-loop”. Is it possible to make each NPC to have its own script, so that I can use the llRezObject function in the main script to generate NPCs with script?


(2) When I click the NPC under the building mode, the three axes appear as usual. But when I try to move the NPC by dragging it along the axis, the NPC disappears once I release the mouse button. Moreover, through the osGetAvatarList() function, I find the NPC is still in the region! I wander is this a bug on the current NPC function, or did I do something wrong?

 


_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Inquiry about OpenSim NPC

GarminKawaguichi
Normally we can not edit and move an avatar or NPC, if you were able to select an NPC ("the three axes appear ...") it's because you have selectionned in passing over an attachment as some clothing or hair or accessory.

However, using the Advanced menu::Character::Character Tests:Allow Select Avatar (Imprudence viewer) or the Develop menu::Avatar::Character Tests:Allow Select Avatar (Viewer 3) we can select and edit an avatar. By doing this, what you describe is vefified: the NPC disappears or rather no longer displayed on the screen but the mini-map shows that it is in the same place.
When ordering by script these invisible avatars to move or to fly, we see that the green dots move on the mini-map. After a short time, we find these moving avatars appear as clouds.

I think the best solution is to uncheck "Allow Select Avatar".
 
GCI
----- Original Message -----
Sent: Wednesday, December 07, 2011 12:38 PM
Subject: Re: [Opensim-users] Inquiry about OpenSim NPC
 
2) ??? I'll try that when I'll have a few time
GCI
----- Original Message -----
Subject: [Opensim-users] Inquiry about OpenSim NPC
(2) When I click the NPC under the building mode, the three axes appear as usual. But when I try to move the NPC by dragging it along the axis, the NPC disappears once I release the mouse button. Moreover, through the osGetAvatarList() function, I find the NPC is still in the region! I wander is this a bug on the current NPC function, or did I do something wrong?

_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Inquiry about OpenSim NPC

justincc
In reply to this post by TanLu
Hi Tan Lu,

Unfortunately, the Second Life viewer doesn't (yet!) recognize NPCs - as far as its concerned they're users like
everybody else.

Therefore, scripting NPCs in OpenSimulator is subject to a number of workarounds.  For instance, you can't place scripts
in an NPC directly, as you would with a prim.  As Garmin said for (1), a standard idiom for controlling NPCs is to
attach an object to them which contains the control script.

And as Garmin also said for (2), being able to actually select them is not an expected behaviour.  If your viewer allows
this then things are going to go wrong pretty quickly.

I'd like to add that I'm happy to listen to suggestions for further NPC functions if there's (1) a demonstrable need,
(2) it's impossible via other script functions or extremely difficult and (3) it's not incredibly complicated to do :).
 However, I'm not likely to get to them quickly due to the press of other work and the fact there are still other
outstanding NPC issues that I haven't yet had time to address (e.g. problems if an NPC is pushed outside its region,
issues with movements not being exact).

Of course, I'm also very happy to look at code patches for NPC functions :-)

On 07/12/11 08:30, TanLu wrote:

>
> Hi, OpenSim users and Justin
>
> I’m a PhD student and my research focus on agent-based simulation of crowd evacuation in fire emergency. Now I’m trying
> to implement such a simulation in OpenSim and I found the NPCs are really useful which can be used to mimic the
> pedestrian behavior. So far I am able to create NPCs using the script-based approach and make them moving around
> according to some designed rules, but I still have some problems.
>
>
> (1) I wander if the NPCs can be treated like an object, which can be scripted? Now, I can only use a NPC List in the
> main script to control several NPCs at once, and this leads to a lot of “for-loop”. Is it possible to make each NPC to
> have its own script, so that I can use the llRezObject function in the main script to generate NPCs with script?
>
>
> (2) When I click the NPC under the building mode, the three axes appear as usual. But when I try to move the NPC by
> dragging it along the axis, the NPC disappears once I release the mouse button. Moreover, through the osGetAvatarList()
> function, I find the NPC is still in the region! I wander is this a bug on the current NPC function, or did I do
> something wrong?
>
>
> Could you please kindly help to solve my problems? Any comments or suggestions would be highly appreciated.
>
>
> Many thanks for your attention and look forward to your reply.
>
> Best regards,
>
> Tan Lu
>
> *****************************************************
> Tan Lu
> Institute of Space and Earth Information Science
> Fok Ying Tung Remote Sensing Science Building
> The Chinese University of Hong Kong
> Shatin, Hong Kong
> Tel: 852-2609 7257
> Fax: 852- 2603 7470
> Email: [hidden email] <mailto:[hidden email]>
>
>
>
> _______________________________________________
> Opensim-users mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/opensim-users


--
Justin Clark-Casey (justincc)
http://justincc.org/blog
http://twitter.com/justincc
_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Inquiry about OpenSim NPC

Bob Wellman
Justincc said "I'm happy to listen to suggestions for further NPC functions"
 
As I am currently working on writing some NPC scripts in PMgrid, I would like to suggest a few things whilst they are on my mind.
 
I realise they will be low priority for some time to come, but if they could just be added to a futures wish list that would be great.
 
1) Adding OS_NPC_RUN and OS_NPC_NO_RUN options to osNpcMoveToTarget. Default should be OS_NPC_NO_RUN which would work as now. The option OS_NPC_RUN would move the NPC at running speed and use a run animation rather than a walk animation.
 
2) Adding osNpcShout and osNpcWhisper functions. Each identical to osNpcSay but shouts or whispers the message rather than says it. Hopefully the shout animation would be used on the NPC if he shouts. Alternatively these could be options added to osNpcSay to control at what volume something is said, the deafult being Say as now.
 
3) Adding an osNpcTouch(key npc, key target).This would allow NPCs to do things like touch doors to open them before trying to walk through them and to interact with existing scripts in object such as light switches, machinery etc.
 
 
> Date: Wed, 7 Dec 2011 22:59:23 +0000

> From: [hidden email]
> To: [hidden email]
> Subject: Re: [Opensim-users] Inquiry about OpenSim NPC
>
> Hi Tan Lu,
>
> Unfortunately, the Second Life viewer doesn't (yet!) recognize NPCs - as far as its concerned they're users like
> everybody else.
>
> Therefore, scripting NPCs in OpenSimulator is subject to a number of workarounds. For instance, you can't place scripts
> in an NPC directly, as you would with a prim. As Garmin said for (1), a standard idiom for controlling NPCs is to
> attach an object to them which contains the control script.
>
> And as Garmin also said for (2), being able to actually select them is not an expected behaviour. If your viewer allows
> this then things are going to go wrong pretty quickly.
>
> I'd like to add that I'm happy to listen to suggestions for further NPC functions if there's (1) a demonstrable need,
> (2) it's impossible via other script functions or extremely difficult and (3) it's not incredibly complicated to do :).
> However, I'm not likely to get to them quickly due to the press of other work and the fact there are still other
> outstanding NPC issues that I haven't yet had time to address (e.g. problems if an NPC is pushed outside its region,
> issues with movements not being exact).
>
> Of course, I'm also very happy to look at code patches for NPC functions :-)
>
> On 07/12/11 08:30, TanLu wrote:
> >
> > Hi, OpenSim users and Justin
> >
> > I’m a PhD student and my research focus on agent-based simulation of crowd evacuation in fire emergency. Now I’m trying
> > to implement such a simulation in OpenSim and I found the NPCs are really useful which can be used to mimic the
> > pedestrian behavior. So far I am able to create NPCs using the script-based approach and make them moving around
> > according to some designed rules, but I still have some problems.
> >
> >
> > (1) I wander if the NPCs can be treated like an object, which can be scripted? Now, I can only use a NPC List in the
> > main script to control several NPCs at once, and this leads to a lot of “for-loop”. Is it possible to make each NPC to
> > have its own script, so that I can use the llRezObject function in the main script to generate NPCs with script?
> >
> >
> > (2) When I click the NPC under the building mode, the three axes appear as usual. But when I try to move the NPC by
> > dragging it along the axis, the NPC disappears once I release the mouse button. Moreover, through the osGetAvatarList()
> > function, I find the NPC is still in the region! I wander is this a bug on the current NPC function, or did I do
> > something wrong?
> >
> >
> > Could you please kindly help to solve my problems? Any comments or suggestions would be highly appreciated.
> >
> >
> > Many thanks for your attention and look forward to your reply.
> >
> > Best regards,
> >
> > Tan Lu
> >
> > *****************************************************
> > Tan Lu
> > Institute of Space and Earth Information Science
> > Fok Ying Tung Remote Sensing Science Building
> > The Chinese University of Hong Kong
> > Shatin, Hong Kong
> > Tel: 852-2609 7257
> > Fax: 852- 2603 7470
> > Email: [hidden email] <mailto:[hidden email]>
> >
> >
> >
> > _______________________________________________
> > Opensim-users mailing list
> > [hidden email]
> > https://lists.berlios.de/mailman/listinfo/opensim-users
>
>
> --
> Justin Clark-Casey (justincc)
> http://justincc.org/blog
> http://twitter.com/justincc
> _______________________________________________
> Opensim-users mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/opensim-users

_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Inquiry about OpenSim NPC

justincc
On 13/12/11 13:21, Bob Wellman wrote:

> Justincc said "I'm happy to listen to suggestions for further NPC functions"
>
> As I am currently working on writing some NPC scripts in PMgrid, I would like to suggest a few things whilst they are on
> my mind.
>
> I realise they will be low priority for some time to come, but if they could just be added to a futures wish list that
> would be great.
>
> 1) Adding OS_NPC_RUN and OS_NPC_NO_RUN options to osNpcMoveToTarget. Default should be OS_NPC_NO_RUN which would work as
> now. The option OS_NPC_RUN would move the NPC at running speed and use a run animation rather than a walk animation.

Sounds good to me.  A little difficult to do but not enormously so.

>
> 2) Adding osNpcShout and osNpcWhisper functions. Each identical to osNpcSay but shouts or whispers the message rather
> than says it. Hopefully the shout animation would be used on the NPC if he shouts. Alternatively these could be options
> added to osNpcSay to control at what volume something is said, the deafult being Say as now.

Both good suggestions, I think.  I prefer separate functions since this parallels llShout() and llWhisper().  Would be
pretty simple to do.

>
> 3) Adding an osNpcTouch(key npc, key target).This would allow NPCs to do things like touch doors to open them before
> trying to walk through them and to interact with existing scripts in object such as light switches, machinery etc.

I think this is also an interesting idea.  More difficult than 2 as events are involved.

Unfortunately, the chance to me doing them soon is quite small since there are many other issues to address (e.g. npc
boundary problems, issues with npcs and groups).  Naturally. patches are welcome.

>
>
>  > Date: Wed, 7 Dec 2011 22:59:23 +0000
>  > From: [hidden email]
>  > To: [hidden email]
>  > Subject: Re: [Opensim-users] Inquiry about OpenSim NPC
>  >
>  > Hi Tan Lu,
>  >
>  > Unfortunately, the Second Life viewer doesn't (yet!) recognize NPCs - as far as its concerned they're users like
>  > everybody else.
>  >
>  > Therefore, scripting NPCs in OpenSimulator is subject to a number of workarounds. For instance, you can't place scripts
>  > in an NPC directly, as you would with a prim. As Garmin said for (1), a standard idiom for controlling NPCs is to
>  > attach an object to them which contains the control script.
>  >
>  > And as Garmin also said for (2), being able to actually select them is not an expected behaviour. If your viewer allows
>  > this then things are going to go wrong pretty quickly.
>  >
>  > I'd like to add that I'm happy to listen to suggestions for further NPC functions if there's (1) a demonstrable need,
>  > (2) it's impossible via other script functions or extremely difficult and (3) it's not incredibly complicated to do :).
>  > However, I'm not likely to get to them quickly due to the press of other work and the fact there are still other
>  > outstanding NPC issues that I haven't yet had time to address (e.g. problems if an NPC is pushed outside its region,
>  > issues with movements not being exact).
>  >
>  > Of course, I'm also very happy to look at code patches for NPC functions :-)
>  >
>  > On 07/12/11 08:30, TanLu wrote:
>  > >
>  > > Hi, OpenSim users and Justin
>  > >
>  > > I’m a PhD student and my research focus on agent-based simulation of crowd evacuation in fire emergency. Now I’m
> trying
>  > > to implement such a simulation in OpenSim and I found the NPCs are really useful which can be used to mimic the
>  > > pedestrian behavior. So far I am able to create NPCs using the script-based approach and make them moving around
>  > > according to some designed rules, but I still have some problems.
>  > >
>  > >
>  > > (1) I wander if the NPCs can be treated like an object, which can be scripted? Now, I can only use a NPC List in the
>  > > main script to control several NPCs at once, and this leads to a lot of “for-loop”. Is it possible to make each NPC to
>  > > have its own script, so that I can use the llRezObject function in the main script to generate NPCs with script?
>  > >
>  > >
>  > > (2) When I click the NPC under the building mode, the three axes appear as usual. But when I try to move the NPC by
>  > > dragging it along the axis, the NPC disappears once I release the mouse button. Moreover, through the
> osGetAvatarList()
>  > > function, I find the NPC is still in the region! I wander is this a bug on the current NPC function, or did I do
>  > > something wrong?
>  > >
>  > >
>  > > Could you please kindly help to solve my problems? Any comments or suggestions would be highly appreciated.
>  > >
>  > >
>  > > Many thanks for your attention and look forward to your reply.
>  > >
>  > > Best regards,
>  > >
>  > > Tan Lu
>  > >
>  > > *****************************************************
>  > > Tan Lu
>  > > Institute of Space and Earth Information Science
>  > > Fok Ying Tung Remote Sensing Science Building
>  > > The Chinese University of Hong Kong
>  > > Shatin, Hong Kong
>  > > Tel: 852-2609 7257
>  > > Fax: 852- 2603 7470
>  > > Email: [hidden email] <mailto:[hidden email]>
>  > >
>  > >
>  > >
>  > > _______________________________________________
>  > > Opensim-users mailing list
>  > > [hidden email]
>  > > https://lists.berlios.de/mailman/listinfo/opensim-users
>  >
>  >
>  > --
>  > Justin Clark-Casey (justincc)
>  > http://justincc.org/blog
>  > http://twitter.com/justincc
>  > _______________________________________________
>  > Opensim-users mailing list
>  > [hidden email]
>  > https://lists.berlios.de/mailman/listinfo/opensim-users
>
>
>
> _______________________________________________
> Opensim-users mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/opensim-users


--
Justin Clark-Casey (justincc)
http://justincc.org/blog
http://twitter.com/justincc
_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

help with between-region crossings

Ovi Chris Rouly
Folks,

Is there a setting in the Configs that will help with between-region
crossings?

When "walking" across regions that are contiguous my avatar momentarily
freezes, drops into the scenery almost up to its waist, and then re-emerges
5-10 seconds later many, many meters farther ahead of its last controlled
position than seems reasonable.

I have set PersistBakedTextures = true and it is not feasible to extend
prims across every region boundary in my Sim (256 contiguous regions).

This is a human-controlled avatar.  My client-side NPCs experience far less
of an upset when walking autonomously between regions.

Moreover, knowing this will happen, I usually only "barely," "timidly"
hand-cross into the adjacent region (anticipating the above) and yet
still encounter the very same events.

Thank you in advance for your advice.

Chris

PS Jerry and Lindy special thanks!


_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Inquiry about OpenSim NPC

Marcus Llewellyn
In reply to this post by Bob Wellman
On 12/13/2011 7:21 AM, Bob Wellman wrote:
1) Adding OS_NPC_RUN and OS_NPC_NO_RUN options to osNpcMoveToTarget. Default should be OS_NPC_NO_RUN which would work as now. The option OS_NPC_RUN would move the NPC at running speed and use a run animation rather than a walk animation.

An alternate way to control your NPC's speed is to use osSetSpeed (http://opensimulator.org/wiki/OsSetSpeed). This is actually pretty useful as it has the advantage of not just speeding up your NPC, but also lets you slow it down. The only rather tiny downside is that you have to start and stop your own running animation.

Marcus Llewellyn

_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users