Standalone [1.3] tModLoader - A Modding API

I am trying to add a sword to my game, nothing much. Whenever I try to compile it, it says that there was "no suitable method found to override" I am pretty new to C#, and I don't really know what to do. The files are at https://goo.gl/vTZ7dH, and available for anyone to view.
 
the error includes the item only and the shoot function is IN the item
look at the error one more time:
d:\Documents\My Games\Terraria\ModLoader\Mod Sources\ExampleMod\Items\Weapons\OrbitalFriend:red:Cannon.cs(41,38) : error CS0161: 'ExampleMod.Items.Weapons.OrbitalFriend:red:Cannon.Shoot(Terraria.Player, ref Microsoft.Xna.Framework.Vector2, ref float, ref float, ref int, ref int, ref float)': not all code paths return a value

the projectile works fine, item code:
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace ExampleMod.Items.Weapons
{
    public class OrbitalFriend:red:Cannon : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Orbital Friend:red: Cannon";
            item.damage = 100;
            item.melee = true;
            item.width = 21;
            item.height = 32;
            item.toolTip = "The Orbital Friend:red: Cannon - Free hugs!";
            item.useTime = 1;
            item.useAnimation = 13;
            item.useStyle = 1;
            item.knockBack = 1;
                        item.noMelee = true;
            item.value = 666666;
            item.rare = 11;
            item.useSound = 1;
            item.autoReuse = true;
            item.shoot = mod.ProjectileType("Friend:red:");
            item.shootSpeed = 16f;
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.DirtBlock);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }

                public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
                {
                position.Y -= 110;
                }

        public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
        {
            target.AddBuff(BuffID.OnFire, 60);
            target.AddBuff(BuffID.Cursed, 60);
            target.AddBuff(BuffID.Confused, 60);
        }
    }
}
[DOUBLEPOST=1450548349,1450548321][/DOUBLEPOST]that is for spawning the projectile above the player
[DOUBLEPOST=1450548408][/DOUBLEPOST]and by "that" i mean the code in the shoot function you posted
 
no its Friend then "tihs" backwards
[DOUBLEPOST=1450548726,1450548674][/DOUBLEPOST]the "tihs" backwards is covered by red's face
 
i checked it, how many times do i have to say it, the problem is in the SHOOT function
what do i need to type so it doesn't change a thing in the actual projectile shot so it just covers all, stopping the error

[DOUBLEPOST=1450549222,1450549164][/DOUBLEPOST]the error is that i used the shoot function and dont do s h i t exept tell the game where to spawn the projectile
 
i checked it, how many times do i have to say it, the problem is in the SHOOT function
what do i need to type so it doesn't change a thing in the actual projectile shot so it just covers all, stopping the error

[DOUBLEPOST=1450549222,1450549164][/DOUBLEPOST]the error is that i used the shoot function and dont do s h i t exept tell the game where to spawn the projectile

line 41 is that not this line


public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
 
1. i KNOW line 41 is the shoot line

2. shoot function is the dam thing that line 41 is INSIDE OF

3. yes, i figured it out, i just need to cover all variables and use them in some way in the shoot function, but i wanna do that without changing a thing
 
Back
Top Bottom