tModLoader Official tModLoader Help Thread

sorry for the late reply but , it shows the same error
The problem lies with the dust effect then. I made a class inside of Example mod with your code and everything works fine, but since example mod does not have your tutorialdust, i replaced it with ExampleMod's "Sparkle" dust. Since that is the only difference, it stands to reason that that's where the problem is. So while this class has all the required namespaces, your dust class probably does not. Make sure that the dust class uses the tutorialdusts namespace also.
 
Try ProjectileID since ItemID and projectileID both return integers they are kind of compartible.

Edit 1:I looked it up and I didn't find a heart projectile. Maybe I'll find a workaround.

Edit 2:I got an idea how it could work, but I couldn't test it because I need a 1.17.1 compiler but can only download the 1.17 one :mad:.
This basicly creates a projectile wich when it gets destroyed spawns a heart.
That's the code.

Code:
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Mod.Projectiles       //Change it to the corect folder
{
    public class heartproj: ModProjectile
    {
     
public class txtxx : ModProjectile
    {
        public override void SetDefaults()
        {
            //projectile.name = "Custom Flamethrower"; //Name of the projectile, only shows this if you get killed by it
            projectile.width = 12;  //Set the hitbox width
            projectile.height = 12; //Set the hitbox height
            projectile.hostile = true;  //Tells the game whether it is friendly to players/friendly npcs or not
            projectile.ignoreWater = true;  //Tells the game whether or not projectile will be affected by water
            projectile.ranged = true;  //Tells the game whether it is a ranged projectile or not
            projectile.penetrate = 1; //Tells the game how many enemies it can hit before being destroyed, -1 infinity
            projectile.timeLeft = 600;  //The amount of time the projectile is alive for
        }
        public override void Kill(int timeLeft) {
            Item.NewItem(projectile.position,ItemID.Heart,1);
        }
        public override bool OnTileCollide(Vector2 oldVelocity)
        {
            projectile.Kill();
            return false;
        }
    }
    }
}

Just remember to spawn it using:
Code:
item.shoot = mod.ProjectileType("heartproj");

Edit 3:
Now the code is right!

Ok so I finally tried this and it says: Terreria.Modloader.Exceptions.MissingResourceException: Expected resource not found
Projectiles/txtxx

What do I do to fix this
 
So i did that, but when i try to build and reload it says:

error CS0542: 'heartproj': member names can not be the same as their enclosing type
Is the name of the file .png the name of the class?
Is the folder in wich the .png and the .cs fiel are in the folder wirtten in the namspace?
 
I have a question, I have the mod ,,begone evil´´ in my downloaded mods. I also have the mod enabled and pressed on reload mods. But when I enter my world, and press ESC and go to settings and then mods there, the list is empty. There is nothing in the mods list. Did I do something wrong? Or ist the mods list just generally empty and the mods still work?

Edit: I even tried making completly new characters and worlds
 
Last edited:
Here are what I mean mybe better explained with pictures
 

Attachments

  • Screenshot (2).png
    Screenshot (2).png
    400.6 KB · Views: 144
  • Screenshot (3).png
    Screenshot (3).png
    278.6 KB · Views: 135
Hello, im having trouble downloading mods like overhaul and calamity when i try to download them it shows the download screen and before any progress is made. Thanks in advance for the help.
 
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Mod.Projectiles       //Change it to the corect folder
{
    
public class heartproj: ModProjectile
    {
        public override void SetDefaults()
        {
            //projectile.name = "Heartprojectile"; //Name of the projectile, only shows this if you get killed by it
            projectile.width = 12;  //Set the hitbox width
            projectile.height = 12; //Set the hitbox height
            projectile.hostile = true;  //Tells the game whether it is friendly to players/friendly npcs or not
            projectile.ignoreWater = true;  //Tells the game whether or not projectile will be affected by water
            projectile.ranged = true;  //Tells the game whether it is a ranged projectile or not
            projectile.penetrate = 1; //Tells the game how many enemies it can hit before being destroyed, -1 infinity
            projectile.timeLeft = 600;  //The amount of time the projectile is alive for
        }
        public override void Kill(int timeLeft) {
            Item.NewItem(projectile.position,ItemID.Heart,1);
        }
        public override bool OnTileCollide(Vector2 oldVelocity)
            {
                projectile.Kill();
                return false;
        }
        
    }
}
This should work fine.
 
I got this when I tried to open the mod browser after I went in the files and deleted my players, my mods, and my worlds

