Documentation

Get started with Scriptless

Everything you need to integrate intelligent NPCs into your game. Choose your platform and follow our step-by-step guides.

Quickstart Guide

1
Create an account
Sign up for a free Scriptless account to get your API key.
2
Build your NPC
Use the NPC Builder to configure your character's personality, occupation, and dialogue style.
3
Install the SDK
Add the Scriptless SDK to your Unity or Unreal project, or use the REST API directly.
4
Initialize the client
Create a new client instance with your API key.
5
Send messages
Call the chat method with your NPC ID and player input to get dynamic responses.
6
Display responses
Show the NPC's response in your game's dialogue UI.

SDK Installation

Unity
com.scriptless.sdk

Add via Package Manager using the git URL.

Unreal Engine
ScriptlessPlugin

Download from Marketplace or build from source.

REST API
api.scriptless.ai/v1

Use with any language or platform.

Code Examples

C# - Unity
using Scriptless;
using UnityEngine;

public class DialogueController : MonoBehaviour
{
    private NPCClient client;
    public string npcId = "uncle-marco";

    void Start()
    {
        // Initialize with your API key
        client = new NPCClient("YOUR_API_KEY");
    }

    public async void OnPlayerInteract(string playerInput)
    {
        try
        {
            // Send message to NPC and get response
            NPCResponse response = await client.Chat(
                npcId: npcId,
                message: playerInput,
                context: new { 
                    location = "garage",
                    timeOfDay = "morning"
                }
            );

            // Display the NPC's response
            dialogueUI.ShowMessage(response.content);
            
            // Optional: Handle emotion/animation data
            if (response.emotion != null)
            {
                npcAnimator.SetTrigger(response.emotion);
            }
        }
        catch (NPCException e)
        {
            Debug.LogError($"NPC Error: {e.Message}");
        }
    }
}

Use in Unity

This app provides a mock API at POST /api/v1/chat when deployed. In the NPC Builder you define the character and what they should know about the game, then Generate API Key. Paste the code below into Unity, set Base URL to your deployed app (e.g. https://your-app.vercel.app/api/v1) and API key from the Builder, then call the client from your NPC logic and use content / emotion however you like (no chat UI specified).

C# - Paste into Unity
// Paste this into a C# script in Unity. Set BaseUrl and ApiKey (from the NPC Builder),
// then call SendMessage from your NPC/interaction logic and use the returned content/emotion in your game.

using System;
using System.Collections;
using UnityEngine;
using UnityEngine.Networking;

[Serializable]
public class NPCChatResponse
{
    public string id;
    public string npc_id;
    public string content;
    public string emotion;
    public string action;
    public int tokens_used;
}

public class ScriptlessNPCClient : MonoBehaviour
{
    [Tooltip("API base URL, e.g. https://your-app.vercel.app/api/v1")]
    public string baseUrl = "https://your-app.vercel.app/api/v1";

    [Tooltip("API key from the NPC Builder")]
    public string apiKey = "YOUR_API_KEY";

    public void SendMessage(string npcId, string message, Action<NPCChatResponse> onSuccess, Action<string> onError)
    {
        if (string.IsNullOrEmpty(baseUrl) || string.IsNullOrEmpty(apiKey))
        {
            onError?.Invoke("BaseUrl and ApiKey must be set.");
            return;
        }
        StartCoroutine(SendMessageCoroutine(npcId, message, onSuccess, onError));
    }

    private IEnumerator SendMessageCoroutine(string npcId, string message, Action<NPCChatResponse> onSuccess, Action<string> onError)
    {
        string url = baseUrl.TrimEnd('/') + "/chat";
        string body = JsonUtility.ToJson(new ChatRequest { npc_id = npcId, message = message });
        using (UnityWebRequest req = new UnityWebRequest(url, "POST"))
        {
            req.uploadHandler = new UploadHandlerRaw(System.Text.Encoding.UTF8.GetBytes(body));
            req.downloadHandler = new DownloadHandlerBuffer();
            req.SetRequestHeader("Content-Type", "application/json");
            req.SetRequestHeader("Authorization", "Bearer " + apiKey);
            yield return req.SendWebRequest();
            if (req.result != UnityWebRequest.Result.Success)
            {
                onError?.Invoke(req.error + (req.downloadHandler?.text ?? ""));
                yield break;
            }
            try
            {
                NPCChatResponse response = JsonUtility.FromJson<NPCChatResponse>(req.downloadHandler.text);
                onSuccess?.Invoke(response);
            }
            catch (Exception e) { onError?.Invoke("Parse error: " + e.Message); }
        }
    }

    [Serializable] private struct ChatRequest { public string npc_id; public string message; }
}

API Reference

POST /v1/chat
Send a message to an NPC and receive a response

Request Body

npc_idstring, requiredThe unique identifier of the NPC
messagestring, requiredThe player's message to the NPC
contextobject, optionalAdditional context for the conversation
historyarray, optionalPrevious messages in the conversation

Response

contentstringThe NPC's response message
emotionstringDetected emotion for animation triggers
tokens_usedintegerNumber of tokens consumed