tModLoader Official tModLoader Help Thread

Hello everyone! I successfully answered my previous question, but I am back with another one. I want to customize the Combat Text that is showing up when we hit a NPC, and I have found how to spawn a new Combat Text (this is in a class extending GlobalItem):

Code:
public override void ModifyHitNPC(Item item, Player player, NPC target, ref int damage, ref float knockBack, ref bool crit)
        {
            CombatText.NewText(target.Hitbox, Color.Turquoise, damage, crit, false);
        }

However, I can't seem to find how to prevent the default Combat Text from spawning. Does anyone else have a clue? I searched through the source code and can't find any clue... Google has not been better at finding a solution neither... Anyone?
 
Can someone help me make a custom pet plz. The ONLY tutorial is 2 years old and every time i try to compile it will come up with an error. I am using terraria v1.3.5.2 and tModLoader v0.10.1.5
 
Right so i have a bit of a problem.
I'm trying to have a UI menu appear at my cursor when i alt click a item but the ui only appears at one spot even though the values it has are different than before
 
Ok so i went from a Mac to a Windows pc and now the world can load without crashing, but after about a minute of being on the world the game just crashes anyway. Help please?

Crashlog:
System.InvalidOperationException: Begin cannot be called again until End has been successfully called.
at Microsoft.Xna.Framework.Graphics.SpriteBatch.Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformMatrix)
at Terraria.Main.RenderWater()
at Terraria.Main.do_Draw(GameTime gameTime)
at Terraria.Main.DoDraw(GameTime gameTime)
at Terraria.Main.Draw(GameTime gameTime)
at Microsoft.Xna.Framework.Game.DrawFrame()
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameHost.OnIdle()
at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Microsoft.Xna.Framework.WindowsGameHost.Run()
at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
at Terraria.Program.LaunchGame(String[] args, Boolean monoArgs)
 
Last edited:
Hello everyone!
I was hoping someone would be able to help, I have tried searching around for an answer but I couldn't find anything. It's likely user-error but here goes.

I am using a Mac, Mojave 10.14.2 with Terraria installed via Steam.
I've tried loading tmodloader several times but get the same issue - Terraria itself runs fine, however when I install tmodloader it will open to the logo screen then stall on the black screen, not moving any further.
I've tried uninstalling, deleting, and re-installing everything, same issue.

Is there a known issue with the Mac version of tmodloader or did I do something wrong?

Thank you in advance! :)
 
I can't download Fargo's Soul Mod, even though it was updated yesterday. it gives me an "unknown" error, and there are no logs. None.
 
So I created a custom mount, and it works fine. However, if the player attacks, the weapon appears lower than they are on the mount, as if they were standing on the ground in the same spot instead. Is there any way to adjust this?

I adjusted the mount's xOffset and yOffset, and the playerYOffsets, but none of these change the position of a weapon when attacking, just where the player / mount sprites align.

Edit: Or, if that can't be done, is there just a way to disable attacking while on the mount?
 
I put this error in its own thread, but it can't hurt to ask here.
This has happened on three worlds so far. After defeating the cultist, every time I open the settings menu, the game crashes. Another issue is that monsters do not display their name and hp when hovered over. This is a very annoying bug, and I would very much appreciate help with it.
Mod list:
Calamity
Thorium
Sacred Tools
Qwerty's bosses and items
Initiate Mod
Intrucial
Fargo's
IMK sushi
IMK sushi old recipies
Magic Storage
Omniswing
Luiafk
Shorter Respawn
AlchemistNPC
VeinMiner
Wing Slot

System Specs
OS: linux mint 19
RAM 8gb
 
I make them on linux, you should be able to on mac. I think there is a link to the instructions on the tmodloader github
 
I make them on linux, you should be able to on mac. I think there is a link to the instructions on the tmodloader github
Though I guess it wouldn’t hurt to know a bit...
Umm, how do you code on Linux? Cuz it just might work on Mac.
 
