Queen's Brothel API

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

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!

Examples

Short examples with code can be found on the github page

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

      (function () {
          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 3 files. A config file, a loadpack.json file, and your .js file. Assets are optional, they must be zipped and named 'assets.zip'

  • config.json
  • loadpack.json
  • myMod.js
  • [assets.zip]

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 assets.zip file. Make sure the url matches the location of the image relative to the directory.

Zip all of your files and then try importing your mod into the game.

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 loadpack.json 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.