From c6f67ec01e1d1df1f4ddd87781bcb23f067477bc Mon Sep 17 00:00:00 2001 From: EvilFactory Date: Thu, 12 Jan 2023 23:39:14 -0300 Subject: [PATCH] Update intro.md --- luacs-docs/cs/intro.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/luacs-docs/cs/intro.md b/luacs-docs/cs/intro.md index c4aff1e68..20b21c464 100644 --- a/luacs-docs/cs/intro.md +++ b/luacs-docs/cs/intro.md @@ -2,25 +2,23 @@ ## Introduction -C# modding for Barotrauma is a subset of modding for **[Lua For Barotrauma](https://github.com/evilfactory/Barotrauma-lua-attempt)** mod, -that requires a mod package with the name `CsForBarotrauma` to be turned on (e.g. [steam workshop](https://steamcommunity.com/sharedfiles/filedetails/?id=2795927223)) +C# modding is part of the **[Lua For Barotrauma](https://github.com/evilfactory/Barotrauma-lua-attempt)** mod and requires the package `Cs For Barotrauma` to be turned on ([steam workshop](https://steamcommunity.com/sharedfiles/filedetails/?id=2795927223)), in some cases the package is not needed and a prompt in game will be shown to enable it automatically. This modding requires strict source structure, but comes with the benefits of being handled natively by game engine, witch removes many hurdles with type casting or similar issues. ## Starting a new mod -The main star of the show is Barotrauma::ACsMod class. It is what **all** your mods will use to hook game methods, and execute custom code. +The main star of the show is Barotrauma::ACsMod class. It is what most of your mods will use to hook game methods, and execute custom code. If you are planning on creating new components it's possible to just inherit from ItemComponent. ### Important features +- Mods have full access to Harmony to allow you to perform any patches you wish. - All utility classes can be accessed either by their type (i.e that have name that starts with `LuaCs...`) or through `GameMain.LuaCs` property (refer to [class documentation](#ltcd)). - All C# code files must be located in `/CSharp/*` otherwise they won't be compiled - To configure **server / client** execution behaviour create `RunConfig.xml` in `CSharp` directory, like is shown below (run types are `Standard`, `Forced` and `None`) - Additionally you can specify what code runs where by either ***filepath*** or ***pre-processor statements*** - In case of filepath, your files must be located in either `CSharp/Shared/*`, `CSharp/Server/*` or `CSharp/Client/*`, for *shared* code, *server-side* code or *client-side* code respectively (in any other case, the code is assumed to be shared) - I case of pre-processor, you can use `SERVER` or `CLIENT` definitions to separate code into *server-side* code and *client-side* code respectively -- In above case one must use `LuaCs...` classes to get access to system resources or similar things, if any -- If you want for your mod to inherently be turned on *client-side* when it is enabled, you must create a dummy `.xml` file. ### Code example