Sitting an NPC

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

Sitting an NPC

David Burden

Anyone worked out how to get a bot to sit on an object? Or touch one? Is there code there yet Justin, or is there a work around? 

I also can't get scripts in attachments to stay working once rezzed back out of the notecard - known problem or am I doing something wrong?

Otherwise going great guns with all the osNPC functions.

David


David Burden
Daden Limited

t: +44 (0)121 250 5677
m: 07811 266 199
e: [hidden email]
w: www.daden.co.uk
skype: daden5
twitter: www.twitter.com/davidburden
sl: http://www.slurl.com/secondlife/daden%20prime/160/184/26
sl IM: Corro Moseley

Daden specialise in creating immersive learning & visualisation systems, and interactive virtual agents.





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

Re: Sitting an NPC

GarminKawaguichi
>----- Original Message -----
>From: David Burden
>Sent: Thursday, October 13, 2011 5:03 AM
>Subject: [Opensim-users] Sitting an NPC
>
>I also can't get scripts in attachments to stay working once rezzed back
>out of the notecard - known problem or am I doing something wrong?

I used a script on an object attached to an NPC:

1) Don't forget to attach the object to yourself before to create the
notecard :)))

and 2) I've found a problem; to command an NPC we need to know its own key;
I noted that, in the script attached, knpc = llGetOwner() in the state_entry
returns my own key (the key of the object owner during the creation of the
attachment); to have the key of the NPC, I have inserted an llSleep(2.0)
before the llGetOwner()

ah and 3) To debug the script attached to the NPC, we cannot use
llOwnerSay(...); use llShout(0, ...debugging_message...);

GCI

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

Re: Sitting an NPC

Marcus Llewellyn
In reply to this post by David Burden
On Wed, Oct 12, 2011 at 10:03 PM, David Burden <[hidden email]> wrote:

I also can't get scripts in attachments to stay working once rezzed back out of the notecard - known problem or am I doing something wrong?


Scripts attached to an NPC have been working fine for me. One thing to remember (sorry if it's obvious) is that attachments on an NPC won't run on land that restricts script execution to a group, or to the region owner. This is unfortunate, as it makes using NPCs that have scripted attachments while maintaining a defense against griefers pretty much impossible. And since NPC UUIDs aren't persistent, you cannot have them join a group or provide any real exception for them really.

Right now, you can either let everyone on your parcel/region run scripts so that NPCs can run them too, or stick to controlling the NPC from an unattached object owned by you or another privileged user.

As far as sitting goes, the best I've been able to do is to attach a chair to the NPC, and use osAvatarPlayAnimation to perform a sit animation tailored to fit the situation. Not ideal, but it works.

Part of the problem here is that it seems as though as far as the simulator goes, NPCs are a first class user agent. It treats them just like any other client connected to the sim, but without the network overhead. It would be nice if NPCs were somewhere between a user and an object which could be owned, and which either inherited privileges from its owner, or could be assigned persistant privileges of its own.

Better stop there before I start on a whole long wish list. ;)

Marcus

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

Re: Sitting an NPC

justincc
In reply to this post by David Burden
Unfortunately, I didn't get an opportunity to look at implement sit for NPC (which would also require a standup
function).  It wasn't something that was implemented previously.  I might try and take a look soon, though I have a
number of other things queued up first.

As other people have commented, it sounds like you might have a local issue with scripts.  And dz has mentioned the
script owner issue which also needs to be addressed.

On 13/10/11 04:03, David Burden wrote:

>
> Anyone worked out how to get a bot to sit on an object? Or touch one? Is there code there yet Justin, or is there a work
> around?
>
> I also can't get scripts in attachments to stay working once rezzed back out of the notecard - known problem or am I
> doing something wrong?
>
> Otherwise going great guns with all the osNPC functions.
>
> David
>
>
> David Burden
> Daden Limited
>
> t: +44 (0)121 250 5677
> m: 07811 266 199
> e: [hidden email] <mailto:[hidden email]>
> w: www.daden.co.uk <http://www.daden.co.uk>
> skype: daden5
> twitter: www.twitter.com/davidburden <http://www.twitter.com/davidburden>
> sl: http://www.slurl.com/secondlife/daden%20prime/160/184/26
> sl IM: Corro Moseley
>
> Daden specialise in creating immersive learning & visualisation systems, and interactive virtual agents.
>
>
>
>
>
>
> _______________________________________________
> 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: Sitting an NPC