[14:13:07] [1/INFO] [tML]: Starting tModLoader v0.11.7.3 Windows client (5/29/2020)
[14:13:07] [1/INFO] [tML]: Running on NetFramework 4.8
[14:13:07] [1/INFO] [tML]: Executable: C:\Users\Brittany\Desktop\New folder\New folder\steamapps\common\tModLoader\tModLoader.exe
[14:13:07] [1/INFO] [tML]: Working Directory: C:\Users\Brittany\Desktop\New folder\New folder\steamapps\common\tModLoader
[14:13:07] [1/INFO] [tML]: Launch Parameters:
[14:13:07] [1/DEBUG] [tML]: Assembly Resolve: -> MonoMod.RuntimeDetour, Version=20.5.14.1, Culture=neutral, PublicKeyToken=null
[14:13:07] [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
[14:13:07] [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
[14:13:08] [1/DEBUG] [tML]: Assembly Resolve: -> Ionic.Zip.Reduced, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c
[14:13:09] [1/DEBUG] [tML]: Assembly Resolve: -> Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
[14:13:10] [1/DEBUG] [tML]: Assembly Resolve: -> Steamworks.NET, Version=9.1.0.0, Culture=neutral, PublicKeyToken=null
[14:13:10] [1/INFO] [tML]: Checking Steam installation...
[14:13:12] [1/INFO] [tML]: Steam installation OK.
[14:13:12] [1/INFO] [Terraria]: Found Terraria steamapp install at: C:\Users\Brittany\Desktop\New folder\New folder\steamapps\common\Terraria
[14:13:12] [1/INFO] [Terraria]: Steam Cloud Quota: 152.6 MB available
[14:13:14] [1/DEBUG] [Terraria]: Graphics Device: Intel(R) HD Graphics Family {Width:1920 Height:1080 Format:Color AspectRatio:1.777778}
[14:13:14] [1/DEBUG] [Terraria]: Device Reset, Profile: Reach -> HiDef, Width: 800, Height: 480, Fullscreen: False, Display: \\.\DISPLAY1
[14:13:30] [1/INFO] [Terraria]: Loaded 1000 vanilla assets
[14:13:36] [1/INFO] [Terraria]: Loaded 2000 vanilla assets
[14:13:45] [1/INFO] [Terraria]: Loaded 3000 vanilla assets
[14:13:57] [1/INFO] [Terraria]: Loaded 4000 vanilla assets
[14:14:11] [1/INFO] [Terraria]: Loaded 5000 vanilla assets
[14:14:21] [1/DEBUG] [Terraria]: Device Reset, Profile: HiDef, Width: 800 -> 1920, Height: 480 -> 1017, Fullscreen: False, Display: \\.\DISPLAY1
[14:14:26] [8/DEBUG] [tML]: Assembly Resolve: -> MP3Sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
[14:14:26] [8/DEBUG] [tML]: Assembly Resolve: -> NVorbis, Version=0.8.4.0, Culture=neutral, PublicKeyToken=null
[14:14:28] [7/DEBUG] [tML]: Assembly Resolve: -> Mono.Cecil.Mdb, Version=0.11.2.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e
[14:14:28] [7/DEBUG] [tML]: Assembly Resolve: -> Mono.Cecil.Pdb, Version=0.11.2.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e
[14:14:28] [7/INFO] [Terraria]: JIT loading finished
[14:14:28] [8/INFO] [tML]: Unloading mods
[14:14:30] [8/INFO] [tML]: Finding Mods...
[14:14:30] [8/INFO] [tML]: Instantiating Mods...
[14:14:30] [8/INFO] [tML]: Initializing: ModLoader v0.11.7.3
[14:14:31] [8/INFO] [tML]: Setting up...
[14:14:31] [8/INFO] [tML]: Loading: ModLoader v0.11.7.3
[14:14:31] [8/INFO] [tML]: Adding Recipes...
[14:18:39] [12/DEBUG] [tML]: Web Request: http://javid.ddns.net/tModLoader/listmods.php
[14:18:40] [12/WARN] [tML]: Silently Caught Exception:
Newtonsoft.Json.JsonReaderException: Error parsing Infinity value. Path '', line 1, position 2.
at Newtonsoft.Json.JsonTextReader.ParseNumberPositiveInfinity(ReadType readType, Boolean matched)
at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.JsonTextReader.Read()
at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)
at Terraria.ModLoader.UI.ModBrowser.UIModBrowser.PopulateFromJson(LocalMod[] installedMods, String json)
at Terraria.ModLoader.UI.ModBrowser.UIModBrowser.<>c__DisplayClass51_0.<UploadComplete>b__0(Task`1 task)
at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
at System.Threading.Tasks.Task.ExecutionContextCallback(Object obj)
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.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

[14:18:40] [12/WARN] [tML]: Silently Caught Exception:
System.Exception: Bad JSON: IncrementVersionTracking Query failed: Unknown column '0.11.7.3' in 'field list'
at Terraria.ModLoader.UI.ModBrowser.UIModBrowser.PopulateFromJson(LocalMod[] installedMods, String json)
at Terraria.ModLoader.UI.ModBrowser.UIModBrowser.<>c__DisplayClass51_0.<UploadComplete>b__0(Task`1 task)
at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
at System.Threading.Tasks.Task.ExecutionContextCallback(Object obj)
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.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

ad JSON: IncrementVersionTracking Query failed: Unknown column '0.11.7.3' in 'field list'
at Terraria.ModLoader.UI.ModBrowser.UIModBrowser.PopulateFromJson(LocalMod[] installedMods, String json)
[14:18:48] [1/DEBUG] [tML]: Process.Start (UseShellExecute = True): "C:\Users\------\Documents\My Games\Terraria\ModLoader\Logs\client.log"
 
I've gotten the same error, but just downloaded tModLoader on this PC for the first time. I've installed Terraria on this PC after 1.4 (been playing before), so all my things are 1.4 and cannot migrate to tModLoader just yet. Do you need to have an existing world for 1.3 in order for tModLoader to work? Never encountered that issue before when it was still it's own thing..
 
I got the same error too. No fix as far as I can tell. I think it was introduced when tModLoader was updated. Seems they left an error in the code and forgot about it. They will probably fix it soon. (I don't understand JSON so I can't say what the problem is)
 
Back
Top Bottom