So I just recently started modding, and it's been a lot of fun, even tho I'm bad at it. I have two questions:
  1. I'm trying to make a sword that slows the target upon hitting it, but I don't really know how. My guess is that the "Slow" debuff only works with the player and not enemies. If that's correct, is there any other debuff that could work? This is my code, if there's anything wrong with it:
    Code:
    using Microsoft.Xna.Framework;
    using Terraria;
    using Terraria.ID;
    using Terraria.ModLoader;
    namespace pataponEquipment.Items
    {
        public class SleepySword : ModItem
        {
            public override void SetStaticDefaults()
            {
                DisplayName.SetDefault("Sleepy Sword");
                Tooltip.SetDefault("One nasty slice and it's night-night");
            }
            public override void SetDefaults()
            {
                item.damage = 24;
                item.melee = true;
                item.width = 38;
                item.height = 38;
                item.useTime = 20;
                item.useAnimation = 20;
                item.useStyle = 1;
                item.knockBack = 6;
                item.value = 10000;
                item.rare = 3;
                item.UseSound = SoundID.Item1;
                item.autoReuse = false;
            }   
           
            public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit)
            {
                target.AddBuff(BuffID.Slow, 60);
            }
    
            public override void AddRecipes()
            {
                ModRecipe recipe = new ModRecipe(mod);
                recipe.AddIngredient(ItemID.GoldBar, 8);
                recipe.AddIngredient(ItemID.Amethyst, 10);
                recipe.AddTile(TileID.Anvils);
                recipe.SetResult(this);
                recipe.AddRecipe();
               
                recipe = new ModRecipe(mod);
                recipe.AddIngredient(ItemID.PlatinumBar, 8);
                recipe.AddIngredient(ItemID.Amethyst, 10);
                recipe.AddTile(TileID.Anvils);
                recipe.SetResult(this);
                recipe.AddRecipe();
            }
           
            public override void MeleeEffects(Player player, Rectangle hitbox) {
                if (Main.rand.NextBool(3)) {
                    //Emit dusts when swing the sword
                    Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, mod.DustType("Sleep"));
                }
            }
        }
    }
  2. I've also been trying to make a sword that does double damage to only certain types of enemies. Is there a way to check for a certain enemy and then make the sword do double damage? Or better, if instead of checking for Enemy A, B, C, and D, there was a way of putting those enemies into a category, so I could just check for Category ABCD? I don't know if I'm explaining myself correctly, but any help is greatly appreciated.
 
I'm trying to make a sword that slows the target upon hitting it, but I don't really know how. My guess is that the "Slow" debuff only works with the player and not enemies. If that's correct, is there any other debuff that could work? This is my code, if there's anything wrong with it:
I think that may be true, some interactions have probably never been recorded for NPCs. The only real think you could do, is make a custom debuff. Then, if applied, reduce the npc.velocity in the PostAI hook. But it may or may not work, probably volatile.

I've also been trying to make a sword that does double damage to only certain types of enemies. Is there a way to check for a certain enemy and then make the sword do double damage? Or better, if instead of checking for Enemy A, B, C, and D, there was a way of putting those enemies into a category, so I could just check for Category ABCD? I don't know if I'm explaining myself correctly, but any help is greatly appreciated.
Definitely possible. You can have an array or list of npc type (int), then check against it in the ModifyHitNPC hook
 
so, how do i build all.dll(required for coding on mac) using visual studio with ??
just asking.
 
Last edited:
Hello everyone!
I was hoping someone would be able to help, I have tried searching around for an answer but I couldn't find anything. It's likely user-error but here goes.

I am using a Mac, Mojave 10.14.2 with Terraria installed via Steam.
I've tried loading tmodloader several times but get the same issue - Terraria itself runs fine, however when I install tmodloader it will open to the logo screen then stall on the black screen, not moving any further.
I've tried uninstalling, deleting, and re-installing everything, same issue.

Is there a known issue with the Mac version of tmodloader or did I do something wrong?

Thank you in advance! :)

I have this exact issue. I have done a lot of testing to find out that this isn't fixed by disabling any overlays (as some googling has suggested I do). The mod loader will start up and initialize with a fresh install, but with the addition of ANY mods, even if they're inconsequentially small, will cause this black screen on load that requires a force quit when you restart the game to enable the mod(s). Looking through this thread, this seems to be a fairly recent issue and I think it's safe to say the Mac version of tModLoader is completely unusable as of right now. I don't know if it's currently being developed or anything but I would appreciate it if someone looked into this issue.

EDIT: Ok, looking at GitHub, there was an update released a few days ago that seemingly fixed this issue, but it does not seem to have released for Mac/Linux yet. I tried doing a manual install of the files but it crashes instantly. Here's hoping they put out the Mac fix soon.
 
Last edited:
Back
Top Bottom