Hello!
I know that this thread has been dead for a while... but...
I can't find a mod that does nothing but changes the spawn rates. I thought the above code would work, but I'm getting the same error. Here is the code:
using Terraria;
using Terraria.ModLoader;
namespace SpawnBoostMod
{
class SpawnBoostMod : Mod
{
public SpawnBoostMod()
{
Properties = new ModProperties()
{
Autoload = true,
};
}
}
class SpawnRateMultiplierGlobalNPC : GlobalNPC
{
float multiplier = 5f;
public override void EditSpawnRate(Player player, ref int spawnRate, ref int maxSpawns)
{
spawnRate = (int)(spawnRate / multiplier);
maxSpawns = (int)(maxSpawns * multiplier);
}
}
}
The following is the loading error:
SpawnBoostMod.SpawnRateMultiplierGlobalNPC has instance fields but does not set InstancePerEntity to true. Either use static fields, or per instance globals
at Terraria.ModLoader.NPCLoader.VerifyGlobalNPC(GlobalNPC npc)
at Terraria.ModLoader.Mod.AddGlobalNPC(String name, GlobalNPC globalNPC)
at Terraria.ModLoader.Mod.AutoloadGlobalNPC(Type type)
at Terraria.ModLoader.Mod.Autoload()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)
Any assistance would be grateful. Also, if you know of a mod that only changes the rates, please post a reply.