tAPI Multiple Ore Spawning? [HELP!]

slade3501

Terrarian
Hey! Well, I've got a working ore spawning code, and it works great and such. But, anyone mind helping me out on making it spawn MULTIPLE ores.

My Code: [Works]


using Terraria;
using TAPI;

namespace SK
{
public class SK : ModWorld
{
public override void WorldGenPostGen()
{
ModifyWorld();
}

public void ModifyWorld()
{
Main.statusText = "Adding Crodian Ore..."; //This is what displays as your ore is being generated. feel free to tweak
int Amount_Of_Spawns = 100+(int)(Main.maxTilesY/5); //feel free to tweak
for(int i=0;i<Amount_Of_Spawns;i++) AddMyOres();
}
public void AddMyOres()
{
int LowX = 200; //after ocean on left edge of map
int HighX = Main.maxTilesX-200; //before ocean on right edge of map
int LowY = (int)Main.worldSurface; //where the brown background and the sky background meets
int HighY = Main.maxTilesY-200; //where hell and the grey background meets

int X = WorldGen.genRand.Next(LowX,HighX); //don't touch
int Y = WorldGen.genRand.Next(LowY,HighY); //don't touch

int OreMinimumSpread = 3; //minimum amount of ore in a vein. feel free to tweak
int OreMaximumSpread = 20; //Maximum amount of ore in a vein. feel free to tweak

int OreMinimumFrequency = 3; //feel free to tweak, this and the next line mean how frequent your ore spawns.
int OreMaximumFrequency = 30; //feel free to tweak

int OreSpread = WorldGen.genRand.Next(OreMinimumSpread,OreMaximumSpread+1); //don't touch
int OreFrequency = WorldGen.genRand.Next(OreMinimumFrequency,OreMaximumFrequency+1); //don't touch

WorldGen.OreRunner(X, Y, (double)OreSpread, OreFrequency, TileDef.byName["SK:CrodianOre"]);
}
}
}


Anyway I can make it spawn multiple? Please note I can't make it by making another .cs file as SK is already used here...
 
Does this spawn all the ores instead of a random given tier of ore?
Sorry if this is not what your are looking for, but its a question.
 
Well, my code spawns whatever ore I give it. Specifically, this code spawns in one of my custom ores.
But I want it to spawn in ANOTHER one of my custom ores, and to do that, I need to put another ore in there. But, it either comes up with an error, and I
cannot make another .cs file for it, because then (as I said in the thread) it pops up with my internalname being already used. (It being SK)
 
Back
Top Bottom