Here's an example:is there a possibility to make an item drop from a certain enemy after defeating, for example, plantera?
ive tried to look it up in example mod but i didnt get a clue from that
if (npc.type == NPCID.Spazmatism)
{
if (NPC.downedPlantBoss)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Chaparral"), 1);
Thanks I had all the tension. Luckily GameLauncher saved metModLoader has not yet updated. Expected an update later today. Have patience, we are hobbyists on this project after all.
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace LegendOfMutater.Items.Summoner
{
public class SuspiciousLookingCloud : ModItem
{
public override void SetDefaults()
{
item.name = "Suspicious Looking Cloud";
item.width = 20;
item.height = 20;
item.maxStack = 1;
AddTooltip("Summons the Sky Lord");
item.value = 1000;
item.rare = 1;
item.useAnimation = 30;
item.useTime = 30;
item.useStyle = 4;
item.consumable = true;
}
public override bool CanUseItem(Player player)
{
return !NPC.AnyNPCs(mod.NPCType("SkyLord"));
}
public override bool UseItem(Player player)
{
NPC.SpawnOnPlayer(player.whoAmI, mod.NPCType("SkyLord"));
Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0);
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(2, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
public override bool UseItem(Player player) Not returns booleanI have a problem:
I am getting an error that says
c:\Users\...\Documents\My Games\Terraria\ModLoader\Mod Sources\LegendOfMutater\Items\Summoner\SuspiciousLookingCloud.cs(27,24) : error CS0161: 'LegendOfMutater.Items.Summoner.SuspiciousLookingCloud.UseItem(Terraria.Player)': not all code paths return a value
My code is:
[doublepost=1469201177,1469200988][/doublepost]Where is ma signature?Code:using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace LegendOfMutater.Items.Summoner { public class SuspiciousLookingCloud : ModItem { public override void SetDefaults() { item.name = "Suspicious Looking Cloud"; item.width = 20; item.height = 20; item.maxStack = 1; AddTooltip("Summons the Sky Lord"); item.value = 1000; item.rare = 1; item.useAnimation = 30; item.useTime = 30; item.useStyle = 4; item.consumable = true; } public override bool CanUseItem(Player player) { return !NPC.AnyNPCs(mod.NPCType("SkyLord")); } public override bool UseItem(Player player) { NPC.SpawnOnPlayer(player.whoAmI, mod.NPCType("SkyLord")); Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0); } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(2, 1); recipe.AddTile(TileID.WorkBenches); recipe.SetResult(this); recipe.AddRecipe(); } } }
That doesn't help at all. Can you tell me any way to fix it?I have a problem:
I am getting an error that says
c:\Users\...\Documents\My Games\Terraria\ModLoader\Mod Sources\LegendOfMutater\Items\Summoner\SuspiciousLookingCloud.cs(27,24) : error CS0161: 'LegendOfMutater.Items.Summoner.SuspiciousLookingCloud.UseItem(Terraria.Player)': not all code paths return a value
My code is:
[doublepost=1469201177,1469200988][/doublepost]Where is ma signature?Code:using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace LegendOfMutater.Items.Summoner { public class SuspiciousLookingCloud : ModItem { public override void SetDefaults() { item.name = "Suspicious Looking Cloud"; item.width = 20; item.height = 20; item.maxStack = 1; AddTooltip("Summons the Sky Lord"); item.value = 1000; item.rare = 1; item.useAnimation = 30; item.useTime = 30; item.useStyle = 4; item.consumable = true; } public override bool CanUseItem(Player player) { return !NPC.AnyNPCs(mod.NPCType("SkyLord")); } public override bool UseItem(Player player) { NPC.SpawnOnPlayer(player.whoAmI, mod.NPCType("SkyLord")); Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0); } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(2, 1); recipe.AddTile(TileID.WorkBenches); recipe.SetResult(this); recipe.AddRecipe(); } } }
return true;That doesn't help at all. Can you tell me any way to fix it?
This is something being added in the next update. The ExampleMod will have an example on how to use it.On Github i saw WaterStyle. Is it 'new water' method? If so, how to use it?
We're waiting only on trees/cacti hooks.are we waiting on "general game hooks" or "hooks for trees and cacti"?
Estimated release tomorrow.So how long the update last