justincc
In reply to this post by Marcus Llewellyn
Yes, things get difficult because the viewer has no support for NPCs per se.  So you have to do stuff like saving state
in notecards to work around this.  However, it's probably worth looking at the script attachment issue sometime.

Wish lists, wish lists :)

On 13/10/11 17:04, Marcus Llewellyn wrote:

> On Wed, Oct 12, 2011 at 10:03 PM, David Burden <[hidden email] <mailto:[hidden email]>> wrote:
>
>
>     I also can't get scripts in attachments to stay working once rezzed back out of the notecard - known problem or am I
>     doing something wrong?
>
>
> Scripts attached to an NPC have been working fine for me. One thing to remember (sorry if it's obvious) is that
> attachments on an NPC won't run on land that restricts script execution to a group, or to the region owner. This is
> unfortunate, as it makes using NPCs that have scripted attachments while maintaining a defense against griefers pretty
> much impossible. And since NPC UUIDs aren't persistent, you cannot have them join a group or provide any real exception
> for them really.
>
> Right now, you can either let everyone on your parcel/region run scripts so that NPCs can run them too, or stick to
> controlling the NPC from an unattached object owned by you or another privileged user.
>
> As far as sitting goes, the best I've been able to do is to attach a chair to the NPC, and use osAvatarPlayAnimation to
> perform a sit animation tailored to fit the situation. Not ideal, but it works.
>
> Part of the problem here is that it seems as though as far as the simulator goes, NPCs are a first class user agent. It
> treats them just like any other client connected to the sim, but without the network overhead. It would be nice if NPCs
> were somewhere between a user and an object which could be owned, and which either inherited privileges from its owner,
> or could be assigned persistant privileges of its own.
>
> Better stop there before I start on a whole long wish list. ;)
>
> Marcus
>
>
>
> _______________________________________________
> 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: Sitting an NPC

justincc
In reply to this post by Marcus Llewellyn
I've now experimentally implemented osNpcSit() [1] and osNpcStand() [2] (thanks to Fritigern for documenting these!).

Sitting only works if there is a sit target.  Doing this without a sit target is not straightforward since the code
conforms to the fact that in SL, an avatar sitting without a sit target is not detectable and not part of the linkset.

Currently there's only one option, which is to sit the avatar from anywhere in the sim.  Might add an option to ask it
to walk/fly there.

[1] http://opensimulator.org/wiki/OsNpcSit
[2] http://opensimulator.org/wiki/OsNpcStand

On 13/10/11 17:04, Marcus Llewellyn wrote:

> On Wed, Oct 12, 2011 at 10:03 PM, David Burden <[hidden email] <mailto:[hidden email]>> wrote:
>
>
>     I also can't get scripts in attachments to stay working once rezzed back out of the notecard - known problem or am I
>     doing something wrong?
>
>
> Scripts attached to an NPC have been working fine for me. One thing to remember (sorry if it's obvious) is that
> attachments on an NPC won't run on land that restricts script execution to a group, or to the region owner. This is
> unfortunate, as it makes using NPCs that have scripted attachments while maintaining a defense against griefers pretty
> much impossible. And since NPC UUIDs aren't persistent, you cannot have them join a group or provide any real exception
> for them really.
>
> Right now, you can either let everyone on your parcel/region run scripts so that NPCs can run them too, or stick to
> controlling the NPC from an unattached object owned by you or another privileged user.
>
> As far as sitting goes, the best I've been able to do is to attach a chair to the NPC, and use osAvatarPlayAnimation to
> perform a sit animation tailored to fit the situation. Not ideal, but it works.
>
> Part of the problem here is that it seems as though as far as the simulator goes, NPCs are a first class user agent. It
> treats them just like any other client connected to the sim, but without the network overhead. It would be nice if NPCs
> were somewhere between a user and an object which could be owned, and which either inherited privileges from its owner,
> or could be assigned persistant privileges of its own.
>
> Better stop there before I start on a whole long wish list. ;)
>
> Marcus
>
>
>
> _______________________________________________
> 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: Sitting an NPC

