tModLoader Error (Can't compile mod)

DexavioR

Terrarian
Hey, so I was just testing out a little weapon I made. I added it to mod sources, and tried to build it. It was near the end of the loading bar thing, and it gave me this error:

Code:
Sequence contains no matching element
  at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
  at Terraria.ModLoader.AssemblyManager.InstantiateMods(List`1 modsToLoad)

Any help would be appreciated! Tell me what that means please xD
 
Fixed/figured that out, now I have this:
Code:
Items/Balisong
  at Terraria.ModLoader.Mod.GetTexture(String name)
  at Terraria.ModLoader.ModLoader.GetTexture(String name)
  at Terraria.ModLoader.Mod.SetupContent()
  at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)
 
Fixed/figured that out, now I have this:
Code:
Items/Balisong
  at Terraria.ModLoader.Mod.GetTexture(String name)
  at Terraria.ModLoader.ModLoader.GetTexture(String name)
  at Terraria.ModLoader.Mod.SetupContent()
  at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)
Basically the png file wasn't found where terraria was looking for it. The path it expects is derived from the namespace of the item and the classname of the item. In this case, those match up to Mod Sources/MODNAME/Items/Balisong.png.

Check your spelling, capitalization, paths.
 
I have the texture present in the folder. it's named exactly: "Balisong.png" (without quotations) and the path is TacticalMod.Items (that's the folder it's in)
 
I have the texture present in the folder. it's named exactly: "Balisong.png" (without quotations) and the path is TacticalMod.Items (that's the folder it's in)
Should be TacticalMod/Items, not a folder named TacticalMod.Items
 
The folder isn't named that, it goes like: ModLoader/Mod Sources/TacticalMod/TacticalMod/Items/Weapons/(this is where my images and .cs files are)
[doublepost=1465921983,1465921718][/doublepost]So, the namespace on line 6 in the .cs file for the balisong, should be: namespace TacticalMod.Items.Weapons
 
I'm having the same error you you first had. Could you tell me how to fix it as I'm new to coding and wanted to try out modding. I'm not coding in visual studio but in notepad++ so I understand I can be limited. Thanks!
 
The folder isn't named that, it goes like: ModLoader/Mod Sources/TacticalMod/TacticalMod/Items/Weapons/(this is where my images and .cs files are)
[doublepost=1465921983,1465921718][/doublepost]So, the namespace on line 6 in the .cs file for the balisong, should be: namespace TacticalMod.Items.Weapons
Ok, so your problem is the extra TacticalMod folder. Move everything down a folder.
 
That's not the problem lel, the files work in the "ExampleMod" weapons folder with that namespace, but just not in mine
 
Code:
Mod Sources/TacticalMod/TacticalMod/
This is your problem, and if you claim it isn't, show code.
 
I fixed that problem lol. Now I am trying to make an item require a furnace/forge to be crafted at (2 wood)
But I put:

recipe.AddTile (TileId.Furnace);

and then tried to build
this came up now:

Items/Furnace
at Terraria.ModLoader.Mod.GetTexture(String name)
at Terraria.ModLoader.ModLoader.GetTexture(String name)
at Terraria.ModLoader.Mod.SetupContent()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

But THERE IS NO FURNACE ITEM!!! OR FURNACE ANY FILE ANYWHERE IN MY MOD!!!
 
c:\Users\Rocket\Documents\My Games\Terraria\ModLoader\Mod Sources\TacticalMod\Items\Weapons\RubyJavelin.cs(36,4) : error CS0103: The name 'recipe' does not exist in the current context



I used recipe.AddIngredient(ItemID....
and it says it's used incorrectly??
 
c:\Users\Rocket\Documents\My Games\Terraria\ModLoader\Mod Sources\TacticalMod\Items\Weapons\RubyJavelin.cs(36,4) : error CS0103: The name 'recipe' does not exist in the current context



I used recipe.AddIngredient(ItemID....
and it says it's used incorrectly??
Without code, I can only guess you didn't declare recipe to be a ModRecipe.

ModRecipe recipe = ....;
 
It uses a vanilla item..

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using System;
using Terraria.Graphics.Shaders;

namespace TacticalMod.Items.Weapons
{
public class RubyJavelin : ModItem
{
public override void SetDefaults()
{
item.name = "Ruby Javelin";
item.damage = 6;
item.noMelee = true;
item.width = 24;
item.height = 24;
item.useTime = 14;
item.useAnimation = 14;
item.useStyle = 1;
item.shoot = mod.ProjectileType("RubyJavelin_Projectile");
item.knockBack = 4;
item.autoReuse = true;
item.rare = 3;
item.value = 5000;
item.consumable = false;
item.shootSpeed = 12f;


}
public override void AddRecipes()
{
ModRecipe recipie = new ModRecipe(mod);
recipe.AddIngredient(ItemID.IronBar, 8);
recipe.AddIngredient(ItemID.Ruby, 4);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
 
It uses a vanilla item..

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using System;
using Terraria.Graphics.Shaders;

namespace TacticalMod.Items.Weapons
{
public class RubyJavelin : ModItem
{
public override void SetDefaults()
{
item.name = "Ruby Javelin";
item.damage = 6;
item.noMelee = true;
item.width = 24;
item.height = 24;
item.useTime = 14;
item.useAnimation = 14;
item.useStyle = 1;
item.shoot = mod.ProjectileType("RubyJavelin_Projectile");
item.knockBack = 4;
item.autoReuse = true;
item.rare = 3;
item.value = 5000;
item.consumable = false;
item.shootSpeed = 12f;


}
public override void AddRecipes()
{
ModRecipe recipie = new ModRecipe(mod);
recipe.AddIngredient(ItemID.IronBar, 8);
recipe.AddIngredient(ItemID.Ruby, 4);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
You spelled it as both recipie and recipe.
 
Hey, so I was just testing out a little weapon I made. I added it to mod sources, and tried to build it. It was near the end of the loading bar thing, and it gave me this error:

Code:
Sequence contains no matching element
  at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
  at Terraria.ModLoader.AssemblyManager.InstantiateMods(List`1 modsToLoad)

Any help would be appreciated! Tell me what that means please xD
I have that problem. how to fix?
 
I fixed that problem lol. Now I am trying to make an item require a furnace/forge to be crafted at (2 wood)
But I put:

recipe.AddTile (TileId.Furnace);

and then tried to build
this came up now:

Items/Furnace
at Terraria.ModLoader.Mod.GetTexture(String name)
at Terraria.ModLoader.ModLoader.GetTexture(String name)
at Terraria.ModLoader.Mod.SetupContent()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

But THERE IS NO FURNACE ITEM!!! OR FURNACE ANY FILE ANYWHERE IN MY MOD!!!
How did you fix it?
 
Back
Top Bottom