Standalone [1.3] tModLoader - A Modding API

Also, im trying to make a weapon that every 5 projectile hits spawns a flamethrower. I have made a seperate variable in which I use to keep track of how many projectile hits. The script compiles without issue, but it just isnt working in-game
Copyright holders don't police for violations such as mods all that stringently. Once they are made aware of such content though, they will move to take it down. By US copyright laws they have to or they risk losing the IP to public domain. It doesn't matter if it's a mod. It doesn't matter if no one is making money from it. All that matters is if you are using their intellectual property.
Not exactly.

There are three different kinds of intellectual properties: copyright, trademark, and patent. Copyright is automatically granted at creation, and lasts for a long, long time. For a personal creation, it's 70 years after the author's death; for a corporate creation it's 120 years after creation or 95 years after publication. Once copyright expires, a work falls in the public domain; however because of the very long time it lasts, do not expect to see anything created in your lifetime to ever become public domain. No video game will ever become public domain by expiration of their copyright term while most of us are alive. However, it is possible for a copyright holder to voluntarily release something in the public domain, or to make it available under a permissive license (e.g. Creative Content stuff).

Trademark is what you can lose if you do not defend it. While copyright concerns a creative work, the trademark concerns "product identity", that is to say, basically branding. Contrarily to copyright, trademark is not automatic, you need to declare it to the concerned authorities and describe precisely the elements that make up your trademark (titles, logos, mascot characters, special glyphs, etc.) and you also need to define in what domain your trademark applies (e.g., a "Terraria" brand of fertilizers would not infringe on Re-Logic's trademark because it wouldn't be a video game). A recent example of trademark dispute in video game is Voidpoint and 3D Realms getting sued by Iron Maiden (yeah, the band) over their game Ion Maiden (note the lack of 'r'), as they find the title far too close. Notice that here, there is no copyright infringement involved, nobody is accusing Ion Maiden of containing Iron Maiden content, they're accusing it of having a name and some other superficial elements that could cause Iron Maiden fans to believe it's an official Iron Maiden game.
Last edited:
Please use the code tags so that we keep the formatting. Code displayed as normal text, without preserving the whitespace, is hard to read.

Your problem is that your SetupShop() function is not properly closed, so it "eats" the next few functions (TownNPCAttackStrength, TownNPCAttackCooldown, etc.). You open one brace for the function's content, then you open another brace for the if (spirit != null) conditions, and then you have a loooong list of vanilla items you add (well over 40, so you'll need a shop extender if you want all 84 items I've counted to be actually available, in vanilla merchants have only 40 shop slots, you may want to address that), and then you close one brace, but not two.

Also this looks very wrong to me:

I'm not a C# coder, but I'm familiar enough with a lot of other C-family language (C, C++, Java, JavaScript, Perl, and a few more obscure scripting languages) and from that experience I'm pretty sure your thing cannot work.

If you don't use curly braces after an if () condition, only the next instruction is run. That means that if you don't have, for example, Thorium loaded, then thorium is null, so the next instruction (which is Mod calamity = ModLoader.GetMod("CalamityMod")) isn't run, so when you check calamity it'll be null too even if Calamity is loaded. Worst case, the calamity variable will not even exist and you'll get a crash.

You should instead do something like
Mod thorium = ModLoader.GetMod("ThoriumMod");
Mod calamity = ModLoader.GetMod("CalamityMod");
Mod tremor = ModLoader.GetMod("Tremor");
Mod spirit = ModLoader.GetMod("SpiritMod");
No condition checks there. Keep your condition checks only for when you're going to actually reference them. The way you've got that shop set up, the merchant will sell vanilla items if all four mods are loaded, and nothing if any mod is missing. I haven't actually seen any of your mod references being used.

Another thing, not a bug but still worth addressing is this:
       public override string TownNPCName()
           switch (WorldGen.genRand.Next(4))
           case 0:
               return "Kimi";
           case 1:
               return "Kimi";
           case 2:
               return "Kimi";
               return "Kimi";
If you're just gonna use Kimi as your NPC name, why bother making it random?
       public override string TownNPCName()
           return "Kimi";
That's all you need.

Sorry. i wasn't on sooner. i already fixed it before reading this. sorry i didn't reply sooner.
I have been having trouble downloading running terraria with tmodloader, after running into the issue when installing the mods and click continue, it closes the game and opens up a wall of text. Has anyone else had the same problem, and if so, how did you deal with it?
So i was playing with a friend for a while, about 20 hours into our run we started running into an issue where any modded items thrown out of our inventories to eachother would despawn after about half of a second of airtime. In addition my friend cannot get loot bags from any bosses anymore. Not sure exactly what is going on here, some help would be greatly appreciated. Current mods, ignore the disabled part. Mods1.PNG Mods2.PNG
[doublepost=1562015849,1562015439][/doublepost]Nevermind, disregard. Friend made a new character and it solved the problem.
Hey so I've been having this issue where every time I open terraria with Tmodloader installed, the RELOGIC opening screen comes up, but then black... like nothing loads after that and I get the rainbow pinwheel of death (Im on a mac). Every 20th try the game actually loads, so its very frustrating trying to run this game. Any tips? Heres the line from the crash report in the client-crashlog.txt file in the MacOS folder.

7/2/2019 1:43:14 PM
System.TypeLoadException: Failure has occurred while loading a type.
at Terraria.Social.Steam.CoreSocialModule.Initialize () [0x00039] in <a17cf97a937a4fd393af9e423789daaf>:0
at Terraria.Social.SocialAPI.Initialize (System.Nullable`1[T] mode) [0x00053] in <a17cf97a937a4fd393af9e423789daaf>:0
at Terraria.Program.LaunchGame (System.String[] args, System.Boolean monoArgs) [0x000e2] in <a17cf97a937a4fd393af9e423789daaf>:0
Hi guys. I'm trying to make a custom difficulty mod but i'm having a lots of problems coding. The idea is very simple: I just want to drop all my MainInventory (not hotbar and items equipped) when I die.

This is the pseudo-code that I tried to code with TModLoader but my programming skills are so bad
If (Main.Normalmode) {
    If (player.die) {
    for (i=1; i=40; i++) {
Anyone could help me??

Thanks and sorry for my bad English
I need help. So I installed this since I just got the game, it worked at first, I started downloading a few mods then all of a sudden it crashed. But when I went to go back on the game it kept me in a black screen. So I deleted this tmodloader and all the game files, then I shutdown my computer reloaded and installed and download this and the game. But now it keeps putting me in a black screen and I tried everything. PLEASE help!

Side note: the game works when the tmodloader is not installed
Please, help me. So in Github I saw Tmodloader 0.11.1v realese... so I downloaded it and I put all the files into the folder, where my terraria is installed. But when I try to run Tmodloader Terraria it not even giving me any problem, it's not even running... how can I solve this problem?.
Also in older Tmodloader version there were folder called "Modcompile" but in new one it's separately from Tmodloader.
Lol, how did you installed that? I had so much problems with installation
I haven't yet. I'm still running v0.10.1.5. As most mods are still built on that.
I did install the x64-bit version as well, but that required installing a fresh version of Terraria and putting the x64-bit the normal Terraria folder. with the x64 Package as well.
It was all in the readme file.
Top Bottom