tModLoader Official tModLoader Help Thread

Bibo

Steampunker
How do I animate a sword

This is my current code

using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Gradient.Items
{
public class Masamuree : ModItem
{
public override void SetStaticDefaults()
{
// DisplayName.SetDefault("Masamuree"); // 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("Great for impersonating devs!");
}

public override void SetDefaults()
{
Item.damage = 15000;
Item.DamageType = DamageClass.Melee;
Item.width = 40;
Item.height = 76;
Item.useTime = 11;
Item.useAnimation = 11;
Item.useStyle = 1;
Item.knockBack = 13;
Item.value = 0;
Item.rare = 9;
Item.UseSound = SoundID.Item1;
Item.autoReuse = false;
}

public override void AddRecipes()
{
Recipe recipe = CreateRecipe();
recipe.AddIngredient(ModContent.ItemType<Items.SnackticalsHeart>(), 1);
recipe.AddTile(TileID.WorkBenches);
recipe.Register();
}
}
}

And this is the sprite I want to use
 

Attachments

  • Masamuree.png
    Masamuree.png
    5.6 KB · Views: 16

randomduck1000

Terrarian
i was about to open tmodloader to play more calamity but it keeps saying Steam Api Mismatch, assumed pirated, eventhough i bought terraria on steam, what do i do to fix this?

edit: what error look like
 

Attachments

  • Untitled.png
    Untitled.png
    10.1 KB · Views: 17
Last edited:

J4FG

Terrarian
So i have a tiny problem and i dont know how to fix it.

I play Calamity with a few other mods and i am unable to catch critter such as worms or grasshoppers with my bugnet.
The pickup text pops up as if i picked it up but when i look in my inventory there isnt anything. :/

thx in advance for the help!

edit: sometimes some items vanish after i pick them up. same thing with the pickup text like above. ( mined mutant statue with the blue star from fargo and only have star in inventory)
 
Last edited:

sagspum

Terrarian
I get this every time I open tmod, I've deleted the tmodloader files and terraria files multiple times, no change.
 

Attachments

  • image_2022-07-27_161439800.png
    image_2022-07-27_161439800.png
    17.8 KB · Views: 13

StarfyrePrincess

The Destroyer
hello, I have a mod and I accidentally deleted it and didn't back it up. I didn't enable PBD or show code in the build. All it shows when I extract it is the "Extract" folder. Does anyone know how I can get my mod back? I spent a really long time on it, and want to get it back. Any help appreciated!
 

Simple

Official Terrarian
How do you make an NPC do something upon collision with a tile? Specifically, how can you make an NPC convert a tile into a different type on collision?
 

Jokadrian

Skeletron
How do I animate a sword

This is my current code

using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Gradient.Items
{
public class Masamuree : ModItem
{
public override void SetStaticDefaults()
{
// DisplayName.SetDefault("Masamuree"); // 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("Great for impersonating devs!");
}

public override void SetDefaults()
{
Item.damage = 15000;
Item.DamageType = DamageClass.Melee;
Item.width = 40;
Item.height = 76;
Item.useTime = 11;
Item.useAnimation = 11;
Item.useStyle = 1;
Item.knockBack = 13;
Item.value = 0;
Item.rare = 9;
Item.UseSound = SoundID.Item1;
Item.autoReuse = false;
}

public override void AddRecipes()
{
Recipe recipe = CreateRecipe();
recipe.AddIngredient(ModContent.ItemType<Items.SnackticalsHeart>(), 1);
recipe.AddTile(TileID.WorkBenches);
recipe.Register();
}
}
}

And this is the sprite I want to use
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(12, 11));
Also anyone know how to make a projectile shoot another projectile at all?
 

hecko

Terrarian
Hello, I'm not sure if this is the right place to ask for help, but my tModloader has been crashing on launch consistently. I haven't played the game in about two weeks, and I'm met with the error message below every time. I have tried clean reinstallations, updating graphics drivers, and running steam as an administrator, and none of these solutions have had any success. I can't find any other solutions, so help would be greatly appreciated.

8/13/2022 11:56:21 AM
System.Exception: Multiple extensions for asset Localization\en-US, (.json, )
at ReLogic.Content.Sources.ContentSource.SetAssetNames(IEnumerable`1 paths) in D:\a\tModLoader\tModLoader\src\tModLoader\ReLogic\Content\Sources\ContentSource.cs:line 28
at ReLogic.Content.Sources.FileSystemContentSource..ctor(String basePath) in D:\a\tModLoader\tModLoader\src\tModLoader\ReLogic\Content\Sources\FileSystemContentSource.cs:line 20
at Terraria.IO.ResourcePack.GetContentSource() in tModLoader\Terraria\IO\ResourcePack.cs:line 97
at Terraria.GameContent.AssetSourceController.<>c.<UseResourcePacks>b__13_1(ResourcePack pack) in tModLoader\Terraria\GameContent\AssetSourceController.cs:line 47
at System.Linq.Enumerable.SelectIPartitionIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at Terraria.GameContent.AssetSourceController.UseResourcePacks(ResourcePackList resourcePacks) in tModLoader\Terraria\GameContent\AssetSourceController.cs:line 45
at Terraria.Main.LoadContent() in tModLoader\Terraria\Main.cs:line 8620
at Terraria.Main.Initialize() in tModLoader\Terraria\Main.cs:line 5167
at Microsoft.Xna.Framework.Game.DoInitialize() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 779
at Microsoft.Xna.Framework.Game.Run() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 411
at Terraria.Program.LaunchGame_(Boolean isServer) in tModLoader\Terraria\Program.cs:line 235
 
Top Bottom