Shield Documentation
  • Project Black Ops 4
  • USEFUL INFOMATION
    • Road Map & Features
    • Client Features
    • Useful Links
    • Faq
    • Troubleshooting
  • LAUNCHER GUIDE
    • How To Play
    • Things to Know
    • How To Install
    • How to add game folder exception in Windows Defender
    • Playing Offline
    • Playing Online
    • Connecting To A Server
  • PLAYING ONLINE
    • How To Connect With Friends
    • Commands To Start Games
  • SERVER SETUP
    • How To Set Up The Server
    • How To Run The Server
    • Server Webpanel Instructions
    • Private Match / Server Faq
    • Radmin VPN Guide
  • MODDING
    • Getting Started With Modding
    • Lua
    • Extra Modding Notes
    • How To Install Mods
    • Released Mods
Powered by GitBook
On this page
  • Supported Types
  • Setting Up Folder For Mods
  • Creating "metadata.json"
  • Scripts
  • String tables
  • Commands
  1. MODDING

Getting Started With Modding

Modding guide.

Supported Types

For now it supports these types:

  • scriptparsetree - scripts (.gsc/.csc/.gsic/.csic) for replacement and auto linking

  • rawfile - raw file

  • luafile - compiled Lua HKS (only replacement)

  • stringtable - csv file (.csv)


Setting Up Folder For Mods

Create a directory in the Black Ops 4 install project-bo4/mods


Creating "metadata.json"

Create a directory with a json file metadata.json in it.

For example project-bo4\mods\demo_mod\metadata.json.

The format of this json is:

{
    "name": "Demo mod",
    "data": [
        {
            "type": "asset type",
            "name": "path in game",
            "path": "path from the mod dir or absolute"
        }
    ]
}

More configs are available in the script config.


Scripts

It is possible to load script file with the support of GSIC file, a custom format from the T8-Compiler to replace script functions from the game.

To inject a script, 2 ways are possible, to replace an already existing one or to inject a new one. To tell the game when an injected script should be loaded, a hook script config is available. When a hook script is loaded, the injected script will be loaded.

The hooks of a script are defined with the "hooks": [ "hook.gsc" ] config. For example the script demo.gsc loaded when the script zm_common/load.gsc is loaded.

{
    "name": "Demo mod",
    "data": [
        {
            "type": "scriptparsetree",
            "name": "scripts/shield/demo.gsc",
            "path": "compiled.gsic",
            "hooks": [
                "scripts/zm_common/load.gsc"
            ]
        }
    ]
}

String tables

To create custom table, I've made a code to load the CSV with the first line used to tell the type of the columns. These types are:

  • string

  • int

  • hash

  • float

  • undefined (gsc)

For example with all the available types:

string,int,hash,bool,float,undefined
aaa,123,ar_accurate_t8,true,6.7,
bbb,456,hash_123456789,false,13.823,
ccc,789,ar_accurate_t8,true,12.6,

Commands

reload_mods for the console to reload at runtime the mods, it only works if the user is in the UI level to avoid reloading scripts in game.

PreviousRadmin VPN GuideNextLua

Last updated 12 months ago

The game is using "compiled" csv files, these files have the cell values compiled instead of storing the string values. For example with , the table to tell the weapon loaded by a map, the weapon names are hashes.

zm_mansion_weapons.csv