Chat Commands
Adds a console command system and various helpful admin/ utility commands
About this mod Author’s original text
Chat Commands
This mod adds a command system to the chat, with syntax similar to that of the console in source games.
What does the mod do?
This mod is mostly intended to be a library mod for other mod developers to add their own commands as an easy
to implement way to run code in their mods. However, I have included a few builtin commands! Some features of
them you might find helpful include:
- Spawning any weapon while in exploration mode
- Ignoring players, hiding their chat messages from you
- Banning players from your lobbies, instantly kicking them if they join
- Changing a few settings like brightness, fov or sensitivity without opening the settings menu ~ and setting them to exact
values instead of using a slider
- Binding any command or sequence of commands to a key or the mousewheel
Quickstart for people who can't be bothered to read below
/help to see a list of available commands (here are some useful ones)
- /weapon or /w to spawn in a weapon in exploration mode
- /prop or /p to spawn in a prop (barrels, etc.) in exploration mode
- /fov to set your fov
- /sensitivity to set your sensitivity
- /ignore to hide a player's chat messages from you
Syntax and basic guide to commands
To begin a command, enter a slash (/) into chat. you can also hit the slash key and the chat box will open with
a slash already in it. After the slash, enter the command name, then the command's parameters seperated by
spaces.
To view a list of all commands currently registered, run the command help (or its alias h). if you want to
see help text for a particular command, or a particular category of commands, enter the command name or category
name as a parameter after the command name.
If you want to enter something with spaces in it as a parameter, e.g. a sentence, surround the parameter with
quotation marks (" or ') to create a string (a sequence of
characters). If you want to enter another string inside a string, you can either use the type of quotation mark you did not use for the outer string, or enter a
backslash (\\) before quotation marks you use inside the string.
Some commands may have optional parameters. These parameters have a default value that will be chosen if you
do not enter a value for them. Optional parameters will always appear at the end of a command's parameter list.
You can run multiple commands in one go by separating them with a semicolon (;). You can also take the output of
a command and directly append it to the parameters of the following command by putting a pipe (|) after the first
command. This allows for many complicated and advanced setups, for example `gamma | add 0.5 | gamma | concat
'gamma: ' | echo. This command will get the current brightness setting (gamma` with no parameters), send it
to add as the second parameter, adding 0.5 to the value, send the value back to gamma as a parameter, setting
the brightness to the value, then send the new brightness value to concat as the second parameter, joining it to
the string 'gamma: ', and finally send the output of that to echo, printing the result. Altogether, this results
in the brightness setting being incremented by 0.5 and some handy feedback being sent in the chat to show the new
value. I personally have this command bound to a key, as well as one that reduces the brightness by 0.5 (i'll leave
that one to you to figure out:3), as a handy way to quickly change brightness while in a game.
For any further help, you can find me @sneaky_kestrel in the #modding channel in the official straftat discord!
For mod developers~ getting started
- Download the zip page, take out ChatCommands.dll, put it somewhere safe and then add
a reference to it in your project.
- Add a [BepInDependency(ChatCommands.PluginInfo.PLUGIN_GUID)] attribute to your main plugin class
- If you are planning to upload your mod, add the package's dependency string, which can be found page, to your manifest.json.
- Call CommandRe
Install & use Install: follow the bundled instructions
- Unzip the archive from playbuff and read the bundled readme / instructions first.
- Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
- For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
- Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.
Install locations vary a lot between mods — the bundled readme is the most reliable guide.
Install these first, or the mod will not work: