public class Circut Board : ModItem
recipe AddIngredient(Terraria.ID.ItemID.Iron Bar, 1);
recipe.AddRecipe(LivenUP.ID.ItemID.Shattered Television, 1)
While we're at it, you need to remove the spaces after recipe: you are calling the methods AddIngredient and AddTile from the ModRecipe instance named recipe, that's what the period is for.recipe AddIngredient(Terraria.ID.ItemID.Iron Bar, 1);
recipe AddTile(Terraria.ID.TileID.Anvil);
I'm not American, so idfk how you spell it. I am European, and circut is how I learned to spell it, but since you want it changed, fine.
So then I'm assuming then it has to be for instance, recipe.AddWhatever(thisisuseless), not recipe AddWhatever (thisisuseless)?
Also, sell price for 25000 should equal 2 gold 50 silver right?
And now to change everything AGAIN....... alright coding sucks what else can I do?![]()
Yes I can and yes I will.Can anyone tell me how to make a vanilla boss drop a modded item?
public override void NPCLoot(NPC npc)
{
if(npc.type == NPCID.BossName)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ItemName"), 1);
}
}
Ok, I'll try it, but I'm not sure how to make something a child of something else. Could you tell me how?Yes I can and yes I will.
First, you need to make a new class, make it a child of GlobalNPC.
Then, put this in it:
Replace BossName with the name of the boss you want to drop the item, and ItemName with the name of the item you want dropped.Code:public override void NPCLoot(NPC npc) { if(npc.type == NPCID.BossName) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ItemName"), 1); } }
Please let me know if this works for you.![]()
Ok, I'll try it, but I'm not sure how to make something a child of something else. Could you tell me how?
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
namespace ModName
{
public class MyGlobalNPC : GlobalNPC
{
public override void NPCLoot(NPC npc)
{
if(npc.type == NPCID.BossName)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ItemName"), 1);
}
}
}
}
You don't have a mod class is what this usually isSequence contains no matching element
at System.Linq.Enumerable.Single[TSource](1Enumerable)`1 source, Func`2 predicate)
at Terraria.Modloader.AssemblyManager.InstantiateMods(List`1modsToLoad)
Found the parameters under Main. Sort of expected to see them in Player, but I didn't. Well, at least now I know how they spawn the cultists!Well why don't you look at the paremeters? I believe, pos x, pos y, type, damage, knockback
From there on I dunno.. but just check the parameters.. lol
Hmm... it didn't work... this is the code and the error code:Yes, after the class declaration, you have to put a colon and then the name of the parent class, namely GlobalNPC.
So, if you were to call this class MyGlobalNPC, you should get something like this:
Code:using Terraria; using Terraria.ModLoader; using Terraria.ID; namespace ModName { public class MyGlobalNPC : GlobalNPC { public override void NPCLoot(NPC npc) { if(npc.type == NPCID.BossName) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ItemName"), 1); } } } }
A Mod class would look like this:@Jeckel What are mod classes and where to find them? I'm almost done with the MAIN crafting recipes, which the main part of the mod is to add a boss with unique items.
using Microsoft.Xna.Framework.Graphics;
using Terraria.ModLoader;
using Terraria;
using Microsoft.Xna.Framework;
namespace CaveStory
{
class CaveStory : Mod
{
public CaveStory()
{
Properties = new ModProperties()
{
Autoload = true,
AutoloadGores = true,
AutoloadSounds = true
};
}
}
}