API or best practice to create an NPC?

Hi all, I am new to gather town. I am trying to create an office space for our company in which there will be an NPC “mascot” that people could talk to.
The NPC should:

  • have its own avatar
  • be able to make http post requests to remote server (our company’s server) to fetch conversation responses.

Is there any APIs to support that? Or given the current APIs how do I hack around?

1 Like

Welcome to the forums! I can try and outline a few answers to your question:

  1. NPCs: Currently, NPCs come in 2 ‘flavors’, (1) an API generated player with no A/V connection or (2) an object with an NPC image which contains some interaction. Both of these options allow you to set the NPC to look like any other player.

  2. Conversations: This is probably where things will get tricky. Currently, there is no way to have an NPC ‘speak’. You may have seen the subtitles the NPCs had in the Escape the Island game, but that is restricted to that game only. Additionally, even if the subtitle feature worked, changes to the subtitles would impact all users equally, meaning every user interacting with the NPC would see the responses from everyone else’s questions. This would get very confusing.

I would suggest you look into the second type of NPC, the object dressed up as an avatar. You could embed a website into the ‘avatar’, and have that direct to a chatbot style interface. Because this external website would be accessed via iframe, each user would have their own instance of it, avoiding the cross-talk issue mentioned above. You would have to design and host the website yourself, or find a provider external to Gather, but it also would not require the API to keep up and running, just some Web Dev.

Obviously, this is just one solution. There is a chat feature in Gather that could try and be harnessed, but that gets a little complex since they deprecated Global Chat.

2 Likes

Thanks Bill!
I will look into the “object dressed up as an avatar” route! :slight_smile: