BlueWaterMelon
Golem
can someone help me how to make a yo yo 
I mean the GetTexture stuff. I have no idea how to use it on items.What do you mean by "define an item's texture"? Do you mean like loading a texture?
This is helpful info, I'll see if there's something in there I can use.From all my decompiling and stuff, the item is actually drawn using the PlayerLayer, so try the player hooks and check out, if you have ilSpy or have the source, check out the DrawPlayer() method in the Player class and use the find function and search item and you'll see the whole thing.
You shouldn't ever need to use that. Just set autoload to true in the mod properties and Textures will be automatically bound to the item/npc/projectileI mean the GetTexture stuff. I have no idea how to use it on items.
Thank you, it works now.You shouldn't ever need to use that. Just set autoload to true in the mod properties and Textures will be automatically bound to the item/npc/projectile
For example, if your class is named ExampleItem and the namespace is ExampleMod.Items.Weapons, autoload will look in the Mod Sources/ExampleMod/Items/Weapons/ folder for a file named ExampleItem.png.
You don't need to manually set textures.
Use this to get a barebones Mod where you can see autoload in action: javid.ddns.net/tModLoader/generator/ModSkeletonGenerator.html
does anyone know ho to make a yo yo
does anyone know how to code a boss like skeletron
Download and use ILSpy to decompile the vanilla .exe
public override void UpdateEquip(Item item, Player player)
{
for (int k = 0; k < 3; k++)
{
if (player.armor[k].type == ItemID.ObsidianHelm)
{
player.rangedDamage = player.rangedDamage + 0.06f;
player.rangedCrit = player.rangedCrit + 3;
}
if (player.armor[k].type == ItemID.ObsidianShirt)
{
player.rangedDamage = player.rangedDamage + 0.07f;
player.rangedCrit = player.rangedCrit + 4;
}
if (player.armor[k].type == ItemID.ObsidianPants)
{
player.rangedDamage = player.rangedDamage + 0.06f;
player.rangedCrit = player.rangedCrit + 2;
player.moveSpeed = player.moveSpeed + 0.03f;
}
}
}
That's because you're looping 3 times.Well, I have some kind of strange bug or something.
So, I have this code:
It raises player characterisitics if he wears obsidian armor.Code:public override void UpdateEquip(Item item, Player player) { for (int k = 0; k < 3; k++) { if (player.armor[k].type == ItemID.ObsidianHelm) { player.rangedDamage = player.rangedDamage + 0.06f; player.rangedCrit = player.rangedCrit + 3; } if (player.armor[k].type == ItemID.ObsidianShirt) { player.rangedDamage = player.rangedDamage + 0.07f; player.rangedCrit = player.rangedCrit + 4; } if (player.armor[k].type == ItemID.ObsidianPants) { player.rangedDamage = player.rangedDamage + 0.06f; player.rangedCrit = player.rangedCrit + 2; player.moveSpeed = player.moveSpeed + 0.03f; } } }
BUT when I test it, all characteristics seems to be applied 3 times(!!!).
Look:View attachment 102628/View attachment 102629
That's because you're looping 3 times.
I assume this code is on a GlobalItem? If so, remove the for loop and just check if(item.type == blabla) no need to loop through the armor, since the function you're using is already called for each individual piece of equipment.
my projectile for my magic weapon wont deal damage to hostile mobs no matter what i do
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace BMod.Projectiles
{
public class BStaff0Proj : ModProjectile
{
public override void SetDefaults()
{
projectile.name = "BStaff 0% Power Projectile";
projectile.width = 6;
projectile.height = 6;
projectile.alpha = 255;
projectile.timeLeft = 600;
projectile.penetrate = 1;
projectile.hostile = false;
projectile.magic = true;
projectile.tileCollide = true;
projectile.ignoreWater = true;
}
public override void AI()
{
if (projectile.localAI[0] == 0f)
{
PlaySound();
if (projectile.ai[0] < 0f)
{
projectile.alpha = 0;
projectile.damage = 0;
}
if (projectile.ai[0] == 44f)
{
projectile.coldDamage = true;
projectile.damage = 0;
}
if (projectile.ai[0] < 0f && Main.expertMode)
{
cooldownSlot = 1;
projectile.damage = 0;
}
projectile.localAI[0] = 1f;
}
}
public virtual void PlaySound()
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20);
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
if ((Main.expertMode || Main.rand.Next(2) == 0) && projectile.ai[0] >= 0f)
{
target.AddBuff((int)projectile.ai[0], (int)projectile.ai[1], true);
}
}
}
}
1. Not sure, you may have to wait for UI support.Hi I have few questions:
1) Is there any way how to change item tooltip color?
2) Can I get currently selected item?
Item selectedItem = player.inventory[player.selectedItem];
Could you show us some context code?Need help making a robe:
Can get this to work.Code:public override void SetMatch(ref int equipSlot, ref bool robes){ EquipTexture eq = EquipLoader.GetEquipTexture(EquipType.Legs,mod.GetEquipSlot("SpectralPants")); equipSlot = eq.Slot; robes = true; }