tModLoader Official tModLoader Help Thread

Talus

The Destroyer
Alright... this is the mod help thread!
I recently finished debugging my 5000+ error mod from the new syntax, now there is this:
Screen Shot 2022-06-20 at 2.21.43 PM.png

I have never seen this before and there is nothing involving given keys when I look up the error! Please help!
 

dragon3025

Terrarian
I can't get localization to work. This is my en_US.hjson file:
Code:
Mods: {
    ReducedGrinding: {
        ItemName: {
            MoonBall: Moon Ball
        }
        ItemTooltip: {
            MoonBall: "Advances the Moon Phase"
        }
        Config: {
            Label: {
                MoonBall: "Wizard Sells {$Mods.ReducedGrinding.ItemName.MoonBall}"
            }
        }
    }
}
and this is the line that's supposed to use the text:
Code:
DisplayName.SetDefault("{$Mods.ReducedGrinding.ItemName.MoonBall}");
It just returns what's in the quotes instead of what's in the en_US.hjson file. Someone last night said to try remove the curvy brackets, but that just gave me the text without the brackets.
 

Talus

The Destroyer
I can't get localization to work. This is my en_US.hjson file:
Code:
Mods: {
    ReducedGrinding: {
        ItemName: {
            MoonBall: Moon Ball
        }
        ItemTooltip: {
            MoonBall: "Advances the Moon Phase"
        }
        Config: {
            Label: {
                MoonBall: "Wizard Sells {$Mods.ReducedGrinding.ItemName.MoonBall}"
            }
        }
    }
}
and this is the line that's supposed to use the text:
Code:
DisplayName.SetDefault("{$Mods.ReducedGrinding.ItemName.MoonBall}");
It just returns what's in the quotes instead of what's in the en_US.hjson file. Someone last night said to try remove the curvy brackets, but that just gave me the text without the brackets.
If you want to return "MoonBall", just put MoonBall in the quotes. If you want to return the entire thing, try removing the curly brackets AND the quotes, if you get an error, you are missing a namespace.
 

dragon3025

Terrarian
If you want to return "MoonBall", just put MoonBall in the quotes. If you want to return the entire thing, try removing the curly brackets AND the quotes, if you get an error, you are missing a namespace.
I'm trying return "Moon Ball" translated in the language of the mod user's choice. The example mod kind has an example of this: link, but I think it links to a vanilla translation. There are examples of pointing to the translation within the translation file, but I don't think they're being used: link.
 

Talus

The Destroyer
Easy, you messed up the $ in between the curly bracket and the quote, it should be:
DisplayName.SetDefault("${Mods.ReducedGrinding.ItemName.MoonBall}"); instead of DisplayName.SetDefault("{$Mods.ReducedGrinding.ItemName.MoonBall}");
 

dragon3025

Terrarian
Easy, you messed up the $ in between the curly bracket and the quote, it should be:
DisplayName.SetDefault("${Mods.ReducedGrinding.ItemName.MoonBall}"); instead of DisplayName.SetDefault("{$Mods.ReducedGrinding.ItemName.MoonBall}");
I tried { before $ then built reloaded and it still didn't work.
 

ttoast

Terrarian
hey there hi. I have a resource pack on tmodloader that's loaded and is supposed to replace an NPC. The sprites and map icon and all work without problem, but the name, dialogue and such is nonexistent as of now. i've looked up text replacement not working for tmodloader and haven't found anything so far. is there anything i could do?
 

Marcus101RR

Master of Ravens
How to run 2 tModLoader servers for 1.4 currently? I can't figure it out, was easier with 1.3

EDIT: Figured it out, -savedirectory command line allows you to run more than one instance.
 
Last edited:

Don-Ifrit

Terrarian
Hi! First time user on the forums. I have downloaded Calamity and Fargos for 1.4, but I am unable to load them up as those (and other) mods were indicated to be built for "tModLoader v2022.5.103.32" while I am using "tModLoader v2022.6.86.0". Does not seem I can revert to a prior version to play these mods. Any surface-level advisement? Thank you :)

Edit: Shoutout to Discord- to solve the above issue:
1. Go to Steam.
2. Go to tModLoader and select the gear icon.
3. Select Properties / Betas / None.
 
Last edited:

LioLIon01

Terrarian
I have this problem in tmodloader 1.4 where whenever i die, the timer counts down from 3 to 1, but at 1 it freezes. the game still works fine as you can interact with the settings and stuff still, but you can't respawn and you have to leave the world then rejoin it. i tried looking up this problem for a solution, but couldnt find anyone who had the same problem in tmodloader or terraria, does anyone know how to fix this?
 

DusttheDragon

Terrarian
System.TypeInitializationException: The type initializer for 'Microsoft.Xna.Framework.FNAPlatform' threw an exception. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at Microsoft.Xna.Framework.SDL2_FNAPlatform.ProgramInit(LaunchParameters args)
at Microsoft.Xna.Framework.FNAPlatform..cctor()
--- End of inner exception stack trace ---
at Microsoft.Xna.Framework.Game..ctor()
at Terraria.Main..ctor()
at Terraria.Program.LaunchGame_()

I've been getting this since I updated 64 bit tmodloader to the latest release. I don't know what's causing it at this point. I can launch standard tmodloader through steam, but not 64 bit. Version that I get in the error box is 0.11.8.9 for reference.
 

obl1t

Terrarian
Hello, Tmodloader programming noob here. Is there a way to create an afterimage on a NPC, such as giving a custom boss a Shield of Cthulhu dash-style afterimage?

Edit: I figured it out. You can override the NPC predraw method to manually draw the afterimages.
 
Last edited:

SawTrem

Official Terrarian
Hello! I have a small suggestion or rather a request.
Terraria's 1.4 update added support for Razer Chroma devices with dynamic lighting changes for biomes, bosses and even HP level (which were very helpful to use potion after the debuff ends) and I really want to have this support in the new TModLoader. So, is it possible for you to add it in one of the future updates?
And thanks for considering my request.
 

obl1t

Terrarian
Hello! Tmodloader programming noob here. I've created a boss which works perfectly in singleplayer, but runs into a plethora of issues on multiplayer:
  • If I hit the boss, it instantly disappears. It seems to completely despawn, as its boss music stops playing.
  • Even if I don't hit the boss, it occasionally despawns. This seems to happen at random and without any warning.
I'm almost certain this is due to some syncing issue in multiplayer, since the boss works fine in singleplayer. I don't think I've got any non-deterministic code that would cause a desync that despawns the boss. How do I not make the boss despawn in multiplayer?

Boss despawning when hit:

Edit: I think I've figured it out. Apparently, servers can't handle "Main.NewText(...)". You have to make sure the netMode is not the server or Main.NewText breaks everything.
 
Last edited:

aldeo

Terrarian
1657818357302.png

could anybody help me with this? i reinstalled tmodlauncher over 3 times now, after checking integrity of files everything seems fine(and yes im using windows 7 dont judge me)
update:i found out that terraria has one file integrity :red:ed up, after uninstalling terraria and installing it once again its still there
 
Last edited:

LordVishon

Terrarian
Fresh re-install and still getting the same error. Any help would be appreciated.


[19:37:30] [Main Thread/INFO] [TerrariaSteamClient]: Working Directory: D:\Steam\steamapps\common\tModLoader
[19:37:30] [Main Thread/INFO] [TerrariaSteamClient]: Args: D:\Steam\steamapps\common\tModLoader\tModLoader.dll -terrariasteamclient 1448
[19:37:30] [Main Thread/INFO] [TerrariaSteamClient]: Setting steam app id to 105600
[19:37:30] [Main Thread/INFO] [TerrariaSteamClient]: SteamAPI.Init()
[19:37:30] [Main Thread/FATAL] [TerrariaSteamClient]: Unhandled error
System.EntryPointNotFoundException: Unable to find an entry point named 'SteamAPI_ISteamClient_GetISteamGameSearch' in DLL 'steam_api64'.
at Steamworks.NativeMethods.ISteamClient_GetISteamGameSearch(IntPtr instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, UTF8StringHandle pchVersion)
at Steamworks.SteamClient.GetISteamGameSearch(HSteamUser hSteamuser, HSteamPipe hSteamPipe, String pchVersion)
at Steamworks.CSteamAPIContext.Init()
at Steamworks.SteamAPI.Init()
at Terraria.ModLoader.Engine.TerrariaSteamClient.Run() in D:\a\tModLoader\tModLoader\src\tModLoader\Terraria\ModLoader\Engine\TerrariaSteamClient.cs:line 114

Edit: Finally figured it out. Had to re-name a .DLL file in sys32.
 
Last edited:
Top Bottom