I don't know what i am doing wrong right now, can someone help me out?

WaluigiWillReturn

Terrarian
So, i want to make a magic weapon for my mod, and i am new to both C# and Modding, so, i have this line of code that is giving me the error :

item.shoot = ModContent.ProjectileType ("Sun");

And it is giving me the error CS1501: No overload for method 'ProjectileType' takes 1 arguments
 
you could try making a variable, say
Code:
String ProjectilType = "Sun";

item.shoot = ModContent.ProjectileType (ProjectileType);

other than that if you want more help you're gonna need to provide a
minimal reproducable example
 
you could try making a variable, say
Code:
String ProjectilType = "Sun";

item.shoot = ModContent.ProjectileType (ProjectileType);

other than that if you want more help you're gonna need to provide a
minimal reproducable example
Hmmm,
So,

Here is the code for the item i am making that shoots projectiles


Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace SolarMod.Items
{
    public class SunStaff : ModItem
    {
        public override void SetStaticDefaults()
        {
            Item.staff[item.type] = true;
            Tooltip.SetDefault("Shoots Solar Bombs.");
        }

        public override void SetDefaults()
        {
            item.width = 20;
            item.useTime = 3;
            item.height = 20;
            item.maxStack = 1;
            item.value = 100;
            item.rare = 2;
            item.noMelee = true;
            item.useAnimation = 18;
            item.magic = true;
            item.mana = 5;
            item.damage = 71;
            item.shoot = ModContent.ProjectileType ("Sun");
            // Set other item.X values here
        }

        public override void AddRecipes()
        {
            // Recipes here. See Basic Recipe Guide
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(75, 500);
            recipe.AddIngredient(175, 20);
            recipe.AddTile(26);
        }
    }
}




And here is the code for the projectile :


Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace SolarMod.Items
{
    public class Sun : ModProjectile
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("Solar Bomb");
        }

        public override void SetDefaults()
        {
            projectile.arrow = false;
            projectile.width = 10;
            projectile.height = 10;
            projectile.aiStyle = 2;
            projectile.friendly = true;
            projectile.ranged = true;
            aiType = ProjectileID.DemonScythe;
        }

        // Additional hooks/methods here.
    }
}
 
im pretty sure classes dont need quotes so it would be

C#:
item.shoot = ModContent.ProjectileType(Sun);

also sun might need to be
C#:
directory.sun
if it's not in the same folder
 
Back
Top Bottom