OSSLNPC

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Introduction)
Line 3: Line 3:
 
=Introduction=
 
=Introduction=
  
Since 12th August 2011, OpenSim had provided a number of functions for creating and manipulating NPCs.  The general philosophy in creating these functions is to give script writers the simple tools needed to create more sophisticated behaviour, as required.
+
Since 12th August 2011, OpenSim had provided a number of functions for creating and manipulating NPCs.  These replace the previous functions, that had stopped working by OpenSim 0.7.1.1 (possibly broken since OpenSim 0.6.9).
 +
 
 +
The general philosophy in creating these new functions is to  
 +
 
 +
# Give script writers the simple tools needed to create more sophisticated behaviour.
 +
 
 +
# Avoid duplicating existing LSL and OSSL functions.  For instance, finding out what state an agent is in can be done through llGetAgentInfo() rather than creating a special NPC function. 
 +
 
 +
NPCs are controlled via a script which must be in the same region as the NPC.  This could be housed in an attachment that is attached to the avatar.
 +
 
 +
NPCs created user these scripts cannot leave the region in which they were born.  If you want region crossing behaviour, please look at the options on the [[NPC]] wiki page.
 +
 
 
=Functions=
 
=Functions=
  

Revision as of 17:46, 11 August 2011

This page is under active construction

Contents

Introduction

Since 12th August 2011, OpenSim had provided a number of functions for creating and manipulating NPCs. These replace the previous functions, that had stopped working by OpenSim 0.7.1.1 (possibly broken since OpenSim 0.6.9).

The general philosophy in creating these new functions is to

  1. Give script writers the simple tools needed to create more sophisticated behaviour.
  1. Avoid duplicating existing LSL and OSSL functions. For instance, finding out what state an agent is in can be done through llGetAgentInfo() rather than creating a special NPC function.

NPCs are controlled via a script which must be in the same region as the NPC. This could be housed in an attachment that is attached to the avatar.

NPCs created user these scripts cannot leave the region in which they were born. If you want region crossing behaviour, please look at the options on the NPC wiki page.

Functions

Create and Remove

osNpcCreate

osNpcCreate(string firstname, string lastname, vector position, string notecard):key

osNpcRemove

osNpcRemove(key npc):void

Get and Set

osNpcGetRot

osNpcGetRot(key npc):rotation

osNpcSetRot

osNpcSetRot(key npc, rotation rot):void

osNpcGetPos

osNpcGetPos(key npc):vector

osNpcMoveToTarget

osNpcMoveToTarget(key npc, vector position, int options):void

osNpcStopMoveToTarget

osNpcStopMoveToTarget(key npc):void

Communication

osNpcSay

osNpcSay(key npc, string message):void

Appearance

osNpcLoadAppearance

osNpcLoadAppearance(key npc, string notecardNameOrUuid):void

osNpcSaveAppearance

osNpcSaveAppearance(key npc, string notecardName):key

Example

Personal tools
General
About This Wiki