Gudule Lapointe
Holy sit! I've been spending hours trying to script a workaround for that ;-). Well, honestly, just thinking about it. I am happy I won't need it anymore.


Le 22 oct. 2011 à 01:00, Justin Clark-Casey a écrit :

> I've now experimentally implemented osNpcSit() [1] and osNpcStand() [2] (thanks to Fritigern for documenting these!).
>
> Sitting only works if there is a sit target.  Doing this without a sit target is not straightforward since the code conforms to the fact that in SL, an avatar sitting without a sit target is not detectable and not part of the linkset.
>
> Currently there's only one option, which is to sit the avatar from anywhere in the sim.  Might add an option to ask it to walk/fly there.
>
> [1] http://opensimulator.org/wiki/OsNpcSit
> [2] http://opensimulator.org/wiki/OsNpcStand
>
> On 13/10/11 17:04, Marcus Llewellyn wrote:
>> On Wed, Oct 12, 2011 at 10:03 PM, David Burden <[hidden email] <mailto:[hidden email]>> wrote:
>>
>>
>>    I also can't get scripts in attachments to stay working once rezzed back out of the notecard - known problem or am I
>>    doing something wrong?
>>
>>
>> Scripts attached to an NPC have been working fine for me. One thing to remember (sorry if it's obvious) is that
>> attachments on an NPC won't run on land that restricts script execution to a group, or to the region owner. This is
>> unfortunate, as it makes using NPCs that have scripted attachments while maintaining a defense against griefers pretty
>> much impossible. And since NPC UUIDs aren't persistent, you cannot have them join a group or provide any real exception
>> for them really.
>>
>> Right now, you can either let everyone on your parcel/region run scripts so that NPCs can run them too, or stick to
>> controlling the NPC from an unattached object owned by you or another privileged user.
>>
>> As far as sitting goes, the best I've been able to do is to attach a chair to the NPC, and use osAvatarPlayAnimation to
>> perform a sit animation tailored to fit the situation. Not ideal, but it works.
>>
>> Part of the problem here is that it seems as though as far as the simulator goes, NPCs are a first class user agent. It
>> treats them just like any other client connected to the sim, but without the network overhead. It would be nice if NPCs
>> were somewhere between a user and an object which could be owned, and which either inherited privileges from its owner,
>> or could be assigned persistant privileges of its own.
>>
>> Better stop there before I start on a whole long wish list. ;)
>>
>> Marcus
>>
>>
>>
>> _______________________________________________
>> 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: Sitting an NPC

justincc
I'm rather curious that people will spend a long time rather than trying to patch it in OpenSim itself.

Is it that the code is just too complicated to work out what's going on, people don't know c# or some other factor?  I'm
interested to know.

On 22/10/11 00:07, Gudule Lapointe wrote:

