BipolarProductions
Terrarian
ThanksThis youtube video helped me a lot with making my first mod, this tells you how to add and remove starting items.
ThanksThis youtube video helped me a lot with making my first mod, this tells you how to add and remove starting items.
I’m not quite sure you mean?Is there a way to have a cooldown across several different items?
Like if I use spellbook A, I cannot switch to spellbook B or C and use them either, within 10 seconds.
i'm pretty sure i know what is meant, but no idea HOW to do it, i think they want something like potion sickness, but instead of being for potions, for their specific mage weapons. (i actually want something like this in my own mod, so if this isn't what michaelsoftman meant, I still want it)I’m not quite sure you mean?
i'm pretty sure i know what is meant, but no idea HOW to do it, i think they want something like potion sickness, but instead of being for potions, for their specific mage weapons. (i actually want something like this in my own mod, so if this isn't what michaelsoftman meant, I still want it)
Gotta created a custom buff, I can write the code out for you but idk when I will be able to. I’ll leave notes in it so you know what to do next time.i'm pretty sure i know what is meant, but no idea HOW to do it, i think they want something like potion sickness, but instead of being for potions, for their specific mage weapons. (i actually want something like this in my own mod, so if this isn't what michaelsoftman meant, I still want it)
okayGotta created a custom buff, I can write the code out for you but idk when I will be able to. I’ll leave notes in it so you know what to do next time.
Thank you so much! For some reason I couldn’t find any code but this is pretty helpful!This one is actually pretty easy!
C#:using Terraria; using Terraria.ModLoader; using Terraria.ID; namespace ModName.NPCs { public class ModSlime : ModNPC { public override void SetStaticDefaults() { DisplayName.SetDefault("Slime"); // Replace Slime with a name you want, such as "Orange Slime." } public override void SetDefaults() { //npc.width = 30; // Hitbox width //npc.height = 24; // Hitbox height npc.damage = 6; npc.defense = 0; npc.lifeMax = 14; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.value = 3f; npc.noGravity = false; npc.aiStyle = 1; Main.npcFrameCount[npc.type] = 2; // 2 is the frame count for most slimes. aiType = 1; animationType = 1; //npc.knockBackResist = 0f; // This is optional } } }
i figured it out myself, the buff has no effect itself, it's all in the item's code, just add this hook to the weapons and it should workThat's exactly right. Just a global cooldown for certain weapons, that I can specify. I guess the best way to do it would be a custom buff like potion sickness.
public override bool CanUseItem(Player player)
{
if(Main.LocalPlayer.HasBuff(BuffType<Buffs.BuffGoesHere>()))
return false;
else
return true;
}
using static Terraria.ModLoader.ModContent;
public override bool UseItem(Player player)
{
player.AddBuff(BuffType<Buffs.BuffGoesHere>(), TimeInTicks); // take the amount of seconds you want it to last for and multiply it by 60, as there are 60 ticks in a second
return true;
}
You're welcome!Thank you so much! For some reason I couldn’t find any code but this is pretty helpful!
there IS a friendly flaming arrow projectile, its projectile ID is 2does anyone know how to make an ammo item shoot a friendly vanilla projectile?
To be specific, i want to make an ammo item that will shoot a flaming arrow, however there is no friendly version of it like there is for the wooden arrow and i dont want to make an entire new projectile that perfectly replicates a flaming arrow but is friendly.
using Terraria;
using Terraria.ModLoader;
using static Terraria.ModLoader.ModContent;
using Terraria.ID;
namespace NameTakensMod.Items
{
public class AngelHeart : ModItem
{
public override void SetStaticDefaults() {
Tooltip.SetDefault("Disables Natural Life Regen"
+ "\nFor those who find the game too easy");
}
public override void SetDefaults() {
item.width = 22;
item.height = 20;
item.rare = -12;
item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual) {
player.lifeRegen *= 0;
}
public override bool CanEquipAccessory(Player player, int slot) => Main.expertMode;
}
}
if i use "item.shoot = ProjectileID.FlamingArrow;" within the "SetDefaults()" method of my ammo item, it shoots out a flaming arrow that does damage to me and doesnt damage enemies. I'm not sure whether its the actual arrow that just isnt friendly or there is something wrong that is causing the arrow to hurt me but i assume its the actual flaming arrow projectile.there IS a friendly flaming arrow projectile, its projectile ID is 2
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
namespace EndlessAmmo.Items.Ammo.Arrows
{
class EndlessFlamingQuiver : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Endless Flaming Quiver");
}
public override void SetDefaults()
{
item.damage = 7;
item.shootSpeed = 3.5f;
item.knockBack = 2;
item.ranged = true;
item.width = 32;
item.height = 32;
item.maxStack = 1;
item.consumable = false;
item.value = Item.sellPrice(gold: 1);
item.rare = ItemRarityID.Green;
item.shoot = ProjectileID.FlamingArrow;
//item.shoot = mod.ProjectileType("FriendlyFlamingArrow");
item.ammo = AmmoID.Arrow;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.FlamingArrow, 3996);
recipe.AddTile(TileID.CrystalBall);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
just replace the lineif i use "item.shoot = ProjectileID.FlamingArrow;" within the "SetDefaults()" method of my ammo item, it shoots out a flaming arrow that does damage to me and doesnt damage enemies. I'm not sure whether its the actual arrow that just isnt friendly or there is something wrong that is causing the arrow to hurt me but i assume its the actual flaming arrow projectile.
C#:using Terraria; using Terraria.ModLoader; using Terraria.ID; namespace EndlessAmmo.Items.Ammo.Arrows { class EndlessFlamingQuiver : ModItem { public override void SetStaticDefaults() { DisplayName.SetDefault("Endless Flaming Quiver"); } public override void SetDefaults() { item.damage = 7; item.shootSpeed = 3.5f; item.knockBack = 2; item.ranged = true; item.width = 32; item.height = 32; item.maxStack = 1; item.consumable = false; item.value = Item.sellPrice(gold: 1); item.rare = ItemRarityID.Green; item.shoot = ProjectileID.FlamingArrow; //item.shoot = mod.ProjectileType("FriendlyFlamingArrow"); item.ammo = AmmoID.Arrow; } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.FlamingArrow, 3996); recipe.AddTile(TileID.CrystalBall); recipe.SetResult(this); recipe.AddRecipe(); } } }
item.shoot = ProjectileID.FlamingArrow;
item.shoot = 2;
thanks a tonne for the help, i appreciate it a lot!just replace the line
withC#:item.shoot = ProjectileID.FlamingArrow;
i like to use the number IDs just because i dont need to find any internal names or anything.C#:item.shoot = 2;
Full list of Projectile Number IDs