Example #1
0
        public static TES5.Group convert(string file)
        {
            TES3.ESM.open(file);
            TES5.Group cell_grup = new TES5.Group("CELL");

            while (TES3.ESM.find("CELL"))
            {
                TES3.CELL cell3 = new TES3.CELL();
                cell3.read();

                if (!cell3.interior)
                {
                    continue;
                }

                if (cell3.references.Count == 0)
                {
                    continue;
                }


                Log.info(cell3.cell_name);

                TES5.CELL cell5 = new TES5.CELL(cell3.cell_name);

                cell5.editor_id = cell3.cell_name;
                cell5.full_name = cell3.cell_name;

                cell5.Interior = true;
                if (cell3.HasWater)
                {
                    // Calculate cell bounds
                    foreach (TES3.REFR mw_ref in cell3.references)
                    {
                        cell5.update_bounds(mw_ref.x, mw_ref.y);
                    }
                    // add water planes
                    cell5.addWater(cell3.water_height);
                }

                cell5.add_ambient_light(LGTM.get(CellTYPE.getInstance().get_class(cell3.cell_name)));

                cell5.addToGroup(cell_grup);
                cell5.pack();
            }

            TES3.ESM.close();
            return(cell_grup);
        }
        public static void make_marker_config()
        {
            TES5.ESM esm = new TES5.ESM(Config.Paths.Temporary.furn_placement_esp);
            esm.add_masters("Skyrim.esm");

            TextWriter file_01 = File.CreateText(Config.Paths.Temporary.furn_linker);

            file_01.WriteLine("# !AUTO-GENERATED! Do NOT modify this file by hand. Contains linking data for FURN markers.");

            TES5.Group furn = Convert.FURN.convert();
            make_formID_index(furn);

            TES5.Group stats = Convert.STAT.convert(Config.Paths.mw_esm, true);
            TES5.Group acti  = Convert.ACTI.getInstance().convert(Config.Paths.mw_esm, true);

            TES5.Group lgtm = Convert.LGTM.convert();

            TES5.CELL cell = new TES5.CELL("mw_furnitureworkshop");

            file_01.WriteLine("cell=" + cell.id);

            cell.full_name = "Furniture Workshop";
            cell.add_ambient_light(Convert.LGTM.get(Convert.CellTYPE.TYPE.DEFAULT));
            cell.pack();
            TES5.Group cell_grp = new TES5.Group("CELL");
            cell.addToGroup(cell_grp);

            List <TES5.Record> grps = new List <TES5.Record>(stats.records);

            foreach (TES5.Record r in acti.records)
            {
                grps.Add(r);
            }


            # region