> Holy sit! I've been spending hours trying to script a workaround for that ;-). Well, honestly, just thinking about it. I am happy I won't need it anymore.
>
>
> Le 22 oct. 2011 à 01:00, Justin Clark-Casey a écrit :
>
>> I've now experimentally implemented osNpcSit() [1] and osNpcStand() [2] (thanks to Fritigern for documenting these!).
>>
>> Sitting only works if there is a sit target.  Doing this without a sit target is not straightforward since the code conforms to the fact that in SL, an avatar sitting without a sit target is not detectable and not part of the linkset.
>>
>> Currently there's only one option, which is to sit the avatar from anywhere in the sim.  Might add an option to ask it to walk/fly there.
>>
>> [1] http://opensimulator.org/wiki/OsNpcSit
>> [2] http://opensimulator.org/wiki/OsNpcStand
>>
>> On 13/10/11 17:04, Marcus Llewellyn wrote:
>>> On Wed, Oct 12, 2011 at 10:03 PM, David Burden<[hidden email]<mailto:[hidden email]>>  wrote:
>>>
>>>
>>>     I also can't get scripts in attachments to stay working once rezzed back out of the notecard - known problem or am I
>>>     doing something wrong?
>>>
>>>
>>> Scripts attached to an NPC have been working fine for me. One thing to remember (sorry if it's obvious) is that
>>> attachments on an NPC won't run on land that restricts script execution to a group, or to the region owner. This is
>>> unfortunate, as it makes using NPCs that have scripted attachments while maintaining a defense against griefers pretty
>>> much impossible. And since NPC UUIDs aren't persistent, you cannot have them join a group or provide any real exception
>>> for them really.
>>>
>>> Right now, you can either let everyone on your parcel/region run scripts so that NPCs can run them too, or stick to
>>> controlling the NPC from an unattached object owned by you or another privileged user.
>>>
>>> As far as sitting goes, the best I've been able to do is to attach a chair to the NPC, and use osAvatarPlayAnimation to
>>> perform a sit animation tailored to fit the situation. Not ideal, but it works.
>>>
>>> Part of the problem here is that it seems as though as far as the simulator goes, NPCs are a first class user agent. It
>>> treats them just like any other client connected to the sim, but without the network overhead. It would be nice if NPCs
>>> were somewhere between a user and an object which could be owned, and which either inherited privileges from its owner,
>>> or could be assigned persistant privileges of its own.
>>>
>>> Better stop there before I start on a whole long wish list. ;)
>>>
>>> Marcus
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
|

Re: Sitting an NPC

Gudule Lapointe
In my case, I just don't know, simply said. But all this makes me want to learn it…


Le 22 oct. 2011 à 01:11, Justin Clark-Casey a écrit :

> I'm rather curious that people will spend a long time rather than trying to patch it in OpenSim itself.
>
> Is it that the code is just too complicated to work out what's going on, people don't know c# or some other factor?  I'm interested to know.
>
> On 22/10/11 00:07, Gudule Lapointe wrote:
>> Holy sit! I've been spending hours trying to script a workaround for that ;-). Well, honestly, just thinking about it. I am happy I won't need it anymore.
>>
>>
>> Le 22 oct. 2011 à 01:00, Justin Clark-Casey a écrit :
>>
>>> I've now experimentally implemented osNpcSit() [1] and osNpcStand() [2] (thanks to Fritigern for documenting these!).
>>>
>>> Sitting only works if there is a sit target.  Doing this without a sit target is not straightforward since the code conforms to the fact that in SL, an avatar sitting without a sit target is not detectable and not part of the linkset.
>>>
>>> Currently there's only one option, which is to sit the avatar from anywhere in the sim.  Might add an option to ask it to walk/fly there.
>>>
>>> [1] http://opensimulator.org/wiki/OsNpcSit
>>> [2] http://opensimulator.org/wiki/OsNpcStand
>>>
>>> On 13/10/11 17:04, Marcus Llewellyn wrote:
>>>> On Wed, Oct 12, 2011 at 10:03 PM, David Burden<[hidden email]<mailto:[hidden email]>>  wrote:
>>>>
>>>>
>>>>    I also can't get scripts in attachments to stay working once rezzed back out of the notecard - known problem or am I
>>>>    doing something wrong?
>>>>
>>>>
>>>> Scripts attached to an NPC have been working fine for me. One thing to remember (sorry if it's obvious) is that
>>>> attachments on an NPC won't run on land that restricts script execution to a group, or to the region owner. This is
>>>> unfortunate, as it makes using NPCs that have scripted attachments while maintaining a defense against griefers pretty
>>>> much impossible. And since NPC UUIDs aren't persistent, you cannot have them join a group or provide any real exception
>>>> for them really.
>>>>
>>>> Right now, you can either let everyone on your parcel/region run scripts so that NPCs can run them too, or stick to
>>>> controlling the NPC from an unattached object owned by you or another privileged user.
>>>>
>>>> As far as sitting goes, the best I've been able to do is to attach a chair to the NPC, and use osAvatarPlayAnimation to
>>>> perform a sit animation tailored to fit the situation. Not ideal, but it works.
>>>>
>>>> Part of the problem here is that it seems as though as far as the simulator goes, NPCs are a first class user agent. It
>>>> treats them just like any other client connected to the sim, but without the network overhead. It would be nice if NPCs
>>>> were somewhere between a user and an object which could be owned, and which either inherited privileges from its owner,
>>>> or could be assigned persistant privileges of its own.
>>>>
>>>> Better stop there before I start on a whole long wish list. ;)
>>>>
>>>> Marcus
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
>

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

