Skaro
Official Terrarian
What do you mean? Like make it magic weapon?Where do you add the item classes?
What do you mean? Like make it magic weapon?Where do you add the item classes?
https://github.com/bluemagic123/tModLoader/blob/master/ExampleMod/ExampleMod.cs#L25How do you set AutoLoad to true?
The code you posted earlier specifically was programmed against that, just delete the CheckConditions.How do I make it to where my NPCs can move into a house made out of any blocks, instead of just wood?
What do you mean by 'armor buffs'? Could you please specify?hello i'm new to modding and i think it's pretty easy but i do have a problem, i cant seem to find the code for armor buffs anywhere on the internet. can a brother get some help please!
im talking about buffs like immune to fire and such things like thatWhat do you mean by 'armor buffs'? Could you please specify?
Immunity to the 'On Fire!' debuff is actually not prevented by another buff.im talking about buffs like immune to fire and such things like that
player.buffImmune[BuffID.OnFire] = true;
If you want to know how yoyo's work (and thus make custom yoyo's) you'll have to understand the code/AI behind it.I don't really understand your guide to the yoyos... how do you make fully custom yoyos?
yoyo's are a bit weird. The easiest thing is to make your own ModItem can clone the defaults of the wooden yoyo. this is the base for all yoyo's in the game. the aiStyle takes care of it actually being a yoyo.I don't really understand your guide to the yoyos... how do you make fully custom yoyos?
So I basically want my sword to make it's projectile come from the sky from above enemies when the blade makes contact with enemies
I would also like to know how to make a projectile spawn another projectile on the projectile's death
public override void Kill(Int timeLeft)
{
Projectile.NewProjectile(positionX, positionY, velocityX, velocityY, type, damage, knockback, owner, ai[0], ai[1]); //Note, fill in the properties yourself.
}
public virtual void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit)
{
Projectile.NewProjectile(target.position.X, target.positionY - 100f, 0, 8, int type, int damage, float knockBack, Main.myPlayer, 0f, 0f);
}
Projectile.NewProjectile(float positionX, float positionY, float velocityX, float velocityY, int type, int damage, float knockBack, int owner, float ai[0], float ai[1]);
I got this errorFor spawning another projectile to spawn from a projectile's death, you use this code...
For projectile C# file
Code:public override void Kill(Int timeLeft) { Projectile.NewProjectile(positionX, positionY, velocityX, velocityY, type, damage, knockback, owner, ai[0], ai[1]); //Note, fill in the properties yourself. }
And for when your blade hits an enemy you want to spawn a projectile...
For item C# file
Code:public virtual void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit) { Projectile.NewProjectile(target.position.X, target.positionY - 100f, 0, 8, int type, int damage, float knockBack, Main.myPlayer, 0f, 0f); }
Projectile.NewProjectile requires...
Code:Projectile.NewProjectile(float positionX, float positionY, float velocityX, float velocityY, int type, int damage, float knockBack, int owner, float ai[0], float ai[1]);
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace TEM.Items.Hardmode.Weapons
{
public class Apophis : ModItem
{
public override void SetDefaults()
{
item.name = "Apophis";
item.damage = 100;
item.melee = true;
item.width = 66;
item.height = 66;
item.useTime = 20;
item.useAnimation = 20;
item.useStyle = 1;
item.knockBack = 10;
item.value = 0;
item.rare = 10;
item.useSound = 1;
item.autoReuse = true;
item.shootSpeed = 10;
item.shoot = mod.ProjectileType("ApophisRock");
}
public override Color? GetAlpha(Color lightColor)
{
return Color.White;
}
public virtual void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit)
{
Projectile.NewProjectile(target.position.X, target.positionY - 100f, 0, 8, int type, int damage, float knockBack, Main.myPlayer, 0f, 0f);
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.FragmentSolar, 18);
recipe.AddTile(TileID.LunarCraftingStation);
recipe.SetResult(this, 1);
recipe.AddRecipe();
}
}
}
I got this error
View attachment 94528
My code
Code:using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace TEM.Items.Hardmode.Weapons { public class Apophis : ModItem { public override void SetDefaults() { item.name = "Apophis"; item.damage = 100; item.melee = true; item.width = 66; item.height = 66; item.useTime = 20; item.useAnimation = 20; item.useStyle = 1; item.knockBack = 10; item.value = 0; item.rare = 10; item.useSound = 1; item.autoReuse = true; item.shootSpeed = 10; item.shoot = mod.ProjectileType("ApophisRock"); } public override Color? GetAlpha(Color lightColor) { return Color.White; } public virtual void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit) { Projectile.NewProjectile(target.position.X, target.positionY - 100f, 0, 8, int type, int damage, float knockBack, Main.myPlayer, 0f, 0f); } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.FragmentSolar, 18); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this, 1); recipe.AddRecipe(); } } }
You gotta set the parameters of the stuff in the parenthesis. int type, just set to your projhectile with item.shoot and make your int damage an integer like 10, float knockBack like 4f. Also set the where you see the 0 and 8 are velocity X and the velocity Y respectively. So set them with a float number.
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace TEM.Items.Hardmode.Weapons
{
public class Apophis : ModItem
{
public override void SetDefaults()
{
item.name = "Apophis";
item.damage = 100;
item.melee = true;
item.width = 66;
item.height = 66;
item.useTime = 20;
item.useAnimation = 20;
item.useStyle = 1;
item.knockBack = 10;
item.value = 0;
item.rare = 10;
item.useSound = 1;
item.autoReuse = true;
item.shootSpeed = 10;
item.shoot = mod.ProjectileType("ApophisRock");
}
public override Color? GetAlpha(Color lightColor)
{
return Color.White;
}
public virtual void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit)
{
Projectile.NewProjectile(target.position.X, target.positionY - 100f, 0, 8, mod.ProjectileType("ApophisRock"), 10, 4f, Main.myPlayer, 0f, 0f);
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.FragmentSolar, 18);
recipe.AddTile(TileID.LunarCraftingStation);
recipe.SetResult(this, 1);
recipe.AddRecipe();
}
}
}
It seems I forgot to put a "." between "position" and "y".I built that and got this errorCode:using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace TEM.Items.Hardmode.Weapons { public class Apophis : ModItem { public override void SetDefaults() { item.name = "Apophis"; item.damage = 100; item.melee = true; item.width = 66; item.height = 66; item.useTime = 20; item.useAnimation = 20; item.useStyle = 1; item.knockBack = 10; item.value = 0; item.rare = 10; item.useSound = 1; item.autoReuse = true; item.shootSpeed = 10; item.shoot = mod.ProjectileType("ApophisRock"); } public override Color? GetAlpha(Color lightColor) { return Color.White; } public virtual void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit) { Projectile.NewProjectile(target.position.X, target.positionY - 100f, 0, 8, mod.ProjectileType("ApophisRock"), 10, 4f, Main.myPlayer, 0f, 0f); } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.FragmentSolar, 18); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this, 1); recipe.AddRecipe(); } } }
View attachment 94541