tModloader
tModLoader is essentially a mod that provides a way to load your own mods without having to work directly with Terraria's source code itself. This means you can easily make mods that are compatible with other people's mods, save yourself the trouble of having to decompile and recompile Terraria.exe, and escape from having to understand all of the obscure "intricacies" of Terraria's source code. It is made to work for Terraria 1.3+.
Ports
Add an allocation on the node for each port.
- Game 7777
Install
- Installer image
- ghcr.io/ptero-eggs/installers:debian
- Install script
- 80 lines
Images
New servers use the first image. Users can change it on the Startup page.
- Dotnet 8 default ghcr.io/ptero-eggs/yolks:dotnet_8
- Dotnet 6 ghcr.io/ptero-eggs/yolks:dotnet_6
Startup
The Panel runs this command to start the server. It replaces each variable in the command with the value of that variable.
10 variables
Startup command
./tModLoaderServer -ip 0.0.0.0 -port 7777 -maxplayers 8 -password "{{SERVER_PASSWORD}}" -motd "Please don’t cut the purple trees!" -lang 1 -world ~/saves/Worlds/world.wld -worldname world -autocreate 1 -config serverconfig.txt -savedirectory ~/ -tmlsavedirectory ~/saves -modpath ~/modsDotted values come from the server settings. These values are examples.
The name for the world file.
WORLD_NAMEUsers can edit
required|string|max:20
The maximum number of players a server will hold.
MAX_PLAYERSUsers can see
required|numeric|digits_between:1,3
Defines the worlds size. 3 sizes 1 (small), 2 (medium), 3 (large).
WORLD_SIZEUsers can edit
required|string|in:1,2,3
The version of tModloader that is to be used.
VERSIONUsers can edit
required|string|max:20
GitHub user to use for api calls. This only needs to be set if you hit the GitHub API too often across multiple servers.
GITHUB_USERUsers cannot see
string|nullable
This can be either an OAuth or a Personal Access Token. This is required for the install is you set a user.
GITHUB_OAUTH_TOKENUsers cannot see
string|nullable
Sets the difficulty of the world when using auto-create. Options: 0(normal), 1(expert), 2(master), 3(journey)
DIFFICULTYUsers can edit
required|string|in:0,1,2,3
Server password for users to connect to your server. Can be empty for no password.
SERVER_PASSWORDUsers can edit
nullable|string|max:20
Message of the Day for the server
MOTDUsers can edit
required|string|max:40
Sets the server language 1:English, 2:German, 3:Italian, 4:French, 5:Spanish
LANGUAGEUsers can edit
required|string|in:1,2,3,4,5
Wings
- Stop command
- exit
- Running when the console shows
- Type 'help' for a list of commands
Files Wings edits
Wings sets these values in these files before each start.
serverconfig.txt file
- difficulty
- difficulty={{server.build.env.DIFFICULTY}}
Readme
tModLoader
From their GitHub
tModLoader is essentially a mod that provides a way to load your own mods without having to work directly with Terraria's source code itself. This means you can easily make mods that are compatible with other people's mods, save yourself the trouble of having to decompile and recompile Terraria.exe, and escape from having to understand all of the obscure "intricacies" of Terraria's source code. It is made to work for Terraria 1.3+.
Install notes
Due to rate limiting the console on the panel cannot keep up with the game console and the build will complete before the panel console may show it. Reloading the console will load it to the latest part of the log.
Minimum RAM warning
You may want to assign a minimum of 768 mb of RAM to a server as it will use around 650 mb to generate the world on the first start.
Server Ports
tModloader, like Terraria, only requires a single port to run. The default is 7777
| Port | default |
|---|---|
| Game | 7777 |
Plugins may require ports to be added to the server.
Extra Information
If you want to download mods in the console, the startup command has to be changed.
New startup:
./tModLoaderServer -ip 0.0.0.0 -port ${SERVER_PORT} -maxplayers ${MAX_PLAYERS} -savedirectory ~/ -tmlsavedirectory ~/saves -modpath ~/mods
This will remove the autocreate function, and will thus allow you to download mods and generate world. Afterwards, you can change it back with the correct world name to start automatic. Word name is set in the configuration panel.
Problem with this egg?
Open an issue on GitHub. Include your Panel and Wings versions.
Install script 80 lines bash in ghcr.io/ptero-eggs/installers:debian Show Hide
#!/bin/bash
# Vanilla tModloader Installation Script
#
# Server Files: /mnt/server
## install packages to get version and download links
apt update
apt install -y file
if [ -z "$GITHUB_USER" ] && [ -z "$GITHUB_OAUTH_TOKEN" ] ; then
echo -e "using anon api call"
else
echo -e "user and oauth token set"
alias curl='curl -u $GITHUB_USER:$GITHUB_OAUTH_TOKEN '
fi
## get release info and download links
LATEST_JSON=$(curl --silent "https://api.github.com/repos/tmodloader/tmodloader/releases" | jq -c '.[]' | head -1)
RELEASES=$(curl --silent "https://api.github.com/repos/tmodloader/tmodloader/releases" | jq '.[]')
if [ -z "$VERSION" ] || [ "$VERSION" == "latest" ]; then
echo -e "defaulting to latest release"
DOWNLOAD_LINK=$(echo $LATEST_JSON | jq .assets | jq -r .[].browser_download_url | grep -i tmodloader.zip)
else
VERSION_CHECK=$(echo $RELEASES | jq -r --arg VERSION "$VERSION" '. | select(.tag_name==$VERSION) | .tag_name')
if [ "$VERSION" == "$VERSION_CHECK" ]; then
if [[ "$VERSION" == v0* ]]; then
DOWNLOAD_LINK=$(echo $RELEASES | jq -r --arg VERSION "$VERSION" '. | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i linux | grep -i zip)
else
DOWNLOAD_LINK=$(echo $RELEASES | jq -r --arg VERSION "$VERSION" '. | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i tmodloader.zip)
fi
else
echo -e "defaulting to latest release"
DOWNLOAD_LINK=$(echo $LATEST_JSON | jq .assets | jq -r .[].browser_download_url | grep -i tmodloader.zip)
fi
fi
## mkdir and cd to /mnt/server/
mkdir -p /mnt/server
cd /mnt/server || exit 5
## download release
echo -e "running: curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*/}"
curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*/}
FILETYPE=$(file -F ',' ${DOWNLOAD_LINK##*/} | cut -d',' -f2 | cut -d' ' -f2)
if [ "$FILETYPE" == "gzip" ]; then
tar xzvf ${DOWNLOAD_LINK##*/}
elif [ "$FILETYPE" == "Zip" ]; then
unzip -o ${DOWNLOAD_LINK##*/}
else
echo -e "unknown filetype. Exiting"
exit 2
fi
if [[ "$VERSION" == v0* ]]; then
chmod +x tModLoaderServer.bin.x86_64
chmod +x tModLoaderServer
else
#tiny startup script for backward compatibility
echo 'dotnet tModLoader.dll -server "$@"' > tModLoaderServer
chmod +x tModLoaderServer
fi
echo -e "Cleaning up extra files."
rm -rf terraria-server-*.zip rm ${DOWNLOAD_LINK##*/}
if [[ "$VERSION" != v0* ]]; then
rm -rf DedicatedServerUtils LaunchUtils PlatformVariantLibs tModPorter RecentGitHubCommits.txt *.bat *.sh
fi
## using config for difficulty as the startup parameter does not work -> config parser
mv /mnt/server/serverconfig.txt /mnt/server/config.txt
sed 's/#difficulty/difficulty/' /mnt/server/config.txt > /mnt/server/serverconfig.txt
rm /mnt/server/config.txt
## install end
echo "-----------------------------------------"
echo "Installation completed..."
echo "-----------------------------------------"