Re: Sitting an NPC

Karen Palen
In reply to this post by justincc
In my case it was the fact that I intermittently work on various viewers!

That problems has now been resolved (YAY!) so I just need to download
and understand the current source code.

Oh yes, I also HATE C# with a passion having served a 10 year sentence
coding with it even though the salary was great. :-)

Karen

On 10/21/2011 04:11 PM, Justin Clark-Casey wrote:

> I'm rather curious that people will spend a long time rather than trying
> to patch it in OpenSim itself.
>
> Is it that the code is just too complicated to work out what's going on,
> people don't know c# or some other factor?  I'm interested to know.
>
> On 22/10/11 00:07, Gudule Lapointe wrote:
>> Holy sit! I've been spending hours trying to script a workaround for
>> that ;-). Well, honestly, just thinking about it. I am happy I won't
>> need it anymore.
>>
>>
>> Le 22 oct. 2011 à 01:00, Justin Clark-Casey a écrit :
>>
>>> I've now experimentally implemented osNpcSit() [1] and osNpcStand()
>>> [2] (thanks to Fritigern for documenting these!).
>>>
>>> Sitting only works if there is a sit target.  Doing this without a
>>> sit target is not straightforward since the code conforms to the fact
>>> that in SL, an avatar sitting without a sit target is not detectable
>>> and not part of the linkset.
>>>
>>> Currently there's only one option, which is to sit the avatar from
>>> anywhere in the sim.  Might add an option to ask it to walk/fly there.
>>>
>>> [1] http://opensimulator.org/wiki/OsNpcSit
>>> [2] http://opensimulator.org/wiki/OsNpcStand
>>>
>>> On 13/10/11 17:04, Marcus Llewellyn wrote:
>>>> On Wed, Oct 12, 2011 at 10:03 PM, David
>>>> Burden<[hidden email]<mailto:[hidden email]>>
>>>> wrote:
>>>>
>>>>
>>>>     I also can't get scripts in attachments to stay working once
>>>> rezzed back out of the notecard - known problem or am I
>>>>     doing something wrong?
>>>>
>>>>
>>>> Scripts attached to an NPC have been working fine for me. One thing
>>>> to remember (sorry if it's obvious) is that
>>>> attachments on an NPC won't run on land that restricts script
>>>> execution to a group, or to the region owner. This is
>>>> unfortunate, as it makes using NPCs that have scripted attachments
>>>> while maintaining a defense against griefers pretty
>>>> much impossible. And since NPC UUIDs aren't persistent, you cannot
>>>> have them join a group or provide any real exception
>>>> for them really.
>>>>
>>>> Right now, you can either let everyone on your parcel/region run
>>>> scripts so that NPCs can run them too, or stick to
>>>> controlling the NPC from an unattached object owned by you or
>>>> another privileged user.
>>>>
>>>> As far as sitting goes, the best I've been able to do is to attach a
>>>> chair to the NPC, and use osAvatarPlayAnimation to
>>>> perform a sit animation tailored to fit the situation. Not ideal,
>>>> but it works.
>>>>
>>>> Part of the problem here is that it seems as though as far as the
>>>> simulator goes, NPCs are a first class user agent. It
>>>> treats them just like any other client connected to the sim, but
>>>> without the network overhead. It would be nice if NPCs
>>>> were somewhere between a user and an object which could be owned,
>>>> and which either inherited privileges from its owner,
>>>> or could be assigned persistant privileges of its own.
>>>>
>>>> Better stop there before I start on a whole long wish list. ;)
>>>>
>>>> Marcus
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
>>
>
>
_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users