Click here to Skip to main content
15,501,036 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
cant find issue in this

C#
using Terraria.ID;
using Terraria.ModLoader;

namespace thepromod.Items
{
	public class mechanicalspikyeye : ModItem
	{
		public override void SetStaticDefaults()
		{
			DisplayName.SetDefault("mechanical suspicious looking eye");
			Tooltip.SetDefault("This is used to summon a mysterious boss from another world.");
		}

		public override void SetDefaults()
		{
			item.damage = 0;
			item.melee = false;
			item.width = 40;
			item.height = 40;
			item.useTime = 20;
			item.useAnimation = 20;
			item.useStyle = 1;
			item.knockBack = 6;
			item.value = 10000;
			item.rare = 2;
			item.UseSound = SoundID.Item1;
			item.autoReuse = true;
		}

		public override void AddRecipes()
		{
			ModRecipe recipe = new ModRecipe(mod);
			recipe.AddIngredient(InternalItemID.22, 10);
			recipe.AddIngredient(ItemID.suspiciouslookingeye, 1);
			recipe.AddTile(TileID.demonaltar);
			recipe.SetResult(this);
			recipe.AddRecipe();
		}
	}
}


What I have tried:

i have tried everything that i could find online sofar and none of it has worked yet
Posted
Updated 15-Aug-22 4:44am
v3
Comments
Patrice T 9-Jun-19 22:11pm     CRLF
the error message also told you the position of error. So tell us too.
Dave Kreskowiak 9-Jun-19 22:11pm     CRLF
CS1026 is ") expected." The problem is none of the code you posted appears to be able to throw that error. You're going to have to point out exactly which line throws that error, and paste the EXACT code that throws it.

1 solution

The error is not in that code: it cannot generate it, so it's likely to be in the code for the class that mechanicalspikyeye is derived from: ModItem - which we have no access to.

Start with Visual Studio: double click on then error message in the error pane, and it will take you directly to the line it thinks caused the problem. Since CS1026 is a "missing close bracket" it should be on that line, but it may be caused by code several lines above ion some cases. Start by looking at the colours of the code: are keyboards correctly highlighted in blue? Or is all the code red for example? The latter might indicate that you may have missed a closing double quotes earlier:
C#
myMethod(@"a parameter string);
if (condition)
   {
   string s = "hello";
               ^
               |
                --- CS1026 could be thrown here.

If you still can't spot it, copy'n'paste the line of code plus a dozen or so lines above and below it, copy'n'paste the errors(s) and indicate exactly which line the problem(s) show up on. We can't do anything without access to the code!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900