Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So, i am making a Terraria mod, and i have a problem. It says
c:\Users\Павел\Documents\My Games\Terraria\ModLoader\Mod Sources\Megalia\Items\E-core.cs(38,30) : error CS0115: 'Megalia.NPCs.Boss.Ecore.Boss(ref string, ref string)': no suitable method found to override
. I don`t know what to do. So, this is the code:
using System;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Megalia.NPCs.Boss
{
    public class Ecore : ModNPC
    {
        public override void SetDefaults()
        {
            npc.name = "E-core";
            npc.displayName = "E-core";
            npc.aiStyle = 5;  //5 is the flying AI
            npc.lifeMax = 100;   //boss life
            npc.damage = 20;  //boss damage
            npc.defense = 10;    //boss defense
            npc.knockBackResist = 0f;
            npc.width = 100;
            npc.height = 100;
            animationType = NPCID.DemonEye;   //this boss will behavior like the DemonEye
            Main.npcFrameCount[npc.type] = 2;    //boss frame/animation 
            npc.value = Item.buyPrice(0, 40, 75, 45);
            npc.npcSlots = 1f;
            npc.boss = true;  
            npc.lavaImmune = true;
            npc.noGravity = true;
            npc.noTileCollide = true;
            npc.soundHit = 8;
            npc.soundKilled = 14;
            npc.buffImmune[24] = true;
            music = MusicID.Boss2;
            npc.netAlways = true;
        }
        public override void headTexture(ref string headTexture, ref string EcoreMapIcon)
        {
            EcorePapIcon = "Megalia/NPCs/Boss/E-coreMapIcon"; //the boss head texture
        }
        public override void bossLifeScale(ref string name, ref int potionType)
        {
            potionType = ItemID.LesserHealingPotion;   //boss drops
            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("YourSword"));
        }
        public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
        {
            npc.lifeMax = (int)(npc.lifeMax * 0.579f * bossLifeScale);  //boss life scale in expertmode
            npc.damage = (int)(npc.damage * 0.6f);  //boss damage increase in expermode
        }
    }
}


What I have tried:

I tried to change the metod, but i didn`t get anything, tried to fix this for 3 hours. Please help!
Posted
Updated 7-Apr-19 10:02am
Comments
David Passenger 7-Apr-19 15:45pm    
Please share your base class (ModNPC) code.

1 solution

It tells you line the error is found on: "30:38" - line 38, column 30.
CTRL+G will take you direct to the line, or double click the error message.

It's the line:
public override void headTexture(ref string headTexture, ref string EcoreMapIcon)
and the error is saying that the base class (and it's inheritance hierarchy) does not contain a method with that name and parameter list (called its signature) which can be overridden in derived classes such as yours. Check your base class and see if you have the wrong parameters for example.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900