OsNpcCreate
From OpenSimulator
(Difference between revisions)
Mewtwo0641 (Talk | contribs) m |
|||
Line 56: | Line 56: | ||
* From git master commit 3b59af22 on Friday Jan 13 2012 (after the OpenSimulator 0.7.2 release), the avatar created by the existing osNpc* function without the options parameter will create an 'owned' NPC rather than an 'unowned' one. Please see the discussion above for information on these terms. This is a hopefully rare case where the behaviour of an existing function changes slightly. If you continue to need an 'unowned' NPC, please use the OS_NPC_NOT_OWNED option described above. | * From git master commit 3b59af22 on Friday Jan 13 2012 (after the OpenSimulator 0.7.2 release), the avatar created by the existing osNpc* function without the options parameter will create an 'owned' NPC rather than an 'unowned' one. Please see the discussion above for information on these terms. This is a hopefully rare case where the behaviour of an existing function changes slightly. If you continue to need an 'unowned' NPC, please use the OS_NPC_NOT_OWNED option described above. | ||
* Use OS_NPC_SENSE_AS_AGENT option if you would like for the created NPC to be able to be detected via a sensor and want to maintain llSensor() compatibility with type AGENT. | * Use OS_NPC_SENSE_AS_AGENT option if you would like for the created NPC to be able to be detected via a sensor and want to maintain llSensor() compatibility with type AGENT. | ||
+ | * OS_NPC_OBJECT_GROUP with it the npc will be created with the group of the object with the script, if that object owner is member of that group. This should allow parcel access by group to work now, and not much else. The group Title will also be set, it the region option NoNPCGroup is not active. | ||
+ | |||
| | | | ||
}} | }} |
Revision as of 05:43, 26 June 2017
key osNpcCreate(string firstname, string lastname, vector position, string cloneFrom)
key osNpcCreate(string firstname, string lastname, vector position, string cloneFrom, integer options) | |
| |
Threat Level | High |
Permissions | No permissions specified |
Extra Delay | No function delay specified |
Example(s) | |
// touch to create a NPC clone of the toucher in front of this emitter // NPC will move to the toucher, then will greet them. // Touch again to remove the NPC key npc; vector toucherPos; default { touch_start(integer number) { vector npcPos = llGetPos() + <1,0,0>; osAgentSaveAppearance(llDetectedKey(0), "appearance"); // coud use avatar UUID directly in osNpcCreate, but then NPC appearance is not persisted npc = osNpcCreate("ImYour", "Clone", npcPos, "appearance"); toucherPos = llDetectedPos(0); state hasNPC; } } state hasNPC { state_entry() { osNpcMoveTo(npc, toucherPos + <3,0,0>); osNpcSay(npc, "Hi there! My name is " + llKey2Name(npc)); } touch_start(integer number) { osNpcSay(npc, "Goodbye!"); osNpcRemove(npc); npc = NULL_KEY; state default; } } | |
Notes | |
Some more useful info:
|