Workbench Definitions?

TheReiindeer

Skeletron Prime
Once again I need help. I tried putting my own mod that I may be releasing sometime when I learn to actually sprite something good, and code something good, which is the main problem for me.
When I put the Mod in the ModLoader Files (C:\Users\Jaide\Documents\My Games\Terraria\ModLoader\Mod Sources[I think that's correct]) and tried Building and Reloading, it came up with 'Terraria.ID.TileID does not contain a definition for Workbenches'. What are the definitions?
 
Once again I need help. I tried putting my own mod that I may be releasing sometime when I learn to actually sprite something good, and code something good, which is the main problem for me.
When I put the Mod in the ModLoader Files (C:\Users\Jaide\Documents\My Games\Terraria\ModLoader\Mod Sources[I think that's correct]) and tried Building and Reloading, it came up with 'Terraria.ID.TileID does not contain a definition for Workbenches'. What are the definitions?
You'll find your answer here: https://github.com/bluemagic123/tModLoader/wiki/Vanilla-Tile-IDs

Also, case sensitive.
 
Sorry for all of these by the way, but once again I'm getting another problem.
c:\Users\Jaide\Documents\My Games\Terraria\ModLoader\Mod Sources\LegendsTale\Items\Weapons\CactusYo-Yo.cs(10,23) : error CS1514: { expected
Even though my coding is this.
using Terraria;
using System;
using Terraria.ID;
using Microsoft.Xna.Framework;
using System.Diagnostics;
using Terraria.ModLoader;

namespace LegendsTale.Items.Weapons
{
public class CactusYo-Yo : ModItem
{
public override void SetDefaults{}
{
item.CloneDefaults{ItemID.WoodYoyo};
item.name = "Cactus Yoyo";
item.damage = 14;
item.value = 125;
item.rare = 0;
item.toolTip = "Thanks to cartoon magic, you can hold this without being hurt!";
item.knockBack = 4;
item.channel = true;
item.useStyle = 5;
item.useAnimation = 25;
item.useTime = 7;
item.shoot = mod.ProjectileType("YoyoProj");
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(Terraria.ID.ItemID.Cactus, 20);
recipe.AddIngredient(Terraria.ID.ItemID.Cobweb, 10);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
 
upload_2017-2-20_1-9-49.png


Classnames can't have special characters in them.

By now I hope you see how helpful Visual Studio is.
 
Once again, another problem.

I'm getting this error :
c:\Users\Jaide\Documents\My Games\Terraria\ModLoader\Mod Sources\LegendsTale\Items\Weapons\CactusYoYo.cs.cs(13,3) : error CS1519: Invalid token '{' in class, struct, or interface member declaration

My code :
using Terraria;
using System;
using Terraria.ID;
using Microsoft.Xna.Framework;
using System.Diagnostics;
using Terraria.ModLoader;

namespace LegendsTale.Items.Weapons
{
public class CactusYoYo : ModItem
{
public void SetDefault{}
{
item.CloneDefaults{ItemID.WoodYoyo};
item.name = "Cactus Yoyo";
item.damage = 14;
item.value = 125;
item.rare = 0;
item.toolTip = "Thanks to cartoon magic, you can hold this without being hurt!";
item.knockBack = 4;
item.channel = true;
item.useStyle = 5;
item.useAnimation = 25;
item.useTime = 7;
item.shoot = mod.ProjectileType("YoyoProj");
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(Terraria.ID.ItemID.Cactus, 20);
recipe.AddIngredient(Terraria.ID.ItemID.Cobweb, 10);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
 
Once again, another problem.

I'm getting this error :
c:\Users\Jaide\Documents\My Games\Terraria\ModLoader\Mod Sources\LegendsTale\Items\Weapons\CactusYoYo.cs.cs(13,3) : error CS1519: Invalid token '{' in class, struct, or interface member declaration

My code :
using Terraria;
using System;
using Terraria.ID;
using Microsoft.Xna.Framework;
using System.Diagnostics;
using Terraria.ModLoader;

namespace LegendsTale.Items.Weapons
{
public class CactusYoYo : ModItem
{
public void SetDefault{}
{
item.CloneDefaults{ItemID.WoodYoyo};
item.name = "Cactus Yoyo";
item.damage = 14;
item.value = 125;
item.rare = 0;
item.toolTip = "Thanks to cartoon magic, you can hold this without being hurt!";
item.knockBack = 4;
item.channel = true;
item.useStyle = 5;
item.useAnimation = 25;
item.useTime = 7;
item.shoot = mod.ProjectileType("YoyoProj");
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(Terraria.ID.ItemID.Cactus, 20);
recipe.AddIngredient(Terraria.ID.ItemID.Cobweb, 10);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
looks like you are just confusing some syntax. For example, you have {} when you want () at a couple places.
 
looks like you are just confusing some syntax. For example, you have {} when you want () at a couple places.
Ah yep, I see, but even with that, the Yoyo cannot be used, and it doesn't show it's stats and name. Anyone able to help?
 
Last edited:
im sorry to necro this thread, im searching everywhere for my answer but i cant seem to find it, im trying to use
Code:
WorldGen.PlaceTile((int)standingOn.X+5, (int)standingOn.Y-1, 18)
but i want to add a different workbench like boreal workbench or ebon etc. but i cant find how cause the id of the other workbenches is like this 18 (2) or 18 (3). can you please help me?

sorry about my bad english
 
Last edited:
Back
Top Bottom