lethalterminalextender
A modding utility for Lethal Company that allows mods to add their own custom commands to the ship terminal.
截圖 共 1 張
模組介紹 作者原文
Lethal TerminalExtender
A modding utility for Lethal Company that allows mods to add their own custom commands to the ship terminal.
Some Notes
- Mod is entirely client side and does not attempt to handle any networking logic, this should be handled by your mod instead.
- A custom interaction mode can be enabled that will temporarily disable the default terminal commands.
Todo
- Need to consolidate harmony patches into a single class.
- Add an event/callback for when user begins/ends interaction with terminal.
Getting Started
Download the current built.dll file in the releases and include it as a refrence in your local mod project. When packaging your mode, be sure to either include it (local play) or include it as a dependency (mod manager).
Once included in your project, inside your mod you can run the following to add a custom command.
TerminalExtenderUtils.addQuickCommand("helloworld", "Hello World!", true, (Terminal term, TerminalNode node) =>
{
// a callback that is called when the command is ran
});
If you need/want to define your own keyword, node, and compatible nouns, you can add a command this way as well.
TerminalNode nodeObject = ScriptableObject.CreateInstance();
nodeObject.clearPreviousText = true;
nodeObject.terminalEvent = "helloWorldEvent";
nodeObject.displayText = "Hello world!";
TerminalKeyword keywordObject = ScriptableObject.CreateInstance();
keywordObject.word = "helloworld";
keywordObject.specialKeywordResult = nodeObject;
Action callbackAction = (term, node) =>
{
// run some function here
//
//
// or if you want to take over the terminal completely for custom applications
TerminalExtenderUtils.setOnSubmit((string command) =>
{
// command will be the next raw text command that is submitted
// you can call various helper methods such as
// toggle terminal input state
TerminalExtenderUtils.setInputState(true);
// clear terminal screen
TerminalExtenderUtils.cleanTerminalScreen();
// write to terminal
TerminalExtenderUtils.writeToTerminal("Hello again, you typed in: " + command + "\n");
// play audio
TerminalExtenderUtils.playAudioClip(0);
// instead of writing, you can send a node
TerminalExtenderUtils.displayNodeOnTerminal(nodeObject);
// we are done with custom input, handle the terminal over to the game
TerminalExtenderUtils.releaseOnSubmit();
// in a real world use case, you would not run all of these at once.
// they are just here to display what can be done
});
};
TerminalExtenderUtils.addCustomCommand(new TerminalCustomCommand()
{
keyword = keywordObject,
node = nodeObject,
callback = callbackAction
});
External Dependencies Used
- BepinEX
- Harmony 2
- LethalAPI.GamesLib
- Can also be downloaded from NuGet
New to Lethal Company Modding?
Check out this Lethal Company Modding Wiki which has some good resources on how modding the game works, and even guides to add multiplayer to your mod.
License
Feel free to fork, submit pull requests, or use this mod in any way shape or form as long as you include the LICENSE file which is above in the repo. The source uses the open source MIT License.
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: