llGetAgentType() Implemented?

Creating scripts
Post Reply
Phoneix Dreamscape
Posts: 13
Joined: Mon Jan 28, 2013 11:07 am
Has thanked: 8 times
Been thanked: 25 times

llGetAgentType() Implemented?

Post by Phoneix Dreamscape »

I've been working with NPCs lately and I think I found a missing/undocumented command: llGetAgentType(). The following is the last bullet point in the NPC section of the OpenSimulator 0.7.4 Release Notes:

"llGetAgentType() will now return OS_NPC if it is given an NPC UUID. It will also return AGENT if the NPC was created with the OS_NPC_SENSE_AS_AGENT flag."

The llGetAgentType() command would be very useful but I can't get it to work. I also can't find any documentation for it. Has this command been implemented or is it yet to come? It's not critical, there are alternative ways to sort NPCs from Avatars, llGetAgentType() would just make things easier.

NPCs are a blast! If you haven't tried one, read Ohn Lang's post: Action NPC on Ohn Freebies World then pop in and pick up the FREE NPC package. You and your NPCs will be glad that you did :)
These users thanked the author Phoneix Dreamscape for the post:
Constance Peregrine
User avatar
Ilan Tochner
Posts: 6524
Joined: Sun Dec 23, 2012 8:44 am
Has thanked: 4989 times
Been thanked: 4473 times
Contact:

Re: llGetAgentType() Implemented?

Post by Ilan Tochner »

Hi Phoneix,

Kitely currently uses OpenSim 0.7.4 with post-release patches so if this function works in the current official release then it should work in Kitely as well.

What exactly do you mean by "I can't get it to work"? Do you get some error message or does it not return the value you expect?
Phoneix Dreamscape
Posts: 13
Joined: Mon Jan 28, 2013 11:07 am
Has thanked: 8 times
Been thanked: 25 times

Re: llGetAgentType() Implemented?

Post by Phoneix Dreamscape »

Hi Ilan. I get the following error when the script compiles:

Error CS0103: The name 'llGetAgentType' does not exist in current context

It's as if I've entered the command incorrectly or the parser doesn't recognize the command at all. I should add that I don't know if it works in 0.7.4 or not, this is the first time I've tried to use it. I saw it in the Release Notes for 0.7.4 and thought.. Hmmmm this could be handy for detecting NPCs throughout the entire sim without using any sensors. As it is now, I can only detect NPCs within 96 meters using a sensor.
.
User avatar
Oren Hurvitz
Posts: 361
Joined: Sun Dec 23, 2012 8:42 am
Has thanked: 19 times
Been thanked: 499 times
Contact:

Re: llGetAgentType() Implemented?

Post by Oren Hurvitz »

There is no function called llGetAgentType(); the reference to it in the web page was a mistake. What should be used is llDetectedType(). It will return AGENT for agents, and OS_NPC (0x01000000) for NPC's. If the NPC was created with the OS_NPC_SENSE_AS_AGENT flag then it will return AGENT|OS_NPC (i.e., both flags).
These users thanked the author Oren Hurvitz for the post:
Phoneix Dreamscape
Phoneix Dreamscape
Posts: 13
Joined: Mon Jan 28, 2013 11:07 am
Has thanked: 8 times
Been thanked: 25 times

Re: llGetAgentType() Implemented?

Post by Phoneix Dreamscape »

Ahhh, that explains it! Thanks Oren :)
Post Reply