PC Error

Jonah Graham

Terrarian
I'm gonna post this again because no one replied to my other one. Basically I'm getting this error and I'm trying to figure out which line of code is causing it. Can someone please help me figure it out? I am also not very good at coding and stuff so if you would like to join my Discord and help me and stuff please ask me. The code is very unfinished but it was happening before I added the unfinished part.
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using Microsoft.Xna.Framework;

namespace SpiritsofEvil.NPCs
{
[AutoloadBossHead]
public class WardingEye : ModNPC
{
private Player player;
private float speed;

public override void SetStaticDefaults()
{
DisplayName.SetDefault("Warding Eye");
Main.npcFrameCount[npc.type] = 1;
}

public override void SetDefaults()
{
npc.aiStyle = 2;
npc.lifeMax = 5000;
npc.damage = 20;
npc.defense = 20;
npc.knockBackResist = 0f;
npc.width = 100;
npc.height = 100;
npc.value = 20000;
npc.npcSlots = 3f;
npc.boss = true;
npc.lavaImmune = true;
npc.noGravity = true;
npc.noTileCollide = true;
npc.HitSound = SoundID.NPCHit1;
npc.DeathSound = SoundID.NPCDeath1;
music = MusicID.Boss1;
}

public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{
npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale);
npc.damage = (int)(npc.damage * 0.6f);
}

public override void AI()
{
Target();
}

private void Target()
{
player = Main.player[npc.target];
}

private void Move(Vector2 offset)
{

}

public override void FindFrame(int frameHeight)
{
speed = 5f;
Vector2 moveTo = player.Center + offset;
Vector2 move = moveTo - npc.Center;
float magnitude = (float)MathHelper.Sqrt(move.X * move.Y * move.Y);

}


public override void NPCLoot()
{
//part 3
}

public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position)
{
scale = 1.5f;
return null;
}

}
}
 

Attachments

  • error 3.JPG
    error 3.JPG
    112.2 KB · Views: 78
I think you have an error in the file format, the code is looking for an image I believe called WardingEye_Head_Boss in Yourmod/NPCs/ instead of looking n the correct folder Yourmod/NPCs/Bosses ('m looking at the Example mods script structure) Sooooo to fix change the {namespace SpiritsofEvil.NPCs} to {namespace SpiritsofEvil.NPCs.Boss.WardingEye} That "should" fix it...
 
I think you have an error in the file format, the code is looking for an image I believe called WardingEye_Head_Boss in Yourmod/NPCs/ instead of looking n the correct folder Yourmod/NPCs/Bosses ('m looking at the Example mods script structure) Sooooo to fix change the {namespace SpiritsofEvil.NPCs} to {namespace SpiritsofEvil.NPCs.Boss.WardingEye} That "should" fix it...
I will try that, thanks!
 
I think you have an error in the file format, the code is looking for an image I believe called WardingEye_Head_Boss in Yourmod/NPCs/ instead of looking n the correct folder Yourmod/NPCs/Bosses ('m looking at the Example mods script structure) Sooooo to fix change the {namespace SpiritsofEvil.NPCs} to {namespace SpiritsofEvil.NPCs.Boss.WardingEye} That "should" fix it...
that didn't work, but I think I might know what the problem is. It says that it was expecting a file called WardingEye_Boss_Head, but when I changed the file names to that, it still shows the same error.
 

Attachments

  • error 234.JPG
    error 234.JPG
    55.5 KB · Views: 56
Wait I think I see the problem... It cant find the texture... Did you rename the resource in mod .csproj? cause otherwise it cant find what isnt loaded
 
Wait I think I see the problem... It cant find the texture... Did you rename the resource in mod .csproj? cause otherwise it cant find what isnt loaded
let me check
[doublepost=1562266975,1562266838][/doublepost]
Wait I think I see the problem... It cant find the texture... Did you rename the resource in mod .csproj? cause otherwise it cant find what isnt loaded
Im new to this stuff, so im not quite sure what you're talking about. I think I understand though and, yes im pretty sure I renamed the resource in mod .csproj
 
Back
Top Bottom