Standalone [1.3] tModLoader - A Modding API

c:\Users\Nassa\Documents\My Games\Terraria\ModLoader\Mod Sources\GalacticMod\NPCs\Slimi.cs(28,31) : error CS0115: 'GalacticMod.NPCs.Slimi.CanSpawn(Terraria.ModLoader.NPCSpawnInfo)': no se encontró ningún miembro adecuado que invalidar

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

namespace GalacticMod.NPCs
{
public class Slimi : ModNPC
{
public override void SetDefaults()
{
npc.name = "Slimi";
npc.displayName = "Slimi";
npc.width = 33;
npc.height = 22;
npc.damage = 4;
npc.defense = 2;
npc.lifeMax = 30;
npc.soundHit = 1;
npc.soundKilled = 2;
npc.value = 60f;
npc.knockBackResist = 0.5f;
npc.aiStyle = 1; //see here: http://tconfig.wikia.com/wiki/List_of_NPC_AI_Styles
Main.npcFrameCount[npc.type] = Main.npcFrameCount[NPCID.Slime];
aiType = NPCID.Slime;
animationType = NPCID.Slime;
}

public override float CanSpawn(NPCSpawnInfo spawnInfo)
{
return spawnInfo.spawnTileY < Main.worldSurface && Main.dayTime ? 1.0f : 0f; //spawn at day
}

public override void NPCLoot()
{
if (Main.rand.Next(1, 50) == 1) //drop chance - This gives a 49% chance as 50-1 = 49
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.LunarBar, Main.rand.Next(5, 10)); //amount
}
}
}
}
[doublepost=1552112865,1552112739][/doublepost]
Somebody helps me every time I want a code for an enemy I get it wrong

Tell me the record please
[doublepost=1552112960][/doublepost]discord Which
 
c:\Users\Nassa\Documents\My Games\Terraria\ModLoader\Mod Sources\GalacticMod\NPCs\Slimi.cs(28,31) : error CS0115: 'GalacticMod.NPCs.Slimi.CanSpawn(Terraria.ModLoader.NPCSpawnInfo)': no se encontró ningún miembro adecuado que invalidar

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

namespace GalacticMod.NPCs
{
public class Slimi : ModNPC
{
public override void SetDefaults()
{
npc.name = "Slimi";
npc.displayName = "Slimi";
npc.width = 33;
npc.height = 22;
npc.damage = 4;
npc.defense = 2;
npc.lifeMax = 30;
npc.soundHit = 1;
npc.soundKilled = 2;
npc.value = 60f;
npc.knockBackResist = 0.5f;
npc.aiStyle = 1; //see here: http://tconfig.wikia.com/wiki/List_of_NPC_AI_Styles
Main.npcFrameCount[npc.type] = Main.npcFrameCount[NPCID.Slime];
aiType = NPCID.Slime;
animationType = NPCID.Slime;
}

public override float CanSpawn(NPCSpawnInfo spawnInfo)
{
return spawnInfo.spawnTileY < Main.worldSurface && Main.dayTime ? 1.0f : 0f; //spawn at day
}

public override void NPCLoot()
{
if (Main.rand.Next(1, 50) == 1) //drop chance - This gives a 49% chance as 50-1 = 49
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.LunarBar, Main.rand.Next(5, 10)); //amount
}
}
}
}
[doublepost=1552112865,1552112739][/doublepost]

Tell me the record please
[doublepost=1552112960][/doublepost]discord Which
the discord is in the original post. can you post the error too?
 
c:\Users\Nassa\Documents\My Games\Terraria\ModLoader\Mod Sources\GalacticMod\NPCs\Slimi.cs(28,31) : error CS0115: 'GalacticMod.NPCs.Slimi.CanSpawn(Terraria.ModLoader.NPCSpawnInfo)': no se encontró ningún miembro adecuado que invalidar

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

namespace GalacticMod.NPCs
{
public class Slimi : ModNPC
{
public override void SetDefaults()
{
npc.name = "Slimi";
npc.displayName = "Slimi";
npc.width = 33;
npc.height = 22;
npc.damage = 4;
npc.defense = 2;
npc.lifeMax = 30;
npc.soundHit = 1;
npc.soundKilled = 2;
npc.value = 60f;
npc.knockBackResist = 0.5f;
npc.aiStyle = 1; //see here: http://tconfig.wikia.com/wiki/List_of_NPC_AI_Styles
Main.npcFrameCount[npc.type] = Main.npcFrameCount[NPCID.Slime];
aiType = NPCID.Slime;
animationType = NPCID.Slime;
}

public override float CanSpawn(NPCSpawnInfo spawnInfo)
{
return spawnInfo.spawnTileY < Main.worldSurface && Main.dayTime ? 1.0f : 0f; //spawn at day
}

public override void NPCLoot()
{
if (Main.rand.Next(1, 50) == 1) //drop chance - This gives a 49% chance as 50-1 = 49
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.LunarBar, Main.rand.Next(5, 10)); //amount
}
}
}
}
[doublepost=1552112865,1552112739][/doublepost]

Tell me the record please
[doublepost=1552112960][/doublepost]discord Which

I passed the link
 
"Also, the majority of errors are coming from a file called "ExamplePerson.cs" but you upload the file and i cant read the russian compile errors so i cant really help you out there."
Anyways thank you very much!
 
  • Like
Reactions: TMC
i'm not sure what the problem is but whenever i try to host and play with the tremor mod on it gets stuck on starting server, same with calamity, host and play works fine when i don't have tmod installed and i really don't know whats wrong or what to do. I played calamity like a year ago with friends and i didn't run into this problem. plz help :<
 
i'm not sure what the problem is but whenever i try to host and play with the tremor mod on it gets stuck on starting server, same with calamity, host and play works fine when i don't have tmod installed and i really don't know whats wrong or what to do. I played calamity like a year ago with friends and i didn't run into this problem. plz help :<

so the versions of the tremor has bugs or erores.Try to install the latest version of tmodloader to see if it works
 
Back
Top Bottom