Chat Commands
Adds a console command system and various helpful admin/ utility commands
模組介紹 作者原文
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
安裝與使用 安裝:按包內說明操作
- 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
- 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
- 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
- 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。
不同模組的安裝位置差異較大,包內說明是最可靠的依據。
下面這些內容需要先安裝,否則該模組不會生效: