When i try to enable my terraria mod and launch the mod i get this error mod from terraria. The tutorial i followed was 1 years old but it got a update video from 1 month ago, visual studio shows no errors or warning, this error message only appears when i try to launch the mod. The tutorial i used was
v2023.4.20.0 FIXES - HOW TO MAKE A MOD - TMODLOADER 1.4 - MIGRATION (1)
by Lynx.(I followed his 1 year old one which this one is the update for). My question is how do i fix this terraria issue?
---> Terraria.ModLoader.Exceptions.MissingResourceException: Expected resource not found:
Content/Items/TutorialItem
Closest guess: (Is there a spelling or folder placement error?)
Content/Items/Weapons/TutorialSword
Content/Items/[c/00ff00:Weapons/]Tutorial[c/00ff00:S][c/ffff00:Item]
Content/Items/ Tutorial [c/ffff00:word]
--- End of inner exception stack trace ---
at Terraria.ModLoader.Mod.TransferAllAssets() in tModLoader\Terraria\ModLoader\Mod.Internals.cs:line 103
at Terraria.ModLoader.ModContent.<>c.<Load>b__42_2(Mod mod) in tModLoader\Terraria\ModLoader\ModContent.cs:line 310
at Terraria.ModLoader.ModContent.LoadModContent(CancellationToken token, Action`1 loadAction) in tModLoader\Terraria\ModLoader\ModContent.cs:line 368
at Terraria.ModLoader.ModContent.Load(CancellationToken token) in tModLoader\Terraria\ModLoader\ModContent.cs:line 307
at Terraria.ModLoader.ModLoader.Load(CancellationToken token) in tModLoader\Terraria\ModLoader\ModLoader.cs:line 127
---> (Inner Exception #1) Terraria.ModLoader.Exceptions.MissingResourceException: Failed to load asset: "Content/Items/Weapons/TutorialSword"
System.InvalidOperationException: Texture2D creation failed! Error Code: The parameter is incorrect. (0x80070057)
at Microsoft.Xna.Framework.FNALoggerEXT.FNA3DLogError(IntPtr msg) in D:\a\tModLoader\tModLoader\FNA\src\FNALoggerEXT.cs:line 98
at Microsoft.Xna.Framework.Graphics.FNA3D_Impl.FNA3D_CreateTexture2D(IntPtr device, SurfaceFormat format, Int32 width, Int32 height, Int32 levelCount, Byte isRenderTarget)
at Microsoft.Xna.Framework.Graphics.Texture2D..ctor(GraphicsDevice graphicsDevice, Int32 width, Int32 height, Boolean mipMap, SurfaceFormat format) in D:\a\tModLoader\tModLoader\FNA\src\Graphics\Texture2D.cs:line 68
at ReLogic.Content.Readers.PngReader.FromStream[T](Stream stream, MainThreadCreationContext mainThreadCtx) in D:\a\tModLoader\tModLoader\src\tModLoader\ReLogic\Content\Readers\PngReader.cs:line 61
at ReLogic.Content.AssetRepository.LoadAssetWithPotentialAsync[T](Asset`1 asset, AssetRequestMode mode) in D:\a\tModLoader\tModLoader\src\tModLoader\ReLogic\Content\AssetRepository.cs:line 248<---
[.NET ThreadPool Worker/INFO] [tML]: Disabling Mod: TutorialMod
[Main Thread/DEBUG] [tML]: Process.Start (UseShellExecute = True): "tModLoader-Logs"
this is the code is used for [TutorialItem]
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using Terraria.GameContent.Creative;
namespace TutorialMod.Content.Items
{
internal class TutorialItem : ModItem
{
public override void SetStaticDefaults()
{
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 100;
}
public override void SetDefaults()
{
Item.width = 16;
Item.height = 16;
Item.value = Item.buyPrice(copper: 5);
Item.maxStack = 999;
}
}
}
The code i used for tutorial sword is
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using Terraria.GameContent.Creative;
namespace TutorialMod.Content.Items.Weapons
{
internal class TutorialSword : ModItem
{
public override void SetDefaults()
{
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
}
public override void SetStaticDefaults()
{
Item.width = 32;
Item.height = 32;
Item.useStyle = ItemUseStyleID.Swing;
Item.useTime = 20;
Item.useAnimation = 20;
Item.autoReuse = true;
Item.DamageType = DamageClass.Melee;
Item.damage = 35;
Item.knockBack = 3.5f;
Item.crit = 10;
Item.value = Item.buyPrice(silver: 80, copper: 50);
Item.rare = ItemRarityID.Blue;
Item.UseSound = SoundID.Item1;
}
public override void AddRecipes()
{
CreateRecipe()
.AddIngredient(ModContent.ItemType<TutorialItem>() , 8)
.AddTile(TileID.Anvils)
.Register();
}
}
}
If u require more information please tell me what type/part u need and ill try to find and add it.
What I have tried:
Ive tried deleting and rewriting areas but this is my first project so my knowledge on what to do is lacking, and i cant find any videos which can guide me.