# mad\_goon

## Link

{% embed url="<http://github.com/ThatMadCap/mad_goon>" %}

***

## Introduction

**Talk to your disturbingly affectionate AI assistant. They understand you. They compliment you. They watch you sleep.**

💦 **mad\_goon** lets players interact with the Prix Luxury AI Concierge voices from GTA Online's *Safehouse in the Hills* DLC. Type something, and Angel (or Haviland, or OG) responds with semantic matching voice lines - fully offline, no external APIs.

{% hint style="info" %}
Please goon responsibly 💦
{% endhint %}

***

### Preview

{% embed url="<https://youtu.be/tGrN4xZw3c4?si=V1Npm4p9CTDG3P5A>" %}

<div><figure><img src="/files/Y23bZugFjBgxG8NijL1Q" alt=""><figcaption></figcaption></figure> <figure><img src="/files/QgimmbzYM7w8miOLFNav" alt=""><figcaption></figcaption></figure> <figure><img src="/files/LWHJsu4qfOqlSzmOSnJV" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="/files/7Fa5J5oBiULG6jBmcLYS" alt=""><figcaption></figcaption></figure> <figure><img src="/files/YkD33sWaeCc6zCXbp5OZ" alt=""><figcaption></figcaption></figure> <figure><img src="/files/oFhROeGmqcdI7R9kVQCO" alt=""><figcaption></figcaption></figure></div>

***

### Philosophy

mad\_goon was built as an exploration into headless, local semantic interpretation; the kind of language processing that existed before large-scale AI services became the default solution.

While modern AI APIs can solve this problem more effectively, they also introduce external dependencies, ongoing costs, latency, and privacy considerations. This project deliberately avoids those trade-offs by remaining entirely offline and self-contained. The goal is not to compete with modern AI, but to understand and apply classical NLP techniques in a practical, game-focused context.

It's what was cool before ChatGPT made everyone forget that maths could do this too.

***

### How it works

1. Player sends a message (e.g. `"hey what's up"`)
2. Text is tokenised and vectorised using **TF-IDF**
3. **Cosine similarity** matches input against a topic corpus
4. Weighted scoring selects the best voice bucket
5. Native ambient speech plays the response

***

### Features

* **Semantic Matching** - Uses natural language processing to understand player input and selects a fitting response
* **Fully Offline** - No external API calls, no cloud dependencies
* **Context-Aware** - Time of day and player state influence responses
* **Networked Sounds** - Audio playback is synced to nearby players
* **Gendered Addressals** - Auto-detects ped gender, with manual override
* **Multiple Personas** - Switch between Angel, Haviland, and OG
* **Dynamic Objects** - Easily add interactive objects that auto-updates models when changing AI characters
* **Customisable Themes** - Theme system for colours and icons across UIs
* **Developer API** - Exports for integration with other resources
* **Logging** - Player messages and identifiers can be logged to Discord

***

### Interaction Methods

Interact with the AI in various ways:

| Method       | Requirements                                           |
| ------------ | ------------------------------------------------------ |
| **Target**   | [ox\_target](https://github.com/communityox/ox_target) |
| **Menu**     | [ox\_lib](https://github.com/CommunityOx/ox_lib)       |
| **Commands** | Built-in                                               |

All methods allow you to:

* Send a message and get a response
* Select the AI persona to use
* Select your preferred addressal
* Get a random message from your AI

***

### Commands

| Command      | Description                      | Arguments                   |
| ------------ | -------------------------------- | --------------------------- |
| `/ai_talk`   | Talk to the AI                   | `message`                   |
| `/ai_select` | Choose persona                   | `angel` / `haviland` / `og` |
| `/ai_callme` | Set addressal                    | `male` / `female`           |
| /`ai_menu`   | Open the  AI menu                |                             |
| `/ai_random` | Play a random speech from the AI |                             |

***

## Dependencies

* [ox\_lib](https://github.com/CommunityOx/ox_lib)
* Game Build **3717+**
* *Optional:* [*ox\_target*](https://github.com/communityox/ox_target)

***

## Developer API

View the [developer documentation](/docs/free-resources/mad_goon/developer-documentation.md) for usage, exports, and integration guides.

***

## Speech Reference Spreadsheet

You can find a comprehensive spreadsheet of all Prix Luxury AI Concierge speeches in the docs directory.

Each speech entry includes:

* Base ID
* Suffix ID
* Unique ID
* Gender
* Transcript

View Online: [Google Sheets - Prix Luxury AI Concierge Speeches](https://docs.google.com/spreadsheets/d/1_y0VREgGMlOub51DZfK3kfHQZNCjcbSYcWHBuyD7Z5o/edit?usp=sharing)

{% embed url="<https://docs.google.com/spreadsheets/d/1_y0VREgGMlOub51DZfK3kfHQZNCjcbSYcWHBuyD7Z5o/edit?usp=sharing>" %}

***

## Debug

Debug prints utilise [ox\_lib prints](https://coxdocs.dev/ox_lib/Modules/Print/Shared). To enable, enter in your console:

```
set ox:printlevel debug
```

Replace `debug` with your [desired print level](https://coxdocs.dev/ox_lib/Modules/Print/Shared#levels).

***

## Locale

Set your language in your `server.cfg`:

```
setr ox:locale en
```

Replace `en` with your desired language. Refer to [ISO 639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) language codes.

***

## Bridge System

The resource uses a modular bridge system for compatibility:

* **Notification Bridge**: [ox\_lib](https://github.com/CommunityOx/ox_lib), [qb-core](https://github.com/qbcore-framework/qb-core), [mad-thoughts](https://madcap-scripts.tebex.io/package/mad-thoughts), custom
* **Target Bridge:** [ox\_target](https://github.com/communityox/ox_target), custom
* **Menu Bridge:** [ox\_lib](https://github.com/CommunityOx/ox_lib), custom

All bridges auto-detect and load the appropriate implementation based on the active resources on your server. The notification and menu resources to use can be set in the client config. The bridge system is designed for easy expansion - custom bridges can be added to support other resources as needed.

***

## Support

Check out other unique scripts on my Tebex, show your ❤️ by buying me a Ko-Fi, or join my Discord server for support:

[![Visit Tebex Store](https://img.shields.io/badge/Tebex-Visit%20Store-24b47e?style=for-the-badge\&logo=fivem\&logoColor=white)](https://madcap-scripts.tebex.io) [![Support me on Ko-fi](https://img.shields.io/badge/Ko--fi-Support%20Me-ff5e5b?style=for-the-badge\&logo=ko-fi\&logoColor=white)](https://ko-fi.com/madcap) [![Join Discord](https://img.shields.io/badge/Discord-Join%20Server-5865F2?style=for-the-badge\&logo=discord\&logoColor=white)](https://discord.gg/dTNWpmPGyc)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://madcap.gitbook.io/docs/free-resources/mad_goon.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
