Yeahfrick
Official Terrarian
aaaaaaaaaaaaaaaaaaaaaaaaaa that so much effortAfter you get hit? For that, you'll need to look into a ModPlayer: tModLoader/tModLoader
aaaaaaaaaaaaaaaaaaaaaaaaaa that so much effortAfter you get hit? For that, you'll need to look into a ModPlayer: tModLoader/tModLoader
If it stresses you too much, you can take a break or stop completely, I won't judge.aaaaaaaaaaaaaaaaaaaaaaaaaa that so much effort
If it stresses you too much, you can take a break or stop completely, I won't judge.
----------------------put
[aCode]
"code here"
[a/code]
just erase the a
Code request?----------------------
It says I have literally 42 ERRORS AND I CODED NOTHING W H A T ?
it works, except for the "player.setBonus = Language.GetTextValue("ArmorSetBonus.Palladium");"You don't need anything special to do this.
In your UpdateArmorSet:
Code:player.setBonus = Language.GetTextValue("ArmorSetBonus.Palladium"); player.onHitRegen = true;
is there some way to modify player knockback through an accessory? I found something called .GetWeaponKnockback but I can’t figure out how to set it up properly or even if it would do what i want anyway.
public bool knockbackAccessory;
player.GetModPlayer<your ModPlayer file name here>().your variable here = true;
public override void GetWeaponKnockback(Item item, ref float knockback)
{
if (knockbackAccessory) { knockback *= 999; }
}
I'd like to have my sword swing fast with a delay between each swing. My assumption was that I could have useTime be longer than useAnimation to achieve this effect, but that doesn't seem to be the case. I've also tinkered around with reuseDelay to no avail. Any suggestions?
.WithPitchVariance(0f)
, which doesn't seem to work.You would probably do this in a ModPlayer class. You should carefully read over what ExampleMod tells you in its SimpleModPlayer file, but what you basically do is this:
Create a public variable in the ModPlayer class that your accessory changes. Say you make it a bool titled knockbackAccessory:public bool knockbackAccessory;
Then in the ResetEffects method in your ModPlayer class, set it to false. This is essentially where you place the default value of your knockbackAccessory variable.
To have your accessory update this, you want to put this line in its UpdateAccessory:player.GetModPlayer<your ModPlayer file name here>().your variable here = true;
Now to make it increase knockback.
In the ModPlayer class, you can use the GetWeaponKnockback to increase the knockback value of your attack only if knockbackAccessory is true:
C#:public override void GetWeaponKnockback(Item item, ref float knockback) { if (knockbackAccessory) { knockback *= 999; } }
I've only started modding recently, but it seems all the fun stuff happens in the ModPlayer class. I'd recommend getting really comfortable with it.
Good luck!
Does anyone know how to add a recipe to a vanilla item?
use MeleeEffects in your weapon file. This is what I use for some purple dust on my weapon:Is there a way I could add a dust/particle trail to a melee weapon? Or maybe spawn a small explosion at a certain point in it’s arc?
public override void MeleeEffects(Player player, Rectangle hitbox){
if (Main.rand.NextFloat() < 0.1) { //10% chance each frame to spawn dust
Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 21, 0f, 0f, 0, new Color(255, 255, 255), 0.72f);
use MeleeEffects in your weapon file. This is what I use for some purple dust on my weapon:
If you want an explosion that's cosmetic only, I guess you could use dust. I think doing a simple incrementing integer with a specific hitbox for the dust so that it spawns in a certain place and time would do the trick.C#:public override void MeleeEffects(Player player, Rectangle hitbox){ if (Main.rand.NextFloat() < 0.1) { //10% chance each frame to spawn dust Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 21, 0f, 0f, 0, new Color(255, 255, 255), 0.72f);
If you want to have the explosion deal damage you should look into creating projectiles or using preexisting AI. You might be able to put that in MeleeEffects as well, but I'm not sure.
The only experience I have with NPCs is through ExampleMod, so I don't know where your issues might be coming from. Maybe try using the sprites they use and double check that the textures are defined correctly.