tModLoader Error "CS1026" When Building a Mod

Status
Not open for further replies.

Aiden L

Official Terrarian
So, after attempting to make a weapon mod, whenever I click "Build" it says: Errow CS1026, )expected. I have no idea what this means, and I don't see a solution anywhere on the internet. I',m attempting to make a bow.Keep in mind, this is my first time coding. The code is:

using Terraria.ID;
using Terraria.ModLoader;
namespace fill.Items
{
public class blockfiller : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Demon Blaze Bow");
Tooltip.SetDefault("Forged from the Depths of the Corruption, With the Help of Demons. However it was Made, this Weapon Rocks!");
}
public override void SetDefaults()
{
item.damage = 42;
item.ranged = true;
item.width = 40;
item.height = 40;
item.useTime = 5;
item.useAnimation = 10;
item.useStyle = 1;
item.knockBack = 6;
item.value = 10000;
item.rare =3;
item.UseSound = SoundID.Item5;
item.autoReuse = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.44, 1);
recipe.AddIngredient(ItemID.120, 1); recipe.AddIngredient(ItemID.182, 10); recipe.AddIngredient(ItemID.29, 1); recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
/*
*My first bow
*/
 
You never use the item numbers, you have to type the names of the item out

using Terraria.ID;
using Terraria.ModLoader;

namespace fill.Items
{

public class blockfiller : ModItem
{

public override void SetStaticDefaults()
{

DisplayName.SetDefault("Demon Blaze Bow");
Tooltip.SetDefault("Forged from the Depths of the Corruption, With the Help of Demons. However it was Made, this Weapon Rocks!");
}

public override void SetDefaults()
{
item.damage = 42;
item.ranged = true;
item.width = 40;
item.height = 40;
item.useTime = 5;
item.useAnimation = 10;
item.useStyle = 1;
item.knockBack = 6;
item.value = 10000;
item.rare =3;
item.UseSound = SoundID.Item5;
item.autoReuse = true;
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.DemonBow, 1);
recipe.AddIngredient(ItemID.MoltenFury, 1);
recipe.AddIngredient(ItemID.Diamond , 10);
recipe.AddIngredient(ItemID.LifeCrystal, 1);
recipe.AddTile(TileID.Anvils); // if you want this item to be crafted at an alter just replace Anvils with DemonAlter
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
 
Thank you so much!
[doublepost=1552354734,1552354387][/doublepost]Also, could you tell me how to resolve the error "Namespace and Folder name do not match. The top level namespace must match the folder name." ?
 
I renamed my mod to "DemonFury" , and i cant tell if the mod name internally is still "fill" or if it's the display name i chose: Hard Work Brings Great Reward.
[doublepost=1552356459,1552356404][/doublepost]And, there are 2 other files randomly named "fill" in my mod folder.
[doublepost=1552356645][/doublepost]Here's a discord, to make this easier. https://discord.gg/sQ5XbPg
 
Status
Not open for further replies.
Back
Top Bottom