Details

Last Updated
last week
First Uploaded
last week
Downloads
83K
Likes
5
Size
60KB
Dependency string
JacobG5-ReservedJsonSlots-1.2.0
Dependants

Reserved Json Slots

This mod allows users to easily add item slots for whatever they want in their game using JSON files.

Everyone in the lobby has to have the SAME .json files.

How To Set Up

If you're familiar with .json formatting this should be pretty easy to set up on your own.

On the first launch, it will generate an example reserved tool belt slot.

Go to BepinEx/config/JsonReservedSlots

In that folder, you will find UtilityBeltSlot.json and PlayerBones.txt

JSON Formatting

After the first launch the mod should generate UtilityBeltSlot.json

You can open this file and use it as an example for building your own utility slots.

reservedSlotName is the name of your slot. Proper formatting should be all lowercase and underscores with no spaces.

slotPriority is used by ReservedItemSlotCore to determine the position of your item slot on the side of the screen relative to other item slots. Negative numbers are used to place slots on the left side of the screen instead of the right. Make sure your config for ReservedItemSlotCore is set up correctly.

purchasePrice is the price of buying the slot from the terminal if you have buying slots enabled in ReservedItemSlotCore enabled. When the price is set to 0 it will automatically be unlocked even if buying slots is enabled.

itemsForSlot is an array of all the items the player can put inside your slot.

The only thing each item in itemsForSlot requires is itemName. itemName is case-sensitive and should be the name of an in-game item. You can add as many of these as you'd like.

If you want to get more advanced you can also give each item in itemsForSlot a bone, position, and rotation value. If you set the bone to anything other than 0 it will show the item cosmetically on the player's body.

requiredMods is a list of strings you can use to define BepinEx Plugin GUIDs. As long as one of the mods listed in this field are loaded the slot will be registered. If none of the mods are present the slot will not be registered.

Keybinds Formatting

There are two keybinds you can add to your reserved slot: useKeybind && equipKeybind

equipKeybind is a keybind to hold the item in that slot.

useKeybind is a keybind to trigger the item in your custom slot's use rpc. This allows you to interact with an item without even holding it. Because some items may not account correctly for being triggered while not held by a player, and this mod does not include any patches for any items, it may not work with all items. You can feel free to experiment and see if it works with items you want to play with but if it ultimately does not work then don't be suprised. I will not be making patches for any items in this mod.

A keybind is defined as an object with 3 properties: defaultBind, toggle & repocket

defaultBind sets the default key on the keybaord to trigger this action. When left empty will register the keybind as unbound. You manually will have to bind a key in the in game menu.

toggle determines if you have to hold down the button for it to remain active or if it should toggle on/off each time you press it.

repocket only applies to useKeybind and when set to true will send the pocket item rpc immediantly after triggering the use item rpc. This can serve as a way to reset an item to realize it is pocketed after using it. I recomend having this turned off for most items but if you notice weird behavior you can try turning this on and seeing if it fixes it.

PlayerBones

When the config folder is generated you should find PlayerBones.txt inside.

This text file contains the IDs of every player bone. You can use this to set what bone items are attached to to make them visible on the player's body. If you set it to 0, the id for None, or if you don't include a bone, it will not show the item on the player's body.

As of v1.2.0 you can now just type the name of bones as listed in the PlayerBones.txt file. The IDs also work for legacy reasons. This file is still useful to view valid names for player bones.

REMINDER:

This mod only looks for .json files located inside the BepInEx/config/JsonReservedSlots folder. If your .json files are not in this folder then they WILL NOT be registered in game.

ReservedItemSlotCore

This mod uses ReservedItemSlotCore by FlipMods

You should totally check out their other mods because they make some great stuff.

Examples:

Here is an example of a reserved Key slot:

{
  "reservedSlotName": "key_slot",
  "slotPriority": -100,
  "purchasePrice": 0,
  "itemsForSlot": [
    {
      "itemName": "Key"
    }
  ]
}

Here is an example of Reserved Flashlight Slot in JSON format:

{
  "reservedSlotName": "flashlight",
  "slotPriority": 200,
  "purchasePrice": 200,
  "itemsForSlot": [
    {
      "itemName": "Flashlight",
      "bone": 4,
      "position": {
        "x": 0.2,
        "y": 0.25,
        "z": 0.0
      },
      "rotation": {
        "x": 90.0,
        "y": 0.0,
        "z": 0.0
      }
    },
    {
      "itemName": "Pro-flashlight",
      "bone": 4,
      "position": {
        "x": 0.2,
        "y": 0.25,
        "z": 0.0
      },
      "rotation": {
        "x": 90.0,
        "y": 0.0,
        "z": 0.0
      }
    },
    {
      "itemName": "Laser pointer",
      "bone": 4,
      "position": {
        "x": 0.2,
        "y": 0.25,
        "z": 0.0
      },
      "rotation": {
        "x": 90.0,
        "y": 0.0,
        "z": 0.0
      }
    }
  ],
  "useKeybind": {
    "defaultBind": "f",
    "toggle": true,
    "repocket":  true
  }
}

Here is an example of Reserved Walkie Slot in JSON format:

{
  "reservedSlotName": "walkie_talkie",
  "slotPriority": 150,
  "purchasePrice": 150,
  "itemsForSlot": [
    {
      "itemName": "Walkie-talkie",
      "bone": 4,
      "position": {
        "x": 0.15,
        "y": -0.05,
        "z": 0.25
      },
      "rotation": {
        "x": 0.0,
        "y": -90.0,
        "z": 100.0
      }
    }
  ],
  "useKeybind": {
    "defaultBind": "r",
    "toggle": false
  },
  "equipKeybind": {
    "toggle": false
  }
}
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.