Objects

The objects module allows in world objects to connect in to GPHUD and interact with characters and so forth.

See also Configuring an NPC guard for a more complex NPC example.

You require a copy of the Object Driver script, which can be retrieved by saying **Objects.GetDriver near a region server, or /1Objects.GetDriver if you have a HUD worn. You must have the permission Objects.GetDriver to make this call.

Firstly you must have permission Objects.Connect to connect an object to GPHUD. If this is revoked at any point your objects will start to fall out of service the next time they attempt to communicate with the server (which happens at least once every 15 minutes).

You place the Object Driver script inside the object you want interactable and let it boot. If all goes well you'll get a status dump about the objects, with no behaviour defined, e.g.:

[18:26:50] Object: Registered object#41
Name: Object
Owner: Iain Maltz[#1]
Character: null
Version: 30900
Behaviour: No behaviour is mapped

In the web site, under Configuration, Objects, you should see your newly connected object.

Below this you can “Create a new object type”, this is what defines the object's functionality, e.g. you can select “ClickTeleport” to create an object that teleports a player when clicked. Much deeper functionalities are available!

On the main Configuration, Objects page you can now click the drop down list under your object's “Object Type” and set the type do your newly created Object Type, this should take effect immediately.

If you are setting an object to be an NPC, or changing its character, it is advisable to reboot the object, manually in world, or via the web panel, otherwise it may take up to 15 minutes for some changes such as HUD text to take effect.

It is also possible to have the object automatically configure using the Description on the object, setting this to a JSON structure will pass data to the object driver on the back end server, currently only objecttype is processed which may be set like this: {“objecttype”:“Buff Wizard”} Note that NPC object types can not be used in more than one object at once as the secondary login of the character will replace the first and cause it to be shut down. All other types are multi-instantiable.

Some object types invoke a script, these have different variables prepopulated.

  • CALLER - The owning charcter for the script ; for non NPC types this is the interacting player, for NPC types this is the NPC character.
  • CALLERUUID - For /non-NPC/ types (RunScript/PhantomScript) this contains the Second Life UUID of the agent.. For NPC types this is unset.
  • CALLERDISTANCE - For click type objects this continas a Float distance to the avatar clicking on the object.
  • TARGET - For NPC object types, this is the player that invoked the interaction (while CALLER remains the NPC character). This is unset for non NPC types.
  • TARGETUUID - For NPC object types this is the Second Life UUID of the agent. This is unset for non NPC types.
  • OBJECTNAME - The name of the primitive in Second Life that is connected to this run - if you change the name of the prim you should reset the Object Driver script, or wait 15 minutes for it to register the new details.
  • OBJECTTYPE - The name of the object type invoked
  • OBJECTKEY - The UUID of the primitive connected to this invocation

Note that your object driver received when calling Objects.GetDriver is issues from your local region server ; if you require a newer version of an object driver script which wasn't sent out via a mandatory region server update then you should update your region server by calling Instance.GetServer, you will then be sent a new region server from a central repository, when you recieve this place it down on the ground and after starting up your old/existing region server should be shut down by the system and can be deleted.

You can then use Objects.GetDriver to get the new object driver script however this isn't necessary, a new object driver script version will slowly and automatically distribute its self to objects in your region ; if you are the objects owner you are likely to get messages informing you of such updates.