added note to docs

This commit is contained in:
Evil Factory
2022-07-04 12:22:35 -03:00
parent aaa27229cf
commit 4b917625c0

View File

@@ -9,6 +9,7 @@ When the server finishes loading everything, Lua For Barotrauma starts up and re
When creating a new Lua mod, you will need to create a new folder on the **LocalMods** folder, then inside this folder you will need to create a folder called **Lua**, and then inside the Lua folder you create a folder called **Autorun**, inside this folder you can add your Lua scripts that will be executed automatically, it will look something like this `LocalMods/MyMod/Lua/Autorun/test.lua`, remember that your mod will only work if it's a valid xml mod that has a filelist.xml. If you use ForcedAurorun, the mod executes even if it's disabled.
Now you can open **test.lua** in your favorite text editor (<a href="https://code.visualstudio.com/" target="_blank">VSCode</a> with the <a href="https://marketplace.visualstudio.com/items?itemName=sumneko.lua" target="_blank">Lua Sumneko extension</a> recommended) and type in **print("Hello, world")**, now start the server by hosting a game or running the server executable manually, you will see in your console a text appear with the text that you entered in print, you can now type in the server console `reloadlua`, this will re-execute all the Lua scripts. You can also type in `lua yourscript` to run a short lua snippet, like this `lua print('Hello, world')`, remember to remove double quotes, because Barotrauma console automatically formats those.
**Note: When you host a server via the in game menus, you won't be able to see the first server debug prints, because the server will print those before your client joins the server.**
## Including other files