You need to install VS 2022 and then open the csproj
To install it correctly, read this:
Developing with Visual Studio · tModLoader/tModLoader Wiki
Thank you, this worked. Unfortunately, there is another error. I am unsure if it is because it handles things differently in the new update, or I just did the code wrong, take a look and see for yourself.
What the error screen says:
Error CS1061: 'Mod' does not contain a definition for 'ProjectileType' and no accessible extension method 'ProjectileType' accepting a first argument of type 'Mod' could not be found
My code for the file at fault:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace AndruidsAdditions.Items
{
public class GelBook : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Book of Gel"); // By default, capitalization in classnames will add spaces to the display name. You can customize the display name here by uncommenting this line.
Tooltip.SetDefault("Casts a ball of slime");
}
public override void SetDefaults()
{
Item.damage = 14;
Item.mana = 5;
Item.DamageType = DamageClass.Magic;
Item.width = 40;
Item.height = 40;
Item.useTime = 30;
Item.useAnimation = 30;
Item.useStyle = 5;
Item.knockBack = 2;
Item.value = 1200;
Item.rare = 1;
Item.UseSound = SoundID.Item8;
Item.autoReuse = true;
Item.shoot = Mod.ProjectileType("SpikeofGel");
Item.shootSpeed = 5f;
Item.noMelee = true;
}
public override void AddRecipes()
{
Recipe recipe = CreateRecipe();
recipe.AddIngredient(ItemID.Gel, 10);
recipe.AddTile(TileID.WorkBenches);
recipe.Register();
}
}
}
Code for the custom projectile referenced:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;
namespace AndruidsAdditions.Projectiles
{
public class SpikeofGel : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Spike of Gel"); // By default, capitalization in classnames will add spaces to the display name. You can customize the display name here by uncommenting this line.
}
public override void SetDefaults()
{
Projectile.width = 8;
Projectile.height = 8;
Projectile.aiStyle = 1;
Projectile.friendly = true;
Projectile.hostile = false;
Projectile.penetrate = 2;
Projectile.timeLeft = 600;
Projectile.light = 0f;
Projectile.ignoreWater = false;
Projectile.tileCollide = true;
}
public override void AI()
{
int dust = Dust.NewDust(Projectile.Center, 1, 1, 103, 0f, 0f, 0, default(Color), 1f);
Main.dust[dust].velocity *= 0.2f;
Main.dust[dust].scale = (float)Main.rand.Next(80, 115) * 0.013f;
Main.dust[dust].noGravity = false;
}
}
}
Any help is appreciated, thank you for your time.