Making a projectile sword

yudgefudge

The Destroyer
How do I make a sword that fires Meowmere-like projectiles? The code below is for a beetle sword with those properties:

C#:
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace BeetleBladeBlast.Projectiles
{

    public class BeetleBladeBlast : ModProjectile
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("Big Beetle Boi");
        }

        public override void SetDefaults()
        {
            projectile.arrow = false;
            projectile.width = 22;
            projectile.height = 18;
            projectile.aiStyle = 8;
            projectile.friendly = true;
            projectile.melee = true;
            aiType = 715.BeetleBladeBlast;
        }
    }

And it keeps giving this error:
error 2.png

How do I fix this?
 
That error is caused by your last line having '715.BeetleBladeBlast'. Not sure what you're attempting there, but that's not valid C# code.
 
Based it off this:
public override void SetDefaults()
{
projectile.arrow = true;
projectile.width = 10;
projectile.height = 10;
projectile.aiStyle = 1;
projectile.friendly = true;
projectile.ranged = true;
aiType = ProjectileID.WoodenArrowFriendly;
}
The example mod for projectiles.
My projectile ID is 715, and the AI BeetleBladeBlast.
 
Based it off this:
public override void SetDefaults()
{
projectile.arrow = true;
projectile.width = 10;
projectile.height = 10;
projectile.aiStyle = 1;
projectile.friendly = true;
projectile.ranged = true;
aiType = ProjectileID.WoodenArrowFriendly;
}
The example mod for projectiles.
My projectile ID is 715, and the AI BeetleBladeBlast.
That's not how it works - ProjectileID is the class that WoodenArrowFriendly is a property of. It's not saying to replace ProjectileID with the actual ID. Try ProjectileID.BeetleBladeBlast.
 
I rewrote some stuff, and this is what I used:
C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Terraria;
using Terraria.ModLoader;
using Terraria.ID;

namespace DannyDraws.Projectiles
{
    class BeetleBladeBlast : ModProjectile
    {
        public override void SetDefaults()
        {
            projectile.CloneDefaults(ProjectileID.Meowmere);
            projectile.name = "Big Beetle Boi";
            aiType = ProjectileID.Meowmere;
        }

        public override bool Autoload(ref string name, ref string texture)
        {
            texture = "Terraria/Projectile_" + ProjectileID.Meowmere;
            return true;
        }

        public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
        {
            target.AddBuff(BuffID.Poisoned, 7 * 60);
        }
    }
}
And got this error:
'BeetleBladeBlast.Autoload(ref string, ref string)': no suitable method found to override
 
Back
Top Bottom