tModLoader Official tModLoader Help Thread

I have a few questions/comments for tModLoader:

1) Since last year I have been using a modified version of tModLoader 0.11.7.5 that will allow it to run my legitimate GOG.com copy of Terraria 1.3.5.3 on Windows 7. This has worked fine for me without any problems at all. I need to upgrade to a newer version of tModLoader because some of the mods I use require a newer version of tModLoader in order to be compatible with the mod updates. I have tested tModLoader 0.11.8.2 and it is not working. Here are the following log outputs for the working 0.11.7.5 and the not working 0.11.8.2. Has there been some new dependency for tModLoader in the updates after 0.11.7.5 that is required? What happens when I try to start the newer version of tModLoader now is that no window opens for the game and I see it in the task manager, but it never starts the game. I have tried reinstalling the game, moving the tModLoader folder, nothing seems to work. 0.11.7.5 works fine but 0.11.8.2 won't start the game. Please assist :(

[16:27:46] [1/INFO] [tML]: Starting tModLoader v0.11.7.5 Windows client (2/27/2021)
[16:27:46] [1/INFO] [tML]: Running on NetFramework 4.7.2
[16:27:46] [1/INFO] [tML]: Executable: C:\Games\Terraria\tModLoader\tModLoader.exe
[16:27:46] [1/INFO] [tML]: Working Directory: C:\Games\Terraria\tModLoader
[16:27:46] [1/INFO] [tML]: Launch Parameters:
[16:27:46] [1/DEBUG] [tML]: Assembly Resolve: -> MonoMod.RuntimeDetour, Version=20.5.14.1, Culture=neutral, PublicKeyToken=null
[16:27:46] [1/DEBUG] [tML]: Assembly Resolve: MonoMod.RuntimeDetour, Version=20.5.14.1, Culture=neutral, PublicKeyToken=null -> MonoMod.Utils, Version=20.5.14.1, Culture=neutral, PublicKeyToken=null
[16:27:46] [1/DEBUG] [tML]: Assembly Resolve: MonoMod.RuntimeDetour, Version=20.5.14.1, Culture=neutral, PublicKeyToken=null -> Mono.Cecil, Version=0.11.2.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e
[16:27:46] [1/DEBUG] [tML]: Assembly Resolve: -> Ionic.Zip.Reduced, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c
[16:27:46] [1/DEBUG] [tML]: Assembly Resolve: -> Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
[16:27:46] [1/INFO] [tML]: Checking GOG or manual installation...
[16:27:46] [1/INFO] [tML]: GOG or manual installation OK.
[16:27:46] [1/DEBUG] [tML]: Assembly Resolve: -> Steamworks.NET, Version=9.1.0.0, Culture=neutral, PublicKeyToken=null
[16:27:47] [1/DEBUG] [Terraria]: Graphics Device: Radeon (TM) RX 470 Graphics {Width:1920 Height:1080 Format:Color AspectRatio:1.777778}
[16:27:47] [1/DEBUG] [Terraria]: Device Reset, Profile: Reach -> HiDef, Width: 800, Height: 480, Fullscreen: False, Display: \\.\DISPLAY1
[16:27:48] [1/INFO] [Terraria]: Loaded 1000 vanilla assets
[16:27:48] [1/INFO] [Terraria]: Loaded 2000 vanilla assets
[16:27:48] [1/INFO] [Terraria]: Loaded 3000 vanilla assets
[16:27:48] [1/INFO] [Terraria]: Loaded 4000 vanilla assets
[16:27:48] [1/INFO] [Terraria]: Loaded 5000 vanilla assets
[16:27:49] [1/DEBUG] [Terraria]: Device Reset, Profile: HiDef, Width: 800 -> 1280, Height: 480 -> 720, Fullscreen: False -> True, Display: \\.\DISPLAY1
[16:27:50] [1/DEBUG] [Terraria]: Device Reset, Profile: HiDef, Width: 1280 -> 1920, Height: 720 -> 1080, Fullscreen: True, Display: \\.\DISPLAY1
[16:27:50] [6/WARN] [tML]: Silently Caught Exception:
System.EntryPointNotFoundException: Unable to find an entry point named 'EventSetInformation' in DLL 'advapi32.dll'.
at Microsoft.Win32.UnsafeNativeMethods.ManifestEtw.EventSetInformation(Int64 registrationHandle, EVENT_INFO_CLASS informationClass, Void* eventInformation, Int32 informationLength)
at System.Diagnostics.Tracing.EventProvider.SetInformation(EVENT_INFO_CLASS eventInfoClass, Void* data, Int32 dataSize)
at System.Diagnostics.Tracing.EventSource.Initialize(Guid eventSourceGuid, String eventSourceName, String[] traits)
at System.Diagnostics.Tracing.EventSource..ctor(EventSourceSettings settings, String[] traits)
at System.Linq.Parallel.PlinqEtwProvider..cctor()
at System.Linq.Parallel.QuerySettings.WithPerExecutionSettings(CancellationTokenSource topLevelCancellationTokenSource, Shared`1 topLevelDisposedFlag)
at System.Linq.Parallel.ForAllOperator`1.RunSynchronously()
at System.Linq.ParallelEnumerable.ForAll[TSource](ParallelQuery`1 source, Action`1 action)
at Terraria.Program.ForceJITOnAssembly(IEnumerable`1 types)
at Terraria.Program.ForceLoadAssembly(Assembly assembly, Boolean initializeStaticMembers)
at Terraria.Program.ForceLoadThread(Object ThreadContext)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

[16:27:52] [8/DEBUG] [tML]: Assembly Resolve: -> MP3Sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
[16:27:52] [8/DEBUG] [tML]: Assembly Resolve: -> NVorbis, Version=0.8.4.0, Culture=neutral, PublicKeyToken=null
[16:27:52] [8/DEBUG] [tML]: Assembly Resolve: -> Mono.Cecil.Mdb, Version=0.11.2.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e
[16:27:52] [8/DEBUG] [tML]: Assembly Resolve: -> Mono.Cecil.Pdb, Version=0.11.2.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e
[16:27:52] [6/INFO] [Terraria]: JIT loading finished
[16:27:54] [10/INFO] [tML]: Unloading mods
[16:27:55] [10/INFO] [tML]: Finding Mods...
[16:27:55] [10/INFO] [tML]: Sandboxing: ItemChecklist
[16:27:55] [10/INFO] [tML]: Sandboxing: SpiritMod
[16:27:55] [10/INFO] [tML]: Instantiating Mods...
[16:27:56] [10/INFO] [tML]: Initializing: ModLoader v0.11.7.5
[16:27:56] [10/INFO] [tML]: Initializing: ItemChecklist v0.5.2
[16:27:56] [10/INFO] [tML]: Initializing: SpiritMod v1.4.0.4
[16:27:58] [10/DEBUG] [tML]: Assembly Resolve: SpiritMod_0, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null -> TerrariaHooks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
[16:27:58] [10/DEBUG] [tML]: Assembly Resolve: TerrariaHooks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null -> MonoMod.RuntimeDetour, Version=19.12.19.1, Culture=neutral, PublicKeyToken=null
[16:27:58] [10/WARN] [tML]: Upgraded Reference MonoMod.RuntimeDetour -> Version=19.12.19.1 -> 20.5.14.1
[16:27:58] [10/DEBUG] [tML]: Hook On.Terraria.Main::DrawProjectiles() added by SpiritMod_0
[16:27:58] [10/DEBUG] [tML]: Hook On.Terraria.Projectile::NewProjectile(float, float, float, float, int, int, float, int, float, float) added by SpiritMod_0
[16:27:58] [10/DEBUG] [tML]: Hook On.Terraria.Player::KeyDoubleTap(int) added by SpiritMod_0
[16:27:58] [10/DEBUG] [tML]: Hook On.Terraria.Main::DrawDust() added by SpiritMod_0
[16:27:58] [10/INFO] [tML]: Setting up...
[16:27:58] [10/INFO] [tML]: Loading: ModLoader v0.11.7.5
[16:27:58] [10/INFO] [tML]: Loading: ItemChecklist v0.5.2
[16:27:59] [10/INFO] [tML]: Loading: SpiritMod v1.4.0.4
[16:27:59] [10/INFO] [tML]: Adding Recipes...

[20:04:08] [1/INFO] [tML]: Starting tModLoader v0.11.8.2 Windows client (3/30/2021)
[20:04:08] [1/INFO] [tML]: Running on NetFramework 4.7.2
[20:04:08] [1/INFO] [tML]: Executable: C:\Games\Terraria\tModLoader\tModLoader.exe
[20:04:08] [1/INFO] [tML]: Working Directory: C:\Games\Terraria\tModLoader
[20:04:08] [1/INFO] [tML]: Launch Parameters:
[20:04:08] [1/DEBUG] [tML]: Assembly Resolve: -> MonoMod.RuntimeDetour, Version=20.11.16.1, Culture=neutral, PublicKeyToken=null
[20:04:08] [1/DEBUG] [tML]: Assembly Resolve: MonoMod.RuntimeDetour, Version=20.11.16.1, Culture=neutral, PublicKeyToken=null -> MonoMod.Utils, Version=20.11.16.1, Culture=neutral, PublicKeyToken=null
[20:04:08] [1/DEBUG] [tML]: Assembly Resolve: MonoMod.RuntimeDetour, Version=20.11.16.1, Culture=neutral, PublicKeyToken=null -> Mono.Cecil, Version=0.11.3.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e
[20:04:09] [1/DEBUG] [tML]: Assembly Resolve: -> Ionic.Zip.Reduced, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c
[20:04:09] [1/DEBUG] [tML]: Assembly Resolve: -> Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
[20:04:09] [1/INFO] [tML]: Checking GOG or manual installation...
[20:04:09] [1/INFO] [tML]: GOG or manual installation OK.
[20:04:09] [1/DEBUG] [tML]: Assembly Resolve: -> Steamworks.NET, Version=9.1.0.0, Culture=neutral, PublicKeyToken=null
[20:04:10] [1/DEBUG] [Terraria]: Graphics Device: Radeon (TM) RX 470 Graphics {Width:1920 Height:1080 Format:Color AspectRatio:1.777778}
[20:04:10] [1/DEBUG] [Terraria]: Device Reset, Profile: Reach -> HiDef, Width: 800, Height: 480, Fullscreen: False, Display: \\.\DISPLAY1

2) I enjoy 1.3.5.3 and have personal preferences regarding the since changes to the game that I would like to continue using this version of the game alongside tModLoader instead of changing to 1.4 in the future. Will tModLoader continue to work with 1.3.5.3 after the 1.4 version finally arrives? I try to keep strict archives of my game versions and mods so if there is some legitimate technical reason why mods shouldn't be able to work with 1.3.5.3 after tModLoader 1.4 comes out, I suppose I will have to just stick with those versions of the mods. Unless there is some way to keep using Terraria 1.3.5.3, which would be preferable :)

3) Frankly speaking, putting DRM into a mod is incredibly hostile to legitimate users and for those without the technical skills to remove it, I feel quite bad for them, such as other GOG owners like me. tModLoader has NEVER worked for my legitimately owned copy of Terraria without the necessary hack to remove the unnecessary DRM. It would be something that would be very appreciated to have officially removed in future versions of tModLoader. DRM is the most anti-user piece of technology that has ever existed and only serves to hurt legitimate users. Food for thought.

DRM.png
 
Hey all, I'm making a town NPC and I have some animation bugs. I adapted animations of my NPC to the guide's animations but something weird happens when the NPC is walking or doing emotes.

Video
animation frames:
I don't have alt textures, maybe that causes the problem?
 
Hey all, I'm making a town NPC and I have some animation bugs. I adapted animations of my NPC to the guide's animations but something weird happens when the NPC is walking or doing emotes.

Video
animation frames:
I don't have alt textures, maybe that causes the problem?
It's hard to say exactly what's gone wrong, but it looks like the number of animation frames in the .cs file doesn't match the actual number of frames in the .png file.

What do you have in Main.npcFrameCount[npc.type] = ??; and how many are in the image?

Edit: huh, the image didn't load until after I replied. I can see that you have 27 frames. What does it say in the .cs file?

Edit 2: I've had a closer look at your image, and it looks like you've duplicated the last frame of his walk. Removing that frame may work, as long as you also set Main.npcFrameCount[npc.type] to 26.
 
Last edited:
It's hard to say exactly what's gone wrong, but it looks like the number of animation frames in the .cs file doesn't match the actual number of frames in the .png file.

What do you have in Main.npcFrameCount[npc.type] = ??; and how many are in the image?

Edit: huh, the image didn't load until after I replied. I can see that you have 27 frames. What does it say in the .cs file?

Edit 2: I've had a closer look at your image, and it looks like you've duplicated the last frame of his walk. Removing that frame may work, as long as you also set Main.npcFrameCount[npc.type] to 26.
I'm new to modding, here is my code hastebin

I'll try what you said and add the result to this post
 
I'm new to modding, here is my code hastebin

I'll try what you said and add the result to this post
Yeah, you've got 26 as your number of frames, when your image has 27. I can also see that for ExtraFramesCount you have 9. I haven't played around with that number on NPCs, but I think that that is the number of frames after the walk cycle, and both the Guide and your image has 10. You could try changing that if you still have issues after removing that frame.
 
Yeah, you've got 26 as your number of frames, when your image has 27. I can also see that for ExtraFramesCount you have 9. I haven't played around with that number on NPCs, but I think that that is the number of frames after the walk cycle, and both the Guide and your image has 10. You could try changing that if you still have issues after removing that frame.
I think it fully fixed it, it still has some problems but I think it has something to do with my drawing. I probably drew some of the frames bigger than others. Also, I accidentally drew the whole thing smaller than it should (my image was 24x900, and I think it should be 40x1456) so I just amplified it in photoshop. That's why it looks blurry lol. I'll try to fix my drawing. Thank you so much

video:
 
Hello, I am in dire need of help, for the past months, I have installed, uninstalled and attempted to fix this tmodloader error. One day, as soon as I was about to compile my mod, this appeared:
Screen Shot 2021-04-10 at 9.28.25 AM.png

I thought that this was innocent enough and downloaded the file. I exited terraria and went back in only to see this error:
Screen Shot 2021-04-10 at 9.29.54 AM.png

This error is unfixable without deleting every boss in my mod. pls help me!
 
Hello, i'm looking for some help for creating my own prefix modifiers for weapons and accessories. i know that there is a modifier called "Deadly" that has different stats depending on which class it's applied to. I'm looking to get a similar thing applied to a custom modifier, but i'd like to use different stats for all types of items. My first thought was to use different scripts for each modifier class type, but that failed because the game apparently doesn't allow 2 of the same modifier name types to exist, despite Deadly existing for both melee and ranged weapons in the vanilla game. (This part has been solved) Additionally, i'd like to know how to add accessory modifiers, because the SetStats class doesn't list any accessory prefix values for me to edit. Thanks in advance! (i already have working code for a custom prefix that works for the main classes, but not accessories)
 
Last edited:
Hey all, I want to make a bomb that will heal players if they are in the explosion zone, I'm new to modding & c# so I don't know how can I do it. Can anyone help me? (If there is a tutorial for this, I'd gladly check it out too)
hastebin here is my code
 
Hey all, I want to make a bomb that will heal players if they are in the explosion zone, I'm new to modding & c# so I don't know how can I do it. Can anyone help me? (If there is a tutorial for this, I'd gladly check it out too)
hastebin here is my code
In the code for when the bomb explodes, loop through Main.player and see if any of the players are within some radius of the centre of the projectile, if they are then
C#:
player.statLife += healAmount; // Gives Health
player.HealEffect(healAmount, true); // Healing effect
 
Hello, when I tried to rebuild my mod under Linux via tModLoader I got this error :
Code:
Value cannot be null.
Parameter name: document
System.ArgumentNullException: Value cannot be null.
Parameter name: document
  at Mono.Cecil.Cil.SequencePoint..ctor (Int32 offset, Document document) [0x00009] in data-0x7fc992019010
  at Mono.Cecil.SignatureReader.ReadSequencePoints (Document document) [0x000f9] in data-0x7fc992019010
  at Mono.Cecil.MetadataReader.ReadSequencePoints (MethodDefinition method) [0x0004e] in data-0x7fc992019010
  at Mono.Cecil.Cil.PortablePdbReader.ReadSequencePoints (MethodDebugInformation method_info) [0x00000] in data-0x7fc992019010
  at Mono.Cecil.Cil.PortablePdbReader.Read (MethodDefinition method) [0x00007] in data-0x7fc992019010
  at Mono.Cecil.ImmediateModuleReader.ReadMethodsSymbols (TypeDefinition type, ISymbolReader symbol_reader) [0x0003d] in data-0x7fc992019010
  at Mono.Cecil.ImmediateModuleReader.ReadTypesSymbols (Collection[T] types, ISymbolReader symbol_reader) [0x00029] in data-0x7fc992019010
  at Mono.Cecil.ImmediateModuleReader.ReadTypesSymbols (Collection[T] types, ISymbolReader symbol_reader) [0x0001b] in data-0x7fc992019010
  at Mono.Cecil.ImmediateModuleReader.ReadSymbols (ModuleDefinition module) [0x00010] in data-0x7fc992019010
  at Mono.Cecil.ModuleWriter.Write (ModuleDefinition module, Disposable[T] stream, WriterParameters parameters) [0x00039] in data-0x7fc992019010
  at Mono.Cecil.ModuleWriter.WriteModule (ModuleDefinition module, Disposable[T] stream, WriterParameters parameters) [0x00002] in data-0x7fc992019010
  at Mono.Cecil.ModuleDefinition.Write (String fileName, WriterParameters parameters) [0x00017] in data-0x7fc992019010
  at Mono.Cecil.AssemblyDefinition.Write (String fileName, WriterParameters parameters) [0x00000] in data-0x7fc992019010
  at Terraria.ModLoader.Core.ModCompile.BuildModForPlatform (BuildingMod mod, Boolean xna) [0x0025d] in tModLoader.exe
  at Terraria.ModLoader.Core.ModCompile.Build (BuildingMod mod) [0x000d0] in tModLoader.exe
  at Terraria.ModLoader.Core.ModCompile.Build (String modFolder) [0x00008] in tModLoader.exe
  at Terraria.ModLoader.UI.UIBuildMod+<>c__DisplayClass5_0.<Build>b__0 (ModCompile mc) [0x00000] in tModLoader.exe
  at Terraria.ModLoader.UI.UIBuildMod.BuildMod (Action[T] buildAction, Boolean reload) [0x0003a] in tModLoader.exe

It appears to be the same error Talus has a few post before

Does anyone know what could have created this ? (full log is joined)
 

Attachments

  • tmodloader_error.log
    7.8 KB · Views: 78
Last edited:
I'm new to coding with C# and I'm trying to have the player receive like accessory effects when holding an item, but I get an error "CS0106: The modifier 'virtual' is not valid for this item."

C#:
using System;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;


namespace TestMod.Items
{
    public class DemonSword : ModItem
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("DemonSword"); // By default, capitalization in classnames will add spaces to the display name. You can customize the display name here by uncommenting this line.
            Tooltip.SetDefault("Sword made from the core of hell.");
        }

        public override void SetDefaults()
        {
            item.damage = 5000;
            item.melee = true;
            item.width = 400;
            item.height = 400;
            item.useTime = 2;
            item.useAnimation = 10;
            item.useStyle = 1;
            item.knockBack = 600;
            item.value = 10000;
            item.rare = 2;
            item.UseSound = SoundID.Item1;
            item.autoReuse = true;
            item.shoot = 187;
            item.shoot = 188;
            item.shoot = 15;
            item.shootSpeed = 20f;
        }

        virtual void Terraria.ModLoader.ModItem.HoldItem(Player player)
        {
            
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.DirtBlock, 1);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}

It's only a simple weapon for now so I can get familiarized with coding.
Also, if someone can tell me where I can find all the things accessories can give like flight and lava walking or something that'd be appreciated too thx.
 
Back
Top Bottom