Endershot355
Steampunker
so do I just get rid of it
Yeah, what else?so do I just get rid of it
Anything else you need any (quick) help with? It's getting kinda late/early here, so I'm gonna go real soon.YAY IT ING WORKED! mind my french im happy rn
[DOUBLEPOST=1457580336,1457579806][/DOUBLEPOST]Alright I is calm now
is heaven real? other than that nothing else, you helped me enough today! OH WAIT I REMEMBERED HOW DO YOU MAKE ITEMS FLOAT LIKE SOULSAnything else you need any (quick) help with? It's getting kinda late/early here, so I'm gonna go real soon.
YAY IT ING WORKED! mind my french im happy rn
[DOUBLEPOST=1457580336,1457579806][/DOUBLEPOST]Alright I is calm now
Im not doing that anymore :/if you're using this code:
return spawnInfo.spawnTileY < Main.rockLayer && !Main.dayTime ? 100f : 100f;
please do yourself a favor, and replace it with this:
return 100f;
there's no point in doing multiple checks, if you're always returning the same thing...
You'll want to put the following inside your SetDefaults function (of your soul item I mean):is heaven real? other than that nothing else, you helped me enough today! OH WAIT I REMEMBERED HOW DO YOU MAKE ITEMS FLOAT LIKE SOULS
ItemID.Sets.ItemNoGravity[item.type] = true;
Alright thanks and byeYou'll want to put the following inside your SetDefaults function (of your soul item I mean):
Code:ItemID.Sets.ItemNoGravity[item.type] = true;
It keeps telling me line 37-38 are messed up but how and if you see anything else wrong could you guys help I'm new at CS
recipe.AddIngredient(ItemID.DirtBlock, 1);
recipe.SetResult(this, 1);
AddIngredient takes at least two arguments, you need to specify how much Dirt Blocks are required. If you need only one, type:
Code:recipe.AddIngredient(ItemID.DirtBlock, 1);
This isn't true, the stack argument is an optional argument with a default value of 1. There is no need to specify it and it will never be wrong to the compiler.Thirdly, SetResult also needs an argument for the amount of items created.
You should have the following line:with the method I was using how do I lower the spawn rate?
[DOUBLEPOST=1457583514,1457582939][/DOUBLEPOST]because they WONT STOP COMING
return spawnInfo.spawnTileY < Main.rockLayer && !Main.dayTime ? 100f : 0;
This isn't true, the stack argument is an optional argument with a default value of 1. There is no need to specify it and it will never be wrong to the compiler.
no problem, it's just a while ago everyone was pointing that out as why the code wouldn't build and it confused people since it wasn't actually a problem.So they are. My bad. Somehow missed the optional argument declarations.
Could you show your whole code? It's probably a typo.error CS1518: Expected class, delegate, enum, interface, or struct
I just copy pasted everything over to this other thing and theres an error...
}
public override float CanSpawn(NPCSpawnInfo spawnInfo) ///It says the error is here
{
if(((myModPlayer)spawnInfo.player.GetModPlayer(mod, "myModPlayer")).accessoryOn== true) // That last ; here is not supposed to be there!
{
return spawnInfo.spawnTileY < Main.rockLayer && !Main.dayTime ? 5f : 0f;
}
return 0f;
}
Look at your code:using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using System;
namespace Enderuim.NPCs
{
public class Haunted : ModNPC
{
public override void SetDefaults()
{
npc.name = "Haunted";
npc.displayName = "The Haunted";
npc.width = 52;
npc.height = 60;
npc.damage = 200;
npc.defense = 33;
npc.lifeMax = 6000;
npc.soundHit = 1;
npc.soundKilled = 1;
npc.value = 60f;
npc.knockBackResist = 0.5f;
aiStyle = 40;
}
}
public override float CanSpawn(NPCSpawnInfo spawnInfo)
{
if(((myModPlayer)spawnInfo.player.GetModPlayer(mod, "myModPlayer")).accessoryOn== true) // That last ; here is not supposed to be there!
{
return spawnInfo.spawnTileY < Main.rockLayer && !Main.dayTime ? 5f : 0f;
}
return 0f;
}
}
public class Haunted : ModNPC
{
public override void SetDefaults()
{
npc.name = "Haunted";
npc.displayName = "The Haunted";
npc.width = 52;
npc.height = 60;
npc.damage = 200;
npc.defense = 33;
npc.lifeMax = 6000;
npc.soundHit = 1;
npc.soundKilled = 1;
npc.value = 60f;
npc.knockBackResist = 0.5f;
aiStyle = 40;
}
} // <--- Right over here
public override float CanSpawn(NPCSpawnInfo spawnInfo)
{
if(((myModPlayer)spawnInfo.player.GetModPlayer(mod, "myModPlayer")).accessoryOn== true) // That last ; here is not supposed to be there!
{
return spawnInfo.spawnTileY < Main.rockLayer && !Main.dayTime ? 5f : 0f;
}
return 0f;
}