could you help me and please tell me what i need to change? my staff code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace mod_terraria_another_dimension.items (my mod).Weapons (my mod)
{
public class the heart cooler : ModItem
{
public override void SetStaticDefaults() {
Tooltip.SetDefault("cool your enemys heart");
Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun
}
public override void SetDefaults() {
item.damage = 11;
item.magic = true;
item.mana = 7;
item.width = 40;
item.height = 40;
item.useTime = 25;
item.useAnimation = 25;
item.useStyle = 5;
item.noMelee = true; //so the item's animation doesn't do damage
item.knockBack = 5;
item.value = 10000;
item.rare = 2;
item.UseSound = SoundID.Item29;
item.autoReuse = true;
item.shoot = mod.ProjectileType("the heart cooler proj");
item.shootSpeed = 16f;
}
public override void AddRecipes() {
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(mod.ItemType("Snow Block"), 15); //you can make multiple needed recipes by pressing the enter button and writing the same thing but whith an other item and maybe a different amoutn of the item!!!!!!!
recipe.AddIngredient(mod.ItemType("Ice Block"), 15);
recipe.AddIngredient(mod.ItemType("Lesser Mana Potion"), 7);
recipe.AddTile(mod.TileType("WorkBenches"));
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
my projectile code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace mod_terraria_another_dimension.Projectiles (my mod)
{
public class the heart cooler proj : ModProjectile
{
public override void SetDefaults() {
projectile.width = 16;
projectile.height = 16;
projectile.friendly = true;
projectile.magic = true;
projectile.penetrate = 3;
projectile.timeLeft = 600;
}
public override void AI() {
projectile.velocity.Y += projectile.ai[0];
if (Main.rand.NextBool(3)) {
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("the heart cooler proj dust"), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
}
}
public override bool OnTileCollide(Vector2 oldVelocity) {
projectile.penetrate--;
if (projectile.penetrate <= 0) {
projectile.Kill();
}
else {
projectile.ai[0] += 0.1f;
if (projectile.velocity.X != oldVelocity.X) {
projectile.velocity.X = -oldVelocity.X;
}
if (projectile.velocity.Y != oldVelocity.Y) {
projectile.velocity.Y = -oldVelocity.Y;
}
projectile.velocity *= 0.75f;
Main.PlaySound(SoundID.Item10, projectile.position);
}
return false;
}
public override void Kill(int timeLeft) {
for (int k = 0; k < 5; k++) {
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("the heart cooler proj dust"), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f);
}
Main.PlaySound(SoundID.Item25, projectile.position);
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) {
projectile.ai[0] += 0.1f;
projectile.velocity *= 0.75f;
}
}
}
my projectile dust code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace mod_terraria_another_dimension.Dusts (my mod)
{
public class the heart cooler proj dust : ModDust
{
public override void OnSpawn(Dust dust) {
dust.noLight = true;
dust.color = new Color(200, 220, 230);
dust.scale = 1.2f;
dust.noGravity = true;
dust.velocity /= 2f;
dust.alpha = 100;
}
public override bool Update(Dust dust) {
dust.position += dust.velocity;
dust.rotation += dust.velocity.X;
Lighting.AddLight((int)(dust.position.X / 16f), (int)(dust.position.Y / 16f), 0.05f, 0.15f, 0.2f);
dust.scale -= 0.03f;
if (dust.scale < 0.5f) {
dust.active = false;
}
return false;
}
}
}
IAM using notepad++ and i did find these codes in here:
https://github.com/blushiemagic/tModLoader/tree/master/ExampleMod
i did turn the files into .cs files btw and here are my sprites (please DO NOT steal these sprites!!!!! piskel IS free!!!!!) my staff sprite:
https://www.piskelapp.com/p/agxzfnBpc2tlbC1hcHByEwsSBlBpc2tlbBiAgKCm2678Cww/view
my projectile sprite:
https://www.piskelapp.com/p/agxzfnBpc2tlbC1hcHByEwsSBlBpc2tlbBiAgKCGzMXrCww/view
my projectile dust sprite:
https://www.piskelapp.com/p/agxzfnBpc2tlbC1hcHByEwsSBlBpc2tlbBiAgKD6ruLaCgw/view
the error:
c:\Users\\Documents\My Games\Terraria\ModLoader\Mod Sources\mod_terraria_another_dimension\Dusts (my mod)\the heart cooler proj dust.cs(5,48) : error CS1514: { erwartet.
c:\Users\\Documents\My Games\Terraria\ModLoader\Mod Sources\mod_terraria_another_dimension\Dusts (my mod)\the heart cooler proj dust.cs(7,19) : error CS1514: { erwartet.
c:\Users\\Documents\My Games\Terraria\ModLoader\Mod Sources\mod_terraria_another_dimension\Dusts (my mod)\the heart cooler proj dust.cs(7,32) : error CS1002: ; erwartet.
c:\Users\\Documents\My Games\Terraria\ModLoader\Mod Sources\mod_terraria_another_dimension\Dusts (my mod)\the heart cooler proj dust.cs(7,42) : error CS1002: ; erwartet.
c:\Users\\Documents\My Games\Terraria\ModLoader\Mod Sources\mod_terraria_another_dimension\Dusts (my mod)\the heart cooler proj dust.cs(8,2) : error CS1519: Ungültiges Token '{' in Klasse, Struktur oder Schnittstellenmemberdeklaration.
c:\Users\\Documents\My Games\Terraria\ModLoader\Mod Sources\mod_terraria_another_dimension\items (my mod)\Weapons (my mod)\the heart cooler.cs(5,48) : error CS1514: { erwartet.
c:\Users\\Documents\My Games\Terraria\ModLoader\Mod Sources\mod_terraria_another_dimension\items (my mod)\Weapons (my mod)\the heart cooler.cs(7,19) : error CS1514: { erwartet.
c:\Users\\Documents\My Games\Terraria\ModLoader\Mod Sources\mod_terraria_another_dimension\items (my mod)\Weapons (my mod)\the heart cooler.cs(7,32) : error CS1002: ; erwartet.
c:\Users\\Documents\My Games\Terraria\ModLoader\Mod Sources\mod_terraria_another_dimension\items (my mod)\Weapons (my mod)\the heart cooler.cs(8,2) : error CS1519: Ungültiges Token '{' in Klasse, Struktur oder Schnittstellenmemberdeklaration.
c:\Users\\Documents\My Games\Terraria\ModLoader\Mod Sources\mod_terraria_another_dimension\Projectiles (my mod)\the heart cooler proj.cs(6,54) : error CS1514: { erwartet.
c:\Users\\Documents\My Games\Terraria\ModLoader\Mod Sources\mod_terraria_another_dimension\Projectiles (my mod)\the heart cooler proj.cs(8,19) : error CS1514: { erwartet.
c:\Users\\Documents\My Games\Terraria\ModLoader\Mod Sources\mod_terraria_another_dimension\Projectiles (my mod)\the heart cooler proj.cs(8,32) : error CS1002: ; erwartet.
c:\Users\\Documents\My Games\Terraria\ModLoader\Mod Sources\mod_terraria_another_dimension\Projectiles (my mod)\the heart cooler proj.cs(8,37) : error CS1519: Ungültiges Token ':' in Klasse, Struktur oder Schnittstellenmemberdeklaration.
c:\Users\\Documents\My Games\Terraria\ModLoader\Mod Sources\mod_terraria_another_dimension\Projectiles (my mod)\the heart cooler proj.cs(9,2) : error CS1519: Ungültiges Token '{' in Klasse, Struktur oder Schnittstellenmemberdeklaration.
it would be nice if ANYONE could help me out please dont reply with i dont know how to fix this if you dont know!!!! thank you!!!!
sorry cause of the spaces!!!!!