public override bool UseItem(Player player)
{
Main.NewText("UseItem");
Console.WriteLine("UseItem");
//ect...
In my experience, Main.NewText itself should be called on the server (same as when the server displays the chat input of every player).Hi, I've run into a bit of a problem. I've been working on one part of my mod, and recently tested an item that I have had working for months now. It is still working fine in single player, but has stopped working in multiplayer altogether. I did a little bit of debugging, and found that the hook UseItem doesn't seem to be called on a server anymore. I used the following code to test this.
My mod is kind of dependant of this being called on the server. Is there some reason why this and several other item related hooks are no longer being called on the server, or has Console.WriteLine been disabled somehow?Code:public override bool UseItem(Player player) { Main.NewText("UseItem"); Console.WriteLine("UseItem"); //ect...
Thank you for your time.
I don't know how to do the sprite thing, but this should work for the rest of the stuff.guys im back and i need help AGAIN.
so, i wanna make a Buff, given by a potion called "Ancient Waters", the Buff is Called Pandolars Blessing and it should give +50 max health, +2 increased regen, and 15% more dmg on everything, ontop of that a sprite is displayed above the buffed player (its a Pandolar God, with little dust below it)
you dont need to put the whole code there for me to copy, u can if u want, but a few codes here and there and explanation where to put em would be nice, i think the stuff with the sprite above the player is similar to how a sprite is displayed on a boss when its low health (like al0n37 showed in his Boss Second Stage video).
thx for the replies! ^-^
public override void Update(Player player, ref int buffIndex)
{
player.lifeRegen += 2;
player.statLifeMax2 += 50;
player.magicDamage += 0.15f;
player.meleeDamage += 0.15f;
player.rangedDamage += 0.15f;
player.thrownDamage += 0.15f;
player.minionDamage += 0.15f;
}
using Terraria;
using Terraria.ModLoader;
using SacredTools.NPCs;
namespace SacredTools.Buffs
{
public class PandolarBuff : ModBuff
{
public override void SetDefaults()
{
Main.buffName[Type] = "Blessing of the Pandolars";
Main.buffTip[Type] = "the almighty Pandolars gave you a blessing...";
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
longerExpertDebuff = false;
}
public override void Update(Player player, ref int buffIndex)
{
player.lifeRegen += 2;
player.statLifeMax2 += 50;
player.magicDamage += 0.15f;
player.meleeDamage += 0.15f;
player.rangedDamage += 0.15f;
player.thrownDamage += 0.15f;
player.minionDamage += 0.15f;
//Example:
if (Main.rand.Next(2) == 0)
{
int idx= Dust.NewDust(player.position, player.width, player.height, mod.DustType("PandolarDust"));
Main.dust[idx].noGravity = true;
}
}
}
}
um, i still dont know the code how to make the sprite...
pls put it into my code...
(srry, this is the thing im not very good at, FINDING stuff ._.)
Code:using Terraria; using Terraria.ModLoader; using SacredTools.NPCs; namespace SacredTools.Buffs { public class PandolarBuff : ModBuff { public override void SetDefaults() { Main.buffName[Type] = "Blessing of the Pandolars"; Main.buffTip[Type] = "the almighty Pandolars gave you a blessing..."; Main.debuff[Type] = false; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; longerExpertDebuff = false; } public override void Update(Player player, ref int buffIndex) { player.lifeRegen += 2; player.statLifeMax2 += 50; player.magicDamage += 0.15f; player.meleeDamage += 0.15f; player.rangedDamage += 0.15f; player.thrownDamage += 0.15f; player.minionDamage += 0.15f; //Example: if (Main.rand.Next(2) == 0) { int idx= Dust.NewDust(player.position, player.width, player.height, mod.DustType("PandolarDust")); Main.dust[idx].noGravity = true; } } } }
the file name for the Sprite is PandolarGod.png and its in the Buffs folder (or does it need to be somewhere else?)
I do not understand your question.............HELP I cant go to Terrarai it not letting me ???
It keep saying go to steam client but I do that and it still NOT working ;-; HELP!!!!
If the mod include ores when you generate the world, yes, you need.Heyo, I have a question.
Do I have to create a new map every time I install a mod? ( Talking about the ores and so on )
Thanks
public override void FindFrame(int frameHeight)
{
npc.frameCounter++;
if (npc.frameCounter >= ##) // Height of frame in pixels
{
npc.frame.Y = (npc.frame.Y + 50);
npc.frameCounter = 0;
}
if (npc.frame.Y >= ###) // the pixel number from top of png of where to end the animation loop
{
npc.frame.Y = 0;
}
}