Queen's Brothel API

Everything you need to create your own mods for Queen's Brothel.

Mods made by DPMaker

I am not responsible for any problems caused by mods not made by me. Do not run scripts made by people you do not trust!

Here is a list of mods made by the creator of the game:

  1. Peasant Fetish - Adds one quest and 2 sex scenes with the peasant from Avia.

Get Started

You are going to need a way to host the game on a server using the given html file.

I recommend a node server using http-server.

  1. Download the source version of the game from Patreon.
  2. Create your own .js file and put it into the js folder of the game.
  3. Open the index.html file and add your js file at the bottom.
    • <script src="js/YOUR_FILE.js"></script>
  4. Add this to your .js file to see if it is working properly

       let myMod = new Mod("myMod");
    
       myMod.boot = function () {
           this.dialogue.talk("Queen", "Hello world!");
       }
  5. Launch your browser and go to your web server. If Queen says "Hello World" when you start the game then everything is working properly!

Exporting your mod

Mods require 2 files. A config file and your mod's .js file.

Make sure you don't create global variables in your .js file!

The config file should look like this.
Any assets you need should be in the .zip file as well, make sure the url matches the location of the image relative to the directory.

Zip all of your files, make sure the config.json is in the root of the folder and then try importing your mod into the game. If everything works fine then you should be good!

Tutorials

Finding asset keys and importing your own for debugging

If your mod requires assets, you can import them directly into the game while you create the mod and then create the asset array later once you are done.

  1. Open the json folder inside the game directory
  2. Open the loadpack.json file
  3. Use this file as a template to add your own assets. The asset config object doesn't require a "type" variable, but Phaser does. If you are lazy, you don't have to delete it once you export your mod. The mod loader automatically sets the "type" to "image".
  4. If you want to overwrite an asset make sure you find the texture key and replace the url with your url. There is no easy way to find an asset's texture key. Just find the file inside the game's asset folder and then go find it in loadpack.json.
  5. Your assets should be loaded when you start the game.

Adding and playing your own dialogue

Adding dialogue is very easy. Dialogue functions are always called with the DialogueManager scope.

let myMod = new Mod("myMod");

myMod.boot = function () {
    this.dialogue.addDialogue('myDialogue', async function (resolve) {
        await this.talk("Queen", "I will be called first.");
        await this.talk("Suki", "I will be called second.");
        resolve();
    }
}

DialogueManager.talk returns a promise. The cleanest way to write dialogues is to use an async function just like in the example. Make sure your function has the resolve parameter.

myMod.dialogue.playDialogue('myDialogue').then(() =>{
    console.log("Dialogue done!");
});

Use DialogueManager.playDialogue to play your new dialogue function. Make sure you see the "Dialogue done!" in the console after the dialogue is done, otherwise you forgot to add resolve().