tModLoader

tModLoader

Nedostatek hodnocení
How to Create a Dedicated tModLoader Server with Pterodactyl Panel
Vytvořil: DuoDuos
This is a guide on how to create a dedicated tModLoader server with the Pterodactyl panel.
This guide does NOT EXPLAIN how to make a node and connect it to your server.
4
   
Ocenit
Přidat do oblíbených
Oblíbeno
Odebrat z oblíbených
Making the server, nest and egg
Beginning

Once you have logged into your panel, you will need to create a new server. This can only be done if you are an administrator. Click on the gear icon in the top right corner to go into admin mode. Before creating your server, you first must create a Terraria nest and a tModLoader egg. Simply click on the Nests on the left side of the screen.You will then need to create a new nest by clicking on Create New on the right side of the screen. The name simply does not matter, but I recommend calling the nest Terraria and the egg tModLoader to avoid confusion.
Once the nest has been created, it is time to make the egg. You will need to download a json file for this, which I will leave a link to download here.{ODKAZ SMAZÁN}
Once you have downloaded the egg, you will need to go back to the nest list and click on Import Egg.
https://steamcommunity.com/sharedfiles/editguidesubsection/?id=2282203631&sectionid=3991500#
Select the json file you just downloaded for the egg file, and put it in the Terraria nest you created.

Congrats! You have created your egg. You will now need to create your server.

Server Creation

Head back to the administration part of the panel, and click on Servers. Click on Create New in the top right corner.
Now you will need to configure the server you made. The most important parts of this are:
Server Name
Server Owner
Disk Space
Memory
Nest
Egg
Startup Command

Simply name the server whatever you want. Descriptions can be nice to have to provide info. The server owner is needed. Set the server owner to your account. Uncheck the start server when installed box, as we will need to add changes later.Set the node to which node you will be using for the server. Ports will not matter for now, as we will change them later. The part you will want to focus on is Resource Management. In memory, you will need to put the amount of MBs of RAM you will want the server to run on. I use 2 GBs ideally, or 2048 MBs. It's probably the best bet for a small modded server, and we kind of use the maximum of mods. Even if your server can run a lot of mods, a lot of computers cannot, and eventually run out of memory if there are too many mods. Each GB of RAM = 1024 MBs of RAM.
Disk space is storage, and RAM is for running processes. Usually the disk space is more than the amount of RAM. I like taking the MB's of RAM and multiplying it to get the amount of disk space I want to use, or just using the same amount of MBs for both. Disk space and memory have no relation, but usually it helps get the amount of disk space you need, because more memory is used for more mods, so you usually need more disk space as well. CPU Limit is pretty easy to get. Just multiply your amount of PHYSICAL cores on the node you are using by 100, and that will be the value in CPU limit. CPU limit is not needed, and the server works fine without it, so it is pretty optional. Set the nest to Terraria, and the egg to tModLoader. Datapacks are not needed. Do not check the "Skip Egg Install Script". This is where it gets to the startup and settings. Startup commands are very important, as this will guide the server on how it will run. We will come back to them later. For now, focus on the service variables. No question, the tModLoader version should always be latest. In max players, you can set how many players can join your server at a time. 8 is probably the best, but I recommend 4 or 5 for small playthroughs with your friends. Github Tokens and users are nothing to worry about. The world file name is very important. IF you are moving over to a dedicated server and used to use files or Host & Play, you will need to transfer your world over. If you do need to transfer it, head to the World Transfering Section. If you are starting a new world, stay here. To start a new world, you will first need to create that world. Go into tModLoader (the game) and create a new world, however you want. Once it is done creating, close the game and head back to the panel. The world file name will need to be the name of the world you created. For example, if the world you created was called SquirrelLand, the file name in the panel will need to be set to SquirrelLand. The world size variable should be completely ignored, as it does not have any effect on this. We will now need to do some configuration that requires the server to be made. Click on Create Server, and head back to the home panel and click on the server you created. IT IS NOT READY TO BE STARTED YET.

We will now need to install tModLoader on the server entirely. Go to tModLoader Linux Download[github.com] and download tModLoader.Linux.v0.11.7.7.tar.gz. Once this is downloaded, you will need to go to your server, file manager, and import the file into the main directory. Once this is done, you will need to right click it inside of the file manager, and click decompress, or unzip. This will create a bunch of files inside of the file manager. This is completely normal. Now, the server is basically done. But, it will need a bit of tweaking before it can work.





Server Configuration and Startup Commands
Startup Commands

Startup Commands are a very important part of the server. It will change how the server will startup, select worlds, and more. The most simple startup command is literally ./tModLoaderServer. This brings up the same thing you get when running tModLoaderServer.bat, but it is very buggy in the console, so this is not recommended.

You can configure where you would like it to get your mods and worlds from, but if you put it in the wrong folder/directory, it won't see any, so you need to make sure it is configured to the same directory the mods and worlds are in. My recommended place to put your mods and worlds is:
/.local/share/Terraria/ModLoader
And then add /Mods or /Worlds at the end depending on either one. Here are startup commands for those directories:

Load a certain world:
./tModLoaderServer -ip 0.0.0.0 -port ${SERVER_PORT} -maxplayers ${MAX_PLAYERS} -world ~/.local/share/Terraria/ModLoader/Worlds/${WORLD_NAME}.wld -savedirectory ~/-tmlsavedirectory ~/.local/share/Terraria/ModLoader/Worlds -modpath ~/.local/share/Terraria/ModLoader/Mods

This startup command loads mods and worlds from /.local/share/Terraria/ModLoader/
Remember that you will need to set the world file name in the startup configuration to the same name of the world file you are using, minus the .wld.

REMEMBER: THE 0.0.0.0 IP IS NEEDED. DO NOT SET IT TO YOUR REAL IP OR ANYTHING ELSE. IT WILL USE YOUR LOCALHOST.

0.0.0.0 = your ip

THE {WORLD_NAME}, {SERVER_PORT} IS NEEDED. DO NOT PUT YOUR WORLD NAMES, SERVER PORTS, IN PLACE OF THESE. THEY ARE NOT USED FOR PLACEMARKS.


Default Startup Command: This is not a recommended startup command, as it is buggy as well.It creates a server, but autocreates another world, which is annoying.
./tModLoaderServer -ip 0.0.0.0 -port ${SERVER_PORT} -maxplayers ${MAX_PLAYERS} -world ~/saves/Worlds/${WORLD_NAME}.wld -worldname ${WORLD_NAME} -autocreate ${WORLD_SIZE} -savedirectory ~/ -tmlsavedirectory ~/saves -modpath ~/mods

Make-A-Startup-Command:
./tModLoaderServer : Is needed at the beginning of every single startup command, and brings up the default console
-ip : Sets the ip, and only your ip
-port sets the port. the port should be 7777
-maxplayers Sets max players
-world loads a world with the directory afterwards
-autocreate automatically creates a world for you
- savedirectory the save directory
-modpath the directory for the server to load mods from

I literally know nothing really about making startup commands, try looking at the default one for detail on how to make your own. What I have noticed so far is that $ needs to be before every variable, and ~ is some continuation of a command.

Variables:
{SERVER_PORT} Server port, configured in build configuration
{MAX_PLAYERS} Max players allowed in at once, configured in startup
{WORLD_NAME} The name of the world file (just the file name, no extension) that the server will try to load
{WORLD_SIZE} World size, only for -autocreate and configured in startup. 1 = small 2 = medium 3 = large

After this basically the only thing you need to do is change the port and transfer worlds or mods.
Go to the other sections for info on this.

Port stuff
Now, you will need to change the port to be 7777. This is very easy.
First of all, you need to make sure that your IP was allocated in the node that you are using for the server. There will also be a port along with it. Once this is done, you will need to go to build configuration, and go to Allocation Management. In assign additional ports, select your ip with the port 7777 afterwards. In the remove additional ports, enter in the same one that is in Game Port. Press update build configuration. That's pretty much it for the port stuff.
Transferring Worlds and Mods
This is now where we get to transferring mods and worlds. The world transfer is only if you used to have a server on something else, files, or host & play.

World Transferring

World Transferring is straightforward. Simply upload your world files to whatever directory your world path will be in.

To find where your world files are, you will need to go into some files.

For transferring regular Terraria Worlds: Documents\My Games\Terraria\Worlds
For transferring Steam tModLoader Worlds: (the most used one) Documents\My Games\Terraria\ModLoader\Worlds

The path that your mods will load from in the server can be determined by the startup command. If you are just doing ./tModLoaderServer, you will need to put them in /saves/Worlds. If you are loading a certain world, you can determine this by the area of the -world command in the SC. For example, here: -world ~/.local/share/Terraria/ModLoader/Worlds/${WORLD_NAME}.wld

We see that the directory for them is in /.local/share/Terraria/ModLoader/Worlds/, we put our world file in there. Remember that directories can be configured, so you can change them in the SC too. Remember that in the startup configuration, the "World Name" is the name of the world file that you are putting in the world path, minus the extension, for example, the file name is tRodLoader, so you change it to tRodLoader. Remember that this must be a .wld file, not a .twld file. Remember to also transfer the .bak copy of it too. After this is done, the server is ready to go! Well, after you complete the stuff in the previous sections and transfer your mods.

Mod Transferring

This is literally world transferring, but you put the mods in the directory after -modpath in the startup commands. If you are using just ./tModLoaderServer, you will need to put your mods inside of the mods folder in the home directory. If you have -modpath in your SC, then put your mods inside of the folder in front of it. For example: -modpath ~/.local/share/Terraria/ModLoader/Mods is at the end of the SC. So, I put them inside of /.local/share/Terraria/ModLoader/Mods.

Remember that the mod files are .tmod

The place to find your mods on the computer is Documents\My Games\Terraria\ModLoader\Mods
Issues & Questions
Now that you have completed your server, it is ready to go! But, there might be some issues.

Issues: Stuck on connecting to IP:PORT

This can either be because your mods are not updated. Simply go into the mod browser, and update your mods. Re-transfer them into the mod path on your server.

This can also be port issues, like the certificate being expired or the wrong port or IP being used.

If you have any questions or other issues, please leave them down in the comments, and I will try to help as soon as possible.
Počet komentářů: 10
Digglebert 26. bře. v 21.01 
This is very different with workshop, and unfortunately that's probably the most annoying part.
SUS 26. pro. 2024 v 4.48 
./start-tModLoaderServer.sh: Permission denied
DuoDuos  [autor] 19. úno. 2021 v 13.32 
your welcome @TMG, im glad it helped
TMG 13. úno. 2021 v 3.36 
Thank you so much for the start command, its so stupid that you dont have a default config file where you set up all that stuff.
DuoDuos  [autor] 15. pro. 2020 v 10.10 
@Tobi good for you
Diet_Letice 27. lis. 2020 v 18.08 
instructions unclear: made node and connected it to server
Comethazine 27. lis. 2020 v 10.10 
this makes my peepee no work
cyclonefa262 24. lis. 2020 v 1.40 
my name is mname
Tikal 22. lis. 2020 v 10.46 
Pterodactyls? I love dinosaurs!
DuoDuos  [autor] 20. lis. 2020 v 11.47 
omg tysm for awards