Error In tModLoader that no one can help fix.

NotANewb

Spazmatism
Alright, so I am new to coding. And I mean NEW. And I think a found a bug that no one can shed light on, except jopojelly, who said it was a syntax error. I'm going to include an example of one of my items, and I'm just wondering if anyone has had it to where nothing shows up as items (not loaded in the game at all! I even checked with HERO's mod, nothing). My example of code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace LivenUP.Items.Materials
{
public class Battery : ModItem
{
public override void SetDefaults()
{
item.name = "Battery";
item.width = 20;
item.height = 16;
item.maxStack = 999;
item.toolTip = "Waterproof, yet somewhat cheap";
item.toolTip2 = "'Suprisingly, these can cook hot dogs!'";
item.value = 10000;
item.rare = 2;
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(null, PureEnergy, 1);
recipe.AddRecipeGroup(Terraria.ID.ItemID.GoldBars, 1);
recipe.AddRecipeGroup(Terraria.ID.ItemID.IronBars, 1);
recipe.AddTile(Terraria.ID.TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe(null, CircutBoard)
}
}
}

Thanks!
 
I don't know either. It just let me. I'm thinking it's the items that need fixing, because if none of them are appearing then I think my LivenUP.cs is fine. So it's just my items.
 
My new code:
upload_2016-8-1_15-17-17.png
 
Nonono, I use an app (i have windows 8.1)
[doublepost=1470086258,1470086000][/doublepost]Oh also, it shouldn't be able to find errors like that, since this code isn't familiar to the software.
 
Here, try this.
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace LivenUP.Items.Materials
{
public class Battery : ModItem
{
public override void SetDefaults()
{
item.name = "Battery";
item.width = 20;
item.height = 16;
item.maxStack = 999;
item.toolTip = "Waterproof, yet somewhat cheap";
item.toolTip2 = "'Suprisingly, these can cook hot dogs!'";
item.value = 10000;
item.rare = 2;
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(null, PureEnergy, 1);
recipe.AddRecipeGroup(Terraria.ID.ItemID.GoldBars, 1);
recipe.AddRecipeGroup(Terraria.ID.ItemID.IronBars, 1);
recipe.AddTile(Terraria.ID.TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe(null, CircutBoard)
}
}
}
I replace Anvils with MythrilAnvil. For the tile named/IDs, please go to this link:
http://terraria.wiki.gg/Tile_IDs
 
So new problem. Crashes first time I load it, fine second time. But I think I may have fixed it. And if my other code is needed:
WAIT... there were two d's before my using.... ;-;
upload_2016-8-1_16-23-36.png
 
Here, try this.
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace LivenUP.Items.Materials
{
public class Battery : ModItem
{
public override void SetDefaults()
{
item.name = "Battery";
item.width = 20;
item.height = 16;
item.maxStack = 999;
item.toolTip = "Waterproof, yet somewhat cheap";
item.toolTip2 = "'Suprisingly, these can cook hot dogs!'";
item.value = 10000;
item.rare = 2;
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(null, PureEnergy, 1);
recipe.AddRecipeGroup(Terraria.ID.ItemID.GoldBars, 1);
recipe.AddRecipeGroup(Terraria.ID.ItemID.IronBars, 1);
recipe.AddTile(Terraria.ID.TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe(null, CircutBoard)
}
}
}
I replace Anvils with MythrilAnvil. For the tile named/IDs, please go to this link:
http://terraria.wiki.gg/Tile_IDs

Just as a heads up, you don't have to type Terraria.ID before ItemID and TileID because you have already put using Terraria.ID; at the top. The whole point of that was to not have to type Terraria.ID hundreds of times after. :)
 
And it was crashing because :red:ing zoaklen needed an update. I hate this so much now.
[doublepost=1470087084,1470087023][/doublepost]Thorium too? Well wtf.
[doublepost=1470087402][/doublepost]Thorium logs:
Exception of type 'System.OutOfMemoryException' was thrown.
at System.Reflection.RuntimeAssembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection, SecurityContextSource securityContextSource)
at System.Reflection.Assembly.Load(Byte[] rawAssembly, Byte[] rawSymbolStore)
at Terraria.ModLoader.AssemblyManager.LoadAssembly(Byte[] code, Byte[] pdb)
at Terraria.ModLoader.AssemblyManager.LoadedMod.LoadAssemblies()
at Terraria.ModLoader.AssemblyManager.InstantiateMods(List`1 modsToLoad)
I just wanna play some mods! D:
[doublepost=1470087487][/doublepost]AAAAnd gamecrash on TheLuggage loading screen. ;-;
 
I have no knowledge of code, so I can't help you. I just want to mention that you said you were new at coding, but your username is "NotANewb". I just found that funny.
 
So I see more anime fans... YES... WE WILL TAKE OVER THIS WORLD!!!! btw My favourite animes are AOT and Oreimo.
 
Back
Top Bottom