Standalone [1.3] tModLoader - A Modding API

I need help. Everytime i try to install tModloader it says that it is not able to find Terraria.exe. I reinstalled Terraria like 10 times and also reseted my PC but it is still the same. Can someone help?
 
When i create a New World, what i do to fix?
Try deleting Runtime Error.txt in My Games/Terraria/ModLoader/Logs.
I need help. Everytime i try to install tModloader it says that it is not able to find Terraria.exe. I reinstalled Terraria like 10 times and also reseted my PC but it is still the same. Can someone help?
Do you have a Steam or a GOG version of Terraria? And are you using the correct tModLoader executable for that version?

If you are, please make a screenshot of your install directory.
 
WHY MR TREE MOD IS NOT WORKING? there is the crash repor- wait how i print screen?
[doublepost=1503060087,1503060010][/doublepost]ok here is the crash
Uma exceção foi acionada pelo destino de uma chamada.
em System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
em System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
em System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
em System.Activator.CreateInstance(Type type, Boolean nonPublic)
em System.Activator.CreateInstance(Type type)
em Terraria.ModLoader.Mod.AutoloadItem(Type type)
em Terraria.ModLoader.Mod.Autoload()
em Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

Inner Exception:
Referência de objeto não definida para uma instância de um objeto.
em MrTreeMod.Items.BaumMask..ctor()
[doublepost=1503060145][/doublepost]sorry for the portuguese my computer automatically choosed portuguese by idk
 
Mod Development Guide for OSX/Linux
(or How to Build Your Mod Without Using tModLoader)
Introduction
Building a mod in a non-Windows operating system can be a bit difficult, since there is a lack of access to Visual Studio (on Linux; VS is now available for OSX, though none of the instructions below have changed) and tModLoader is unable to build the mod files itself. However, it is possible, and it's actually not all that hard. I will be using the Xamarin IDE (now replaced by VS on OSX, and MonoDevelop on Linux). Here's the steps:

1. Install Visual Studio (if on OSX) or Monodevelop (on Linux).
2. You're going to need a .csproj file. Copy the one from ExampleMod into your mod's root directory.
NOTE: All steps from 3 to 7 can be ignored if you use one of the pre-made .csproj XMLs in the attachments. Instructions on how to use them are included below.
3. Open the .csproj file in any text editor. You're gonna need to change a couple things. Specifically:
3a. Find the AssemblyName tag and change the value from "ExampleMod" to whatever your mod's name is (this is the name of the root folder).
3b. Go down to the end of the file and delete the line within the last PropertyGroup (the one that says "PostBuild" or whatever).
4. For convenience, rename this .csproj "Windows". Duplicate it and make another called "Mono".
5. Open the Windows.csproj in Xamarin, and expand the References "folder". Several Microsoft.Xna.* references and a Terraria reference should be missing.
6. Remove these references. Right-click on References and click Edit References. Go over to the .NET Assembly tab and click Browse. Now select all the .dll files and the .exe that came in the ModCompile folder of your non-Windows tModLoader download. Make sure the boxes of these new references are checked in the Edit References window, and click OK.
6b. If you aren't building ExampleMod, you'll probably notice many ExampleMod files that don't exist in your project. Go ahead and remove them at this time.
7. Do the same thing in the Mono .csproj file. However, this time, you're targeting different files: FNA.dll and a non-Windows tModLoader Terraria.exe. You can get these from either a non-Windows tModLoader Terraria installation or from the ModCompile folder in a Windows tModLoader download (the Terraria reference is tModLoaderMac.exe).
8. Build both .csproj files (click the 'Play' looking button on the top-left of the Xamarin window). I don't know if there's much of a difference between making a Debug and a Release build - for convenience, I just have Windows build as one type and Mono build as another.
9. If you've set everything up correctly, your mod builds should have succeeded. Go into the obj/release folder and the obj/debug folder. Take the ModName.dll files from each and rename them according to what built them (if you had Windows build to Debug, then rename the obj/debug file Windows.dll). Place these .dlls in the mod's root directory.
10. Open build.txt and add the line "noCompile = true" to the end of it.
11. Open Terraria and have tModLoader build your mod!
I hope this helps!

How to use the included .csproj files:
These files are pre-made .csproj files that have gone through the steps above and then some. TCF doesn't allow uploading files with the .csproj extension, so the .txt extension must be removed before use.
They should already have working sources, provided the .csproj is inside a folder in the Mod Sources directory. Sources are also set up to switch to the correct one depending on how you're building the project, so there's no need to have two separate projects for Mono and Windows builds.
The missing ReLogic dependencies ReLogic.dll and ReLogicLinux.dll can be downloaded from the tModLoader GitHub (found in the "references" folder) and placed into the ModCompile folder in your Terraria installation.

Additionally, they're already set up to automatically copy the built .dll files to the proper place when building, so you'll never have to manually move them yourself.
Build with both Mono and Windows settings to build both Mono.dll and Windows.dll!

_Blank files: These .csproj files don't contain any references to ExampleMod files and are perfect for starting a mod from scratch. They still contain build.txt and description.txt, which every mod should have anyway.
OSX/Linux files: Each version gets the sources from a slightly different location for the indicated operating system. Get the one that matches yours!

Don't forget that these files are still named ExampleMod both outside and inside, so be sure to change the assembly and root namespace name as you see fit!

A few notes:
-The mod's root folder must be located in Terraria/ModLoader/Mod Sources. You can access this folder from the Mod Sources option on the tModLoader main menu.
-If your mod is not referencing Microsoft.Xna.* in any way, then you don't need to do the double build: instead, just build one file and name it All.dll.
-tModLoader cannot build your mod if the AssemblyName does not match the name of the root folder.
-It's best to practice these steps by applying them to ExampleMod first, so that you know how it works. If you have issues building ExampleMod, check the steps again. If you're still having issues, contact me via Discord and I can put you in the right direction ;)
-Changing the RootNamespace option in your .csproj will change the default namespace that new .cs files are put into by the skeleton code.

-If you want your mod to be editable by non-Windows users, you can remove the exclusion of the .csproj file in build.txt. Others will then be able to open the .csproj after unpacking it with tModReader.

This is guide version 1.2. Changelog:
- 1.0: Initial release.
- 1.1: A bit more information, typo fixes.
- 1.2: More information, added template .csproj files

I'm on Linux and I wanted to get into modding. I called my mod "SpaceMod". During following your steps, I couldn't find "Postbuild", I only found two lines saying "afterbuild", but they aren't at the end of the file and removing them causes an error loading the mod into MonoDevelop. After that I tried to create a new mod without using the ExampleMod file, but the build fails. The error is "Error CS1704: An assembly with the same name `ReLogic' has already been imported. Consider removing one of the references or sign the assembly (CS1704) (SpaceMod)". Thats really strange, because I only downloaded the .dll files from Github and activated them in"references". What am I doing wrong?

All files are created correctly (SpaceMod.cs, build.txt, the "Items" folder with my first basic item + sprite) etc. etc..
 
Try deleting Runtime Error.txt in My Games/Terraria/ModLoader/Logs.

Do you have a Steam or a GOG version of Terraria? And are you using the correct tModLoader executable for that version?

If you are, please make a screenshot of your install directory.
I use Steam and I use the tModloader from this site.
 

Attachments

  • Unbenannt.png
    Unbenannt.png
    43.4 KB · Views: 272
Been away for a few months. Anyone know if the mannequin issue is resolved yet? The one where armor sets disappear when applied to mannequins (generally occurs when there are tons of mods installed which add lots of new armors to the game).
 
Been away for a few months. Anyone know if the mannequin issue is resolved yet? The one where armor sets disappear when applied to mannequins (generally occurs when there are tons of mods installed which add lots of new armors to the game).
Don't put mod items in mannequins, not a good idea.
 
Don't put mod items in mannequins, not a good idea.

While I can appreciate the sentiment, I'm more interested in learning about the progress made on this front.
If there is resilience, from the team, to figure this out that's fine.

What alternative display-methods would you suggest, to the mannequins? I'm sure I'm not the only person who likes to display their gear rather than cramming it all into chests.
 
While I can appreciate the sentiment, I'm more interested in learning about the progress made on this front.
If there is resilience, from the team, to figure this out that's fine.

What alternative display-methods would you suggest, to the mannequins? I'm sure I'm not the only person who likes to display their gear rather than cramming it all into chests.
I AGREE WITH U
 
Back
Top Bottom