last update: 10th of July, 2017
Table of Contents
- Table of Contents
- Introduction
- What is tModLoader?
- Help
- Useful locations and paths
- Frequently asked questions (FAQ)
- Text-Editors and IDEs
- Text-editors
- IDEs
- Info (includes other useful guides/tutorials and mod specific wikis)
Introduction
Hello and welcome to the tModLoader's official help thread! This thread was made to take some strain off the original thread, and is just an alternative place to get help. Also this place will house links to helpful guides and tutorials, as well as snippets of code with explanation, resources.. and so forth.
Back to top
What is tModLoader?
tModLoader is like an API such as the old tConfig and discontinued tAPI. It is literally a mod to make mods. As a developer, you might already know that the Terraria src (source-code) is difficult to deal with for a modder. tModLoader aims to make it far easier for you to create your mod, as well as share your mod for others to use. Traditionally, stand-alone mods are created. An upside to this way of modding is that you can literally do whatever you want to without being limited to an API's possibilities. A downside is that stand-alone mods usually aren't compatible with each other, as well as the developer(s) needing to know the Terraria source-code.
You can find all tModLoader methods, fields and properties in the official documentation which is on GitHub. (the new and improved documentation is here) Two other really useful sites are tConfig wikipedia or the tAPI documentation. These sites are outdated but still contain a lot of useful information. If you need help immediately, I suggest you join our Discord Channel. We're currently closing in to the 5000 members mark. There are always people around to help you!
Back to top
Useful locations and paths
Below you can find folder locations which mind come in handy when using tModLoader. Only default paths are listed.
XNA .dll location / files
If you're on windows, navigate to C:\Windows\Microsoft.NET\assembly\GAC_32\
You can find the folders for the XNA framework in there. Alternatively, you could paste this search string in the path bar:
Code:
search-ms:displayname=Search%20Results%20in%20GAC_32&crumb=filename%3A~<Microsoft.XNA%20OR%20System.Generic.String%3AMicrosoft.XNA&crumb=fileextension%3A~<Microsoft.XNA*.dll%20filename%3A~<Microsoft.XNA*.dll%20OR%20System.Generic.String%3AMicrosoft.XNA*.dll&crumb=location:C%3A%5CWindows%5CMicrosoft.NET%5Cassembly%5CGAC_32
COPY these files, you should not move them or cut + paste.
Default Terraria location
Here the main files of Terraria are stored. These locations are default locations chosen during the installation of the Terraria game.
Mac: Library/Application Support/Steam/steamapps/common/Terraria/Terraria.app/Contents/MacOS
Linux: .local/share/Steam/steamapps/common/Terraria
Windows: C:\Program Files (x86)\Steam\steamapps\common\Terraria
GoG Terraria location
Here the main files of Terraria are stored. These locations are default locations chosen during the installation of the Terraria game.
Mac: ??
Linux: ??
Windows: C:\GOG Games\Terraria
Default Terraria documents location
Mac: /Users/account/Library/Application Support/Terraria
Linux: ~/.local/share/Terraria OR $XDG_DATA_HOME/Terraria
Windows: %UserProfile%\Documents\My Games\Terraria
Default tModLoader documents location
Mac: /Users/account/Library/Application Support/Terraria/ModLoader
Linux: ~/.local/share/Terraria/ModLoader OR $XDG_DATA_HOME/Terraria/ModLoader
Windows: %UserProfile%\Documents\My Games\Terraria\ModLoader
Default tModLoader mods' src folder
Here the sourcecode of mods are stored in their own folders. Usually you won't have this and is only available for the particular mods' developer(s).
Mac: /Users/account/Library/Application Support/Terraria/ModLoader/Mod Sources
Linux: ~/.local/share/Terraria/ModLoader/Mod Sources OR $XDG_DATA_HOME/Terraria/ModLoader/Mod Sources
Windows: %UserProfile%\Documents\My Games\Terraria\ModLoader\Mod Sources
Default tModLoader 'mods' folder
Here, .tmod and .enabled files are stored. These files literally store the contents of a mod and if the mod is enabled in-game.
Mac: /Users/account/Library/Application Support/Terraria/ModLoader/Mods
Linux: ~/.local/share/Terraria/ModLoader/Mods OR $XDG_DATA_HOME/Terraria/ModLoader/Mods
Windows: %UserProfile%\Documents\My Games\Terraria\ModLoader\Mods
Back to top
Frequently Asked Questions (FAQ)
Remember you should ALWAYS show us the error(s) you've received when asking for help. Without showing us errors or code, we literally cannot help you with your troubles. For actual How-To's/Guides, visit my next post in this thread.
"Why did I lose all my characters and worlds upon installation of tModLoader?"
"How do I make characters and worlds for tModLoader?"
tModLoader uses its own folders for storing worlds and characters. This makes sure your vanilla files are nicely seperated from tModLoader modded files. tModLoader worlds aren't compatible with vanilla anyway, vanilla worlds are compatible with tModLoader though. Navigate to the main Terraria documents path, which you can find above, and copy your vanilla world files and character files into the ModLoader/Worlds and ModLoader/Players paths.
"Can I copy my old json code to work with tModLoader?"
No, as of yet json is not supported and tModLoader solely uses c#.
"What is the autoload property in tModLoader?"
The autoload property, found in the SetModInfo() method, is a property which will automatically load your mods' files. If you do not set AutoLoad to true you'll need to load your files manually in the Load() method.
"How do I even install tModLoader?"
tModLoader comes packaged in a .zip file, which you can unzip using an unzipper such as WinRAR. All you need to do is navigate to the default Terraria location, which you can find above, make a backup of your origional files and copy the contents of the .zip file. Let the files overwrite when asked.
"How can I revert to vanilla Terraria?"
You should've made a backup of all files you had to replace when installing tModLoader. These include, but are not limited to: FNA.dll, MP3Sharp.dll, Terraria.exe
If you have, restore these files. If you haven't, you can delete these files and have Steam verify the integrity of game cache. (this'll redownload the vanilla files)
You should now have vanilla Terraria again.
"Which text-editor or IDE should I use?"
I've created a special section below for text-editors and IDE choices.
"Why are people reporting my mod doesn't work in multiplayer?"
This is likely due to your mod having some code that isn't optimized for multiplayer. This can be quite a difficult thing to do.
In case your users get errors, have them post them to your thread as well as the tML thread.
(please keep in mind tML is WIP, so MP is WIP too!)
"What is all the fuzz about converting to tile positions?"
A nice clear explanation by @Eldrazi:
"How can I create X thing? (your own item, npc, projectile etc.)"
Before you ask any questions, you should take a close look at the ExampleMod first. This mod contains almost everything that's possible, but of course the possibilities aren't limited to this mod's contents. Remember that you should create your files using the c# (c-sharp) language.
"Why can't I build / rebuild mods on Mac/Linux?"
If you want to build mods on mac/linux, you'll need to compile the dll file outside of tModLoader, then set precompile to true in build.txt
"Why are chests suddenly missing items?"
This should be fixed by now.
"How does the 'velocity' system work in Terraria?"
Go below to the 'Snippets' part, and look for a snippet on this subject.
Back to top
Text-Editors and IDEs
Are you having trouble choosing your text-editor and/or IDE? Look no further!
I also have a
tutorial on how to setup your mod in Microsoft Visual Studio!
Text-editors
- Sublime text
- Notepad
- Major improvement to the regular notepad. Has features such as syntax highlighting, printing and mass replacement (with regex support)
- http://notepad-plus-plus.org/
- Vim
- Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as "vi" with most UNIX systems and with Apple OS X.
- http://www.vim.org/
- Atom
- Atom is a text editor that's modern, approachable, yet hackable to the core—a tool you can customize to do anything but also use productively without ever touching a config file. Created by Github.
- https://atom.io/
- Brackets
- With focused visual tools and preprocessor support, Brackets is a modern text editor that makes it easy to design in the browser. It's crafted from the ground up for web designers and front-end developers. So, this editor is mostly for web developers, but could still be used for modding too if you like it enough.
- http://brackets.io/
- Visual Studio Code
- Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications. Made by Microsoft. This editor is like a light-weight version of Visual Studio: you can even debug your code with it!
- https://code.visualstudio.com/
IDEs (Integraded Development Environment)
Visual Studio:
https://www.visualstudio.com
Tutorial on setting up Visual Studio:
http://forums.terraria.org/index.ph...et-up-your-mod-using-visual-studio-mvs.26476/
Back to top
tModLoader developers: @bluemagic123, @jopojelly, @Chicken Bones, and I (@Jofairden)
Set up your tModLoader mod in MVS: (C# tutorials at the bottom) http://forums.terraria.org/index.ph...et-up-your-mod-using-visual-studio-mvs.26476/
Of course, thanks Re-Logic for creating Terraria, and thanks @bluemagic123 for creating tModLoader.
Useful sites, guides, tutorials.. and so forth
Sites
Guides/Tutorials
Utilities/Other
External Mod Wikis
Some popular mods have their own wikis. Use the links below to find information about them:
Here is a list of other useful mod specific pages hosted on the Terraria mods wiki.
Back to top