LordVGames
Skeletron Prime
You need to start it with
ModRecipe recipe = new ModRecipe(this);
I did that, still getting the same error when building the mod...
You need to start it with
ModRecipe recipe = new ModRecipe(this);
Oh, my guess is this method isn't inside the Mod Class. If you don't know what I mean, post the whole file.I did that, still getting the same error when building the mod...
View attachment 151284
View attachment 151285
Oh, my guess is this method isn't inside the Mod Class. If you don't know what I mean, post the whole file.
Yeah, it's not in the class.Here is the file
Something like this: https://github.com/bluemagic123/tModLoader/blob/master/ExampleMod/NPCs/ExamplePerson.cs#L199This isn't related to my previous question, but how do I have a recipe use an item from a different mod?
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;
namespace SwordsNStuff.Tiles
{
public class AlloyFurnace : ModTile
{
public override void SetDefaults()
{
Main.tileSolidTop[Type] = true;
Main.tileFrameImportant[Type] = true;
Main.tileNoAttach[Type] = true;
Main.tileTable[Type] = false;
Main.tileLavaDeath[Type] = true;
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2);
TileObjectData.newTile.CoordinateHeights = new int[] { 18 };
TileObjectData.addTile(Type);
AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable);
AddMapEntry(new Color(200, 200, 200), "Alloy Furnace");
dustType = 0;
disableSmartCursor = true;
adjTiles = new int[] { TileID.WorkBenches };
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 3;
}
public override void KillMultiTile(int i, int j, int frameX, int frameY)
{
Item.NewItem(i * 16, j * 16, 32, 16, mod.ItemType("AlloyFunrace"));
}
}
}
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace SwordsNStuff.Items.Placeable
{
public class AlloyFurnace : ModItem
{
public override void SetDefaults()
{
item.name = "Alloy Furnace";
item.width = 46;
item.height = 34;
item.maxStack = 99;
AddTooltip("Use To Create New And Powerfull Alloys.");
item.useTurn = true;
item.autoReuse = true;
item.useAnimation = 15;
item.useTime = 10;
item.useStyle = 1;
item.consumable = true;
item.value = 550;
item.createTile = mod.TileType("AlloyFurnace");
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddTile(TileID.WorkBenches);
recipe.AddIngredient(ItemID.Wood, 15);
recipe.AddRecipeGroup("Wood");
recipe.AddIngredient(ItemID.StoneBlock, 10);
recipe.AddIngredient(ItemID.Campfire, 5);
recipe.AddIngredient(ItemID.IronBar, 15);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
Read the guide in my signatureI'm having difficulty creating a workbench, whenever i place it it only puts down 2/6 pieces of it, I need help
Here is my code:
Code:using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; namespace SwordsNStuff.Tiles { public class AlloyFurnace : ModTile { public override void SetDefaults() { Main.tileSolidTop[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileNoAttach[Type] = true; Main.tileTable[Type] = false; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); TileObjectData.newTile.CoordinateHeights = new int[] { 18 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(200, 200, 200), "Alloy Furnace"); dustType = 0; disableSmartCursor = true; adjTiles = new int[] { TileID.WorkBenches }; } public override void NumDust(int i, int j, bool fail, ref int num) { num = fail ? 1 : 3; } public override void KillMultiTile(int i, int j, int frameX, int frameY) { Item.NewItem(i * 16, j * 16, 32, 16, mod.ItemType("AlloyFunrace")); } } }
and for the placable item:
[doublepost=1481484596,1481484446][/doublepost]messed up my image...Code:using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; namespace SwordsNStuff.Items.Placeable { public class AlloyFurnace : ModItem { public override void SetDefaults() { item.name = "Alloy Furnace"; item.width = 46; item.height = 34; item.maxStack = 99; AddTooltip("Use To Create New And Powerfull Alloys."); item.useTurn = true; item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; item.useStyle = 1; item.consumable = true; item.value = 550; item.createTile = mod.TileType("AlloyFurnace"); } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ItemID.Wood, 15); recipe.AddRecipeGroup("Wood"); recipe.AddIngredient(ItemID.StoneBlock, 10); recipe.AddIngredient(ItemID.Campfire, 5); recipe.AddIngredient(ItemID.IronBar, 15); recipe.SetResult(this); recipe.AddRecipe(); } } }
You need to read the migration guide linked to in the 0.9 release postHello, this error doesn`t appear me before downloading tmodloader v0.9.0.1, what should I do?
It appears in all items of my mod.
http://hastebin.com/uworocujej.tex
Read: https://docs.google.com/document/d/1pytx2sCLq56qXZLIQ_mKzv0_-Nf6E3hncExL8Mf9OJ8/edit?usp=sharingwhen i tried to build my mod in terraria 1.3.4.4 and tmodloader v 0.9.0.2 it said Terraria.Item doesnt have a definition for useSound please help me
c:\Users\tehpootisman\Documents\My Games\Terraria\ModLoader\Mod Sources\Pootis\Items\Weapons\PathogenX.cs(28,18) : error CS1061: 'Terraria.Item' does not contain a definition for 'useSound' and no extension method 'useSound' accepting a first argument of type 'Terraria.Item' could be found (are you missing a using directive or an assembly reference?)
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace Pootis.Items.Weapons //where is located
{
public class PathogenX : ModItem
{
public override void SetDefaults()
{
item.name = "Pathogen X"; //Sword name
item.damage = 500; //Sword damage
item.melee = true; //if it's melee
item.width = 90; //Sword width
item.height = 90; //Sword height
item.toolTip = "A Scythe wielded by the Fancy Reaper, Inti Croati. Also known as Rainbow Inti."; //Item Description
item.toolTip2 = "Take your hate, and turn it into the love you have for tearing your enemies apart at the seams!";
item.useTime = 25; //how fast
item.useAnimation = 25;
item.useStyle = 1; //Style is how this item is used, 1 is the style of the sword
item.knockBack = 5; //Sword knockback
item.value = Item.sellPrice(0, 50, 0, 0);
item.rare = 11;
item.useSound = 1; //1 is the sound of the sword
item.autoReuse = true; //if it's capable of autoswing.
item.useTurn = false;
}
public override void AddRecipes() //How to craft this sword
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(mod.ItemType("PathogenY"));
recipe.AddIngredient(mod.ItemType("NilSword"));//you need 1 DirtBlock
recipe.AddTile(TileID.LunarCraftingStation); //at work bench
recipe.SetResult(this);
recipe.AddRecipe();
}
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
{
player.AddBuff(mod.BuffType("XBuff"), 2000); //400 is the buff time
}
public override void MeleeEffects(Player player, Rectangle hitbox)
{
if (Main.rand.Next(1) == 0)
{
int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, mod.DustType("XDust"));
}
}
}
}
public override void FindFrame(int frameHeight)
{
npc.frameCounter %= Main.npcFrameCount[npc.type];
int frame = (int)npc.frameCounter;
npc.frame.Y = frame * frameHeight;
frame++;
npc.spriteDirection = npc.direction;
}
From what I can see, you are never changing npc.frameCounter, so npc.frame.Y never changes.Can Some on help I got this but animation don't play
Code:public override void FindFrame(int frameHeight) { npc.frameCounter %= Main.npcFrameCount[npc.type]; int frame = (int)npc.frameCounter; npc.frame.Y = frame * frameHeight; frame++; npc.spriteDirection = npc.direction; }