public static void GenerateLevel(string BasePath) { N8Level Base = new N8Level(BasePath); N8Level megadefault = new N8Level(@"C:\Program Files (x86)\N8\Saves\default.ncd"); foreach (N8Block b in megadefault.blocks.Blocks) { b.position.Z -= 1; } Base.MergeWithDestructive(megadefault); string NewPath = Path.GetDirectoryName(BasePath) + "\\" + Path.GetFileNameWithoutExtension(BasePath) + "_defaulted.ncd"; Console.WriteLine(NewPath); Console.Read(); Utilities.Save(NewPath, Base); }
public static void GenerateLevel() { N8Level level = new N8Level(); string BlockType = "land"; string BlockName = "Land"; int blocksize = 400; for (int i = -2000 + blocksize / 2; i <= 2000 - blocksize / 2; i += blocksize) { for (int j = -2000 + blocksize / 2; j <= 2000 - blocksize / 2; j += blocksize) { N8Block block = level.blocks.GenerateBlock(BlockType, BlockName); block.position = new Vector3D(i, j, 0); } } level.MergeWithDestructive(GenerateStack.GetLevel(1000, new Vector3D(0, 0, -1000), "floor", "Stack", 65)); Utilities.Save(@"C:\Program Files (x86)\N8\Saves\default_lands.ncd", level); }