Example #1
0
 public NavigationConnectionInfo(NavigationConnectionInfo copyObject)
 {
     if (copyObject.Unknown1 != null)
     {
         Unknown1 = (FormID)copyObject.Unknown1.Clone();
     }
     if (copyObject.Unknown2 != null)
     {
         foreach (var temp in copyObject.Unknown2)
         {
             Unknown2.Add((FormID)temp.Clone());
         }
     }
     if (copyObject.Unknown3 != null)
     {
         foreach (var temp in copyObject.Unknown3)
         {
             Unknown3.Add((FormID)temp.Clone());
         }
     }
     if (copyObject.Doors != null)
     {
         foreach (var temp in copyObject.Doors)
         {
             Doors.Add((FormID)temp.Clone());
         }
     }
 }
Example #2
0
 public void ImportData()
 {
     BrakeParts.Import();
     BrakeControllerParts.Import();
     SteerParts.Import();
     ChassisParts.Import();
     LightweightParts.Import();
     RacingModifyParts.Import();
     EngineParts.Import();
     PortPolishParts.Import();
     EngineBalanceParts.Import();
     DisplacementParts.Import();
     ComputerParts.Import();
     NATuneParts.Import();
     TurbineKitParts.Import();
     DrivetrainParts.Import();
     FlywheelParts.Import();
     ClutchParts.Import();
     PropellerShaftParts.Import();
     GearParts.Import();
     SuspensionParts.Import();
     IntercoolerParts.Import();
     MufflerParts.Import();
     LSDParts.Import();
     TiresFrontParts.Import();
     TiresRearParts.Import();
     Unknown1.Import();
     Unknown2.Import();
     Unknown3.Import();
     Unknown4.Import();
     Unknown5.Import();
     Unknown6.Import();
     Unknown7.Import();
     Cars.Import();
 }
Example #3
0
        public override int Serialize(byte[] codeplugContents, int address)
        {
            var contents = new byte[CONTENTS_LENGTH + (HasExtraByte ? 1 : 0)].AsSpan();

            Unknown1.CopyTo(contents.Slice(UNKNOWN1, 13));
            Unknown2.CopyTo(contents.Slice(UNKNOWN2, 9));
            contents[RSSI] = (byte)(RssiAlignment & 0b01111111);
            Unknown3.CopyTo(contents.Slice(UNKNOWN3, 2));
            contents[MIC_GAIN]  = (byte)((InternalMicPreAmpGain & 0b111) << 5);
            contents[MIC_GAIN] |= (byte)((ExternalMicPreAmpGain & 0b111) << 2);
            contents[MIC_GAIN] |= (byte)(UnknownMicBits & 0b11);
            Unknown4.CopyTo(contents.Slice(UNKNOWN4, 9));
            Unknown5.CopyTo(contents.Slice(UNKNOWN5, 4));
            if (HasExtraByte)
            {
                contents[UNKNOWNEXTRABYTE] = UnknownExtraByte;
            }

            var nextAddress = address + contents.Length + BlockSizeAdjustment;

            nextAddress = SerializeChild(Block06, BLOCK_06_VECTOR, codeplugContents, nextAddress, contents);
            nextAddress = SerializeChild(Block03, BLOCK_03_VECTOR, codeplugContents, nextAddress, contents);
            nextAddress = SerializeChild(Block0C, BLOCK_0C_VECTOR, codeplugContents, nextAddress, contents);
            nextAddress = SerializeChild(Block0F, BLOCK_0F_VECTOR, codeplugContents, nextAddress, contents);
            nextAddress = SerializeChild(Block11, BLOCK_11_VECTOR, codeplugContents, nextAddress, contents);
            Serializer(codeplugContents, address, contents);
            return(nextAddress);
        }
Example #4
0
        public override void WriteBinary(ESPWriter writer)
        {
            Marker.WriteBinary(writer);

            if (Unknown1 != null)
            {
                Unknown1.WriteBinary(writer);
            }
            if (AudioLocation != null)
            {
                AudioLocation.WriteBinary(writer);
            }
            if (Unknown2 != null)
            {
                Unknown2.WriteBinary(writer);
            }
            if (Unknown3 != null)
            {
                Unknown3.WriteBinary(writer);
            }
            if (Unknown4 != null)
            {
                Unknown4.WriteBinary(writer);
            }
        }
Example #5
0
            /// <summary>
            /// Writes the data element into the given buffer (at its current position).
            /// </summary>
            /// <param name="buffer">The buffer where the data element should be deserialized into.</param>
            public void WriteData(RAMBuffer buffer)
            {
                buffer.WriteUShort((ushort)PlayerName.Length);
                buffer.WriteString(PlayerName);
                buffer.WriteFloat(InitialCameraX);
                buffer.WriteFloat(InitialCameraY);
                buffer.WriteShort(UnknownX);
                buffer.WriteShort(UnknownY);
                buffer.WriteByte(AlliedVictory);

                ScenarioDataElementTools.AssertTrue(Diplomacy1.Count == Diplomacy2.Count);
                buffer.WriteUShort((ushort)Diplomacy1.Count);
                Diplomacy1.ForEach(d => buffer.WriteByte((byte)d));
                Diplomacy2.ForEach(d => buffer.WriteUInteger((uint)d));

                buffer.WriteUInteger(Color);
                buffer.WriteFloat(Unknown1);
                buffer.WriteUShort(Unknown3Count);

                if (Unknown1 == 2)
                {
                    ScenarioDataElementTools.AssertListLength(Unknown2, 8);
                    Unknown2.ForEach(b => buffer.WriteByte(b));
                }

                ScenarioDataElementTools.AssertListLength(Unknown3, Unknown3Count * 44);
                Unknown3.ForEach(b => buffer.WriteByte(b));

                ScenarioDataElementTools.AssertListLength(Unknown4, 7);
                Unknown4.ForEach(b => buffer.WriteByte(b));

                buffer.WriteInteger(Unknown5);
            }
Example #6
0
        public override void WriteXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            ele.TryPathTo("Marker", true, out subEle);
            Marker.WriteXML(subEle, master);

            if (Unknown1 != null)
            {
                ele.TryPathTo("Unknown1", true, out subEle);
                Unknown1.WriteXML(subEle, master);
            }
            if (AudioLocation != null)
            {
                ele.TryPathTo("AudioLocation", true, out subEle);
                AudioLocation.WriteXML(subEle, master);
            }
            if (Unknown2 != null)
            {
                ele.TryPathTo("Unknown2", true, out subEle);
                Unknown2.WriteXML(subEle, master);
            }
            if (Unknown3 != null)
            {
                ele.TryPathTo("Unknown3", true, out subEle);
                Unknown3.WriteXML(subEle, master);
            }
            if (Unknown4 != null)
            {
                ele.TryPathTo("Unknown4", true, out subEle);
                Unknown4.WriteXML(subEle, master);
            }
        }
Example #7
0
 public void AsText(StringBuilder b, int pad)
 {
     b.Append(' ', pad);
     b.AppendLine("SceneCachedValues:");
     b.Append(' ', pad++);
     b.AppendLine("{");
     b.Append(' ', pad);
     b.AppendLine("Unknown1: 0x" + Unknown1.ToString("X8") + " (" + Unknown1 + ")");
     b.Append(' ', pad);
     b.AppendLine("Unknown2: 0x" + Unknown2.ToString("X8") + " (" + Unknown2 + ")");
     b.Append(' ', pad);
     b.AppendLine("Unknown3: 0x" + Unknown3.ToString("X8") + " (" + Unknown3 + ")");
     AABB1.AsText(b, pad);
     AABB2.AsText(b, pad);
     b.Append(' ', pad);
     b.AppendLine("Unknown4:");
     b.Append(' ', pad);
     b.AppendLine("{");
     for (int i = 0; i < Unknown4.Length;)
     {
         b.Append(' ', pad + 1);
         for (int j = 0; j < 8 && i < Unknown4.Length; j++, i++)
         {
             b.Append("0x" + Unknown4[i].ToString("X8") + ", ");
         }
         b.AppendLine();
     }
     b.Append(' ', pad);
     b.AppendLine("}");
     b.AppendLine();
     b.Append(' ', pad);
     b.AppendLine("Unknown5: 0x" + Unknown5.ToString("X8") + " (" + Unknown5 + ")");
     b.Append(' ', --pad);
     b.AppendLine("}");
 }
Example #8
0
        public string ToStruct(LandTableFormat format)
        {
            StringBuilder result = new StringBuilder("{ ");

            result.Append(Bounds.ToStruct());
            result.Append(", ");
            switch (format)
            {
            case LandTableFormat.SA1:
            case LandTableFormat.SADX:
                result.Append(Unknown1.ToCHex());
                result.Append(", ");
                result.Append(Unknown2.ToCHex());
                result.Append(", ");
                result.Append(Model != null ? "&" + Model.Name : "NULL");
                result.Append(", ");
                result.AppendFormat(Unknown3.ToCHex());
                break;

            case LandTableFormat.SA2:
                result.Append(Model != null ? "&" + Model.Name : "NULL");
                result.Append(", ");
                result.Append(Unknown2.ToCHex());
                result.Append(", ");
                result.Append(Unknown3.ToCHex());
                break;
            }
            result.Append(", ");
            result.AppendFormat(Flags.ToCHex());
            result.Append(" }");
            return(result.ToString());
        }
Example #9
0
        public override void ReadXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("Marker", false, out subEle))
            {
                Marker.ReadXML(subEle, master);
            }

            if (ele.TryPathTo("Unknown1", false, out subEle))
            {
                if (Unknown1 == null)
                {
                    Unknown1 = new SimpleSubrecord <Byte[]>();
                }

                Unknown1.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("AudioLocation", false, out subEle))
            {
                if (AudioLocation == null)
                {
                    AudioLocation = new RecordReference();
                }

                AudioLocation.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Unknown2", false, out subEle))
            {
                if (Unknown2 == null)
                {
                    Unknown2 = new SimpleSubrecord <Byte[]>();
                }

                Unknown2.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Unknown3", false, out subEle))
            {
                if (Unknown3 == null)
                {
                    Unknown3 = new SimpleSubrecord <Single>();
                }

                Unknown3.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Unknown4", false, out subEle))
            {
                if (Unknown4 == null)
                {
                    Unknown4 = new SimpleSubrecord <Single>();
                }

                Unknown4.ReadXML(subEle, master);
            }
        }
Example #10
0
        public void ReadData(string filename)
        {
            using (FileStream file = new FileStream(filename, FileMode.Open, FileAccess.Read))
            {
                var blocks = new List <DataBlock>();

                for (int i = 1; i <= 34; i++)
                {
                    file.Position = 8 * i;
                    uint blockStart = file.ReadUInt();
                    uint blockSize  = file.ReadUInt();
                    blocks.Add(new DataBlock {
                        BlockStart = blockStart, BlockSize = blockSize
                    });
                }

                BrakeParts.Read(file, blocks[0].BlockStart, blocks[0].BlockSize);
                BrakeControllerParts.Read(file, blocks[1].BlockStart, blocks[1].BlockSize);
                SteerParts.Read(file, blocks[2].BlockStart, blocks[2].BlockSize);
                ChassisParts.Read(file, blocks[3].BlockStart, blocks[3].BlockSize);
                LightweightParts.Read(file, blocks[4].BlockStart, blocks[4].BlockSize);
                RacingModifyParts.Read(file, blocks[5].BlockStart, blocks[5].BlockSize);
                EngineParts.Read(file, blocks[6].BlockStart, blocks[6].BlockSize);
                PortPolishParts.Read(file, blocks[7].BlockStart, blocks[7].BlockSize);
                EngineBalanceParts.Read(file, blocks[8].BlockStart, blocks[8].BlockSize);
                DisplacementParts.Read(file, blocks[9].BlockStart, blocks[9].BlockSize);
                ComputerParts.Read(file, blocks[10].BlockStart, blocks[10].BlockSize);
                NATuneParts.Read(file, blocks[11].BlockStart, blocks[11].BlockSize);
                TurbineKitParts.Read(file, blocks[12].BlockStart, blocks[12].BlockSize);
                DrivetrainParts.Read(file, blocks[13].BlockStart, blocks[13].BlockSize);
                FlywheelParts.Read(file, blocks[14].BlockStart, blocks[14].BlockSize);
                ClutchParts.Read(file, blocks[15].BlockStart, blocks[15].BlockSize);
                PropellerShaftParts.Read(file, blocks[16].BlockStart, blocks[16].BlockSize);
                GearParts.Read(file, blocks[17].BlockStart, blocks[17].BlockSize);
                SuspensionParts.Read(file, blocks[18].BlockStart, blocks[18].BlockSize);
                IntercoolerParts.Read(file, blocks[19].BlockStart, blocks[19].BlockSize);
                MufflerParts.Read(file, blocks[20].BlockStart, blocks[20].BlockSize);
                LSDParts.Read(file, blocks[21].BlockStart, blocks[21].BlockSize);
                TiresFrontParts.Read(file, blocks[22].BlockStart, blocks[22].BlockSize);
                TiresRearParts.Read(file, blocks[23].BlockStart, blocks[23].BlockSize);
                Unknown1.Read(file, blocks[24].BlockStart, blocks[24].BlockSize);
                Unknown2.Read(file, blocks[25].BlockStart, blocks[25].BlockSize);
                Unknown3.Read(file, blocks[26].BlockStart, blocks[26].BlockSize);
                Unknown4.Read(file, blocks[27].BlockStart, blocks[27].BlockSize);
                Unknown5.Read(file, blocks[28].BlockStart, blocks[28].BlockSize);
                Unknown6.Read(file, blocks[29].BlockStart, blocks[29].BlockSize);
                Events.Read(file, blocks[30].BlockStart, blocks[30].BlockSize);
                EnemyCars.Read(file, blocks[31].BlockStart, blocks[31].BlockSize);
                Cars.Read(file, blocks[32].BlockStart, blocks[32].BlockSize);
                CarsSports.Read(file, blocks[33].BlockStart, blocks[33].BlockSize);

                uint stringTableStart = blocks[33].BlockStart + blocks[33].BlockSize;
                RaceStringTable.Read(file, stringTableStart, (uint)file.Length - stringTableStart);
            }
        }
Example #11
0
        public void WriteData(string filename)
        {
            using (FileStream file = new FileStream(filename, FileMode.Create, FileAccess.ReadWrite))
            {
                file.Write(new byte[] { 0x47, 0x54, 0x44, 0x54, 0x6C, 0x00, 0x3E, 0x00 }, 0, 8); // The 0x3E is the number of indices

                file.Position = (0x3E * 8) + 7;
                file.WriteByte(0x00); // Data starts at 0x1F8 so position EOF

                uint i = 1;
                BrakeParts.Write(file, 8 * i++);
                BrakeControllerParts.Write(file, 8 * i++);
                SteerParts.Write(file, 8 * i++);
                ChassisParts.Write(file, 8 * i++);
                LightweightParts.Write(file, 8 * i++);
                RacingModifyParts.Write(file, 8 * i++);
                EngineParts.Write(file, 8 * i++);
                PortPolishParts.Write(file, 8 * i++);
                EngineBalanceParts.Write(file, 8 * i++);
                DisplacementParts.Write(file, 8 * i++);
                ComputerParts.Write(file, 8 * i++);
                NATuneParts.Write(file, 8 * i++);
                TurbineKitParts.Write(file, 8 * i++);
                DrivetrainParts.Write(file, 8 * i++);
                FlywheelParts.Write(file, 8 * i++);
                ClutchParts.Write(file, 8 * i++);
                PropellerShaftParts.Write(file, 8 * i++);
                GearParts.Write(file, 8 * i++);
                SuspensionParts.Write(file, 8 * i++);
                IntercoolerParts.Write(file, 8 * i++);
                MufflerParts.Write(file, 8 * i++);
                LSDParts.Write(file, 8 * i++);
                TiresFrontParts.Write(file, 8 * i++);
                TiresRearParts.Write(file, 8 * i++);
                Unknown1.Write(file, 8 * i++);
                Unknown2.Write(file, 8 * i++);
                Unknown3.Write(file, 8 * i++);
                Unknown4.Write(file, 8 * i++);
                Unknown5.Write(file, 8 * i++);
                Unknown6.Write(file, 8 * i++);
                Unknown7.Write(file, 8 * i++);
                Cars.Write(file, 8 * i++);

                file.Position = 0;
                using (FileStream zipFile = new FileStream(filename + ".gz", FileMode.Create, FileAccess.Write))
                {
                    using (GZipStream zip = new GZipStream(zipFile, CompressionMode.Compress))
                    {
                        file.CopyTo(zip);
                    }
                }
            }
        }
Example #12
0
        public override void SetListBytes(ref List <byte> listBytes)
        {
            sectionIdentifier = Section.LEDR;

            int previousSize = listBytes.Count;

            if (LevelLabel.Length > 64)
            {
                LevelLabel = new string(LevelLabel.Take(64).ToArray());
            }
            foreach (char c in LevelLabel)
            {
                listBytes.Add((byte)c);
            }
            for (int i = LevelLabel.Length; i < 64; i++)
            {
                listBytes.Add(0);
            }

            listBytes.AddRange(GameProgress.Reverse());
            listBytes.AddRange(Unknown1.Reverse());
            listBytes.AddRange(Unknown2.Reverse());
            listBytes.AddRange(Unknown3.Reverse());

            if (ThumbnailIcon != ThumbIcon.None)
            {
                listBytes.Add((byte)ThumbnailIcon);
                listBytes.Add(0);
                listBytes.Add(0);
                listBytes.Add(0);
            }

            listBytes.AddRange(Unknown4.Reverse());

            if (UnknownText.Length > 0xA8)
            {
                UnknownText = new string(UnknownText.Take(0xA8).ToArray());
            }
            foreach (char c in UnknownText)
            {
                listBytes.Add((byte)c);
            }

            bytesUsed = listBytes.Count - previousSize;

            for (int i = bytesUsed; i < 0x100; i++)
            {
                listBytes.Add(0xBF);
            }

            blockSize = listBytes.Count - previousSize;
        }
Example #13
0
        public bool Equals(PedType other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Flag.Equals(other.Flag) &&
                   Unknown0.Equals(other.Unknown0) &&
                   Unknown1.Equals(other.Unknown1) &&
                   Unknown2.Equals(other.Unknown2) &&
                   Unknown3.Equals(other.Unknown3) &&
                   Unknown4.Equals(other.Unknown4) &&
                   Threats.Equals(other.Threats) &&
                   Avoid.Equals(other.Avoid));
        }
Example #14
0
        public bool Equals(NavigationConnectionInfo other)
        {
            if (System.Object.ReferenceEquals(this, other))
            {
                return(true);
            }

            if (((object)this == null) || ((object)other == null))
            {
                return(false);
            }

            return(Unknown1 == other.Unknown1 &&
                   Unknown2.SequenceEqual(other.Unknown2) &&
                   Unknown3.SequenceEqual(other.Unknown3) &&
                   Doors.SequenceEqual(other.Doors));
        }
Example #15
0
        public string ToStruct()
        {
            StringBuilder result = new StringBuilder("{ ");

            result.Append(Unknown1.ToCHex());
            result.Append(", ");
            result.Append(Unknown2.ToC());
            result.Append(", ");
            result.Append(Unknown3.ToC());
            result.Append(", ");
            result.Append(Model != null ? "&" + Model.Name : "NULL");
            result.Append(", ");
            result.Append(Animation != null ? "&" + ActionName : "NULL");
            result.Append(", (NJS_TEXLIST *)");
            result.Append(Unknown4.ToCHex());
            result.Append(" }");
            return(result.ToString());
        }
Example #16
0
        public xxSubmesh Clone()
        {
            xxSubmesh submesh = new xxSubmesh();

            submesh.Unknown1      = (byte[])Unknown1.Clone();
            submesh.MaterialIndex = MaterialIndex;
            submesh.FaceList      = new List <xxFace>(FaceList.Count);
            for (int i = 0; i < FaceList.Count; i++)
            {
                submesh.FaceList.Add(FaceList[i].Clone());
            }
            submesh.VertexList = new List <xxVertex>(VertexList.Count);
            for (int i = 0; i < VertexList.Count; i++)
            {
                submesh.VertexList.Add(VertexList[i].Clone());
            }

            submesh.Unknown2 = Unknown2.CloneIfNotNull();

            if (Vector2Lists != null)
            {
                submesh.Vector2Lists = new List <List <Vector2> >(Vector2Lists.Count);
                for (int i = 0; i < Vector2Lists.Count; i++)
                {
                    List <Vector2> vectorList = new List <Vector2>(Vector2Lists[i].Count);
                    submesh.Vector2Lists.Add(vectorList);
                    for (int j = 0; j < Vector2Lists[i].Count; j++)
                    {
                        vectorList.Add(Vector2Lists[i][j]);
                    }
                }
            }

            submesh.Unknown3 = Unknown3.CloneIfNotNull();
            submesh.Unknown4 = Unknown4.CloneIfNotNull();
            submesh.Unknown5 = Unknown5.CloneIfNotNull();
            submesh.Unknown6 = Unknown6.CloneIfNotNull();

            return(submesh);
        }
Example #17
0
        protected override void ReadDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("Unknown1", false, out subEle))
            {
                Unknown1.ReadXML(subEle, master);
            }

            if (ele.TryPathTo("Unknown2", false, out subEle))
            {
                foreach (XElement e in subEle.Elements())
                {
                    var temp = new FormID();
                    temp.ReadXML(e, master);
                    Unknown2.Add(temp);
                }
            }

            if (ele.TryPathTo("Unknown3", false, out subEle))
            {
                foreach (XElement e in subEle.Elements())
                {
                    var temp = new FormID();
                    temp.ReadXML(e, master);
                    Unknown3.Add(temp);
                }
            }

            if (ele.TryPathTo("Doors", false, out subEle))
            {
                foreach (XElement e in subEle.Elements())
                {
                    var temp = new FormID();
                    temp.ReadXML(e, master);
                    Doors.Add(temp);
                }
            }
        }
Example #18
0
        protected override void ReadData(ESPReader reader)
        {
            using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size)))
                using (ESPReader subReader = new ESPReader(stream, reader.Plugin))
                {
                    try
                    {
                        Unknown1.ReadBinary(subReader);
                        Int32 Unknown2Count = subReader.ReadInt32();

                        for (int i = 0; i < Unknown2Count; i++)
                        {
                            var temp = new FormID();
                            temp.ReadBinary(subReader);
                            Unknown2.Add(temp);
                        }
                        Int32 Unknown3Count = subReader.ReadInt32();

                        for (int i = 0; i < Unknown3Count; i++)
                        {
                            var temp = new FormID();
                            temp.ReadBinary(subReader);
                            Unknown3.Add(temp);
                        }
                        Int32 DoorsCount = subReader.ReadInt32();

                        for (int i = 0; i < DoorsCount; i++)
                        {
                            var temp = new FormID();
                            temp.ReadBinary(subReader);
                            Doors.Add(temp);
                        }
                    }
                    catch
                    {
                        return;
                    }
                }
        }
Example #19
0
            public override ListViewItem GetListViewItem()
            {
                ListViewItem m = new ListViewItem("");

                m.SubItems.Add(Type.ToString());
                m.SubItems.Add(Next.ToString());
                m.SubItems.Add(Unknown1.ToString());
                m.SubItems.Add(RouteID.ToString());

                m.SubItems.Add(RouteSpeed.ToString());
                m.SubItems.Add(FOVSpeed.ToString());
                m.SubItems.Add(ViewpointSpeed.ToString());

                m.SubItems.Add(Unknown2.ToString());
                m.SubItems.Add(Unknown3.ToString());

                m.SubItems.Add(Position.X.ToString());
                m.SubItems.Add(Position.Y.ToString());
                m.SubItems.Add(Position.Z.ToString());

                m.SubItems.Add(Rotation.X.ToString());
                m.SubItems.Add(Rotation.Y.ToString());
                m.SubItems.Add(Rotation.Z.ToString());

                m.SubItems.Add(FOVBegin.ToString());
                m.SubItems.Add(FOVEnd.ToString());

                m.SubItems.Add(Viewpoint1.X.ToString());
                m.SubItems.Add(Viewpoint1.Y.ToString());
                m.SubItems.Add(Viewpoint1.Z.ToString());

                m.SubItems.Add(Viewpoint2.X.ToString());
                m.SubItems.Add(Viewpoint2.Y.ToString());
                m.SubItems.Add(Viewpoint2.Z.ToString());

                m.SubItems.Add(Duration.ToString());
                return(m);
            }
Example #20
0
        public override int Serialize(byte[] codeplugContents, int address)
        {
            var contents    = new byte[CONTENTS_LENGTH].AsSpan();
            var nextAddress = address + CONTENTS_LENGTH + BlockSizeAdjustment;

            contents[EXTERNAL_CODEPLUG_VECTOR]     = (byte)(ExternalCodeplugVector / 0x100);
            contents[EXTERNAL_CODEPLUG_VECTOR + 1] = (byte)(ExternalCodeplugVector % 0x100);
            Encoding.ASCII.GetBytes(Serial).AsSpan().CopyTo(contents.Slice(SERIAL, 10));
            Encoding.ASCII.GetBytes(Model).AsSpan().CopyTo(contents.Slice(MODEL, 16));
            contents[CODEPLUG_VERSION]           = (byte)(InternalCodeplugVersion / 0x100);
            contents[CODEPLUG_VERSION + 1]       = (byte)(InternalCodeplugVersion % 0x100);
            contents[INTERNAL_CODEPLUG_SIZE]     = (byte)(InternalCodeplugSize / 0x100);
            contents[INTERNAL_CODEPLUG_SIZE + 1] = (byte)(InternalCodeplugSize % 0x100);
            Unknown1.AsSpan().CopyTo(contents.Slice(UNKNOWN1));
            nextAddress = SerializeChild(Block02, BLOCK_02_VECTOR, codeplugContents, nextAddress, contents);
            nextAddress = SerializeChild(Block56, BLOCK_56_VECTOR, codeplugContents, nextAddress, contents);
            Unknown2.AsSpan().CopyTo(contents.Slice(UNKNOWN2));
            nextAddress = SerializeChild(Block10, BLOCK_10_VECTOR, codeplugContents, nextAddress, contents);
            Unknown3.AsSpan().CopyTo(contents.Slice(UNKNOWN3));
            AuthCode.AsSpan().CopyTo(contents.Slice(AUTH_CODE));
            Serializer(codeplugContents, address, contents);
            return(nextAddress);
        }
Example #21
0
 public void AsText(StringBuilder b, int pad)
 {
     b.Append(' ', pad);
     b.AppendLine("SceneSpecification:");
     b.Append(' ', pad++);
     b.AppendLine("{");
     b.Append(' ', pad);
     b.AppendLine("CellZ: 0x" + CellZ.ToString("X8") + " (" + CellZ + ")");
     Cell.AsText(b, pad);
     b.Append(' ', pad);
     b.AppendLine("arSnoLevelAreas:");
     b.Append(' ', pad);
     b.AppendLine("{");
     for (int i = 0; i < SNOLevelAreas.Length;)
     {
         b.Append(' ', pad + 1);
         for (int j = 0; j < 8 && i < SNOLevelAreas.Length; j++, i++)
         {
             b.Append("0x" + SNOLevelAreas[i].ToString("X8") + ", ");
         }
         b.AppendLine();
     }
     b.Append(' ', pad);
     b.AppendLine("}");
     b.AppendLine();
     b.Append(' ', pad);
     b.AppendLine("snoPrevWorld: 0x" + SNOPrevWorld.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("Unknown1: 0x" + Unknown1.ToString("X8") + " (" + Unknown1 + ")");
     b.Append(' ', pad);
     b.AppendLine("snoPrevLevelArea: 0x" + SNOPrevLevelArea.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("snoNextWorld: 0x" + SNONextWorld.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("Unknown2: 0x" + Unknown2.ToString("X8") + " (" + Unknown2 + ")");
     b.Append(' ', pad);
     b.AppendLine("snoNextLevelArea: 0x" + SNONextLevelArea.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("snoMusic: 0x" + SNOMusic.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("snoCombatMusic: 0x" + SNOCombatMusic.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("snoAmbient: 0x" + SNOAmbient.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("snoReverb: 0x" + SNOReverb.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("snoWeather: 0x" + SNOWeather.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("snoPresetWorld: 0x" + SNOPresetWorld.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("Unknown3: 0x" + Unknown3.ToString("X8") + " (" + Unknown3 + ")");
     b.Append(' ', pad);
     b.AppendLine("Unknown4: 0x" + Unknown4.ToString("X8") + " (" + Unknown4 + ")");
     b.Append(' ', pad);
     b.AppendLine("Unknown5: 0x" + Unknown5.ToString("X8") + " (" + Unknown5 + ")");
     b.Append(' ', pad);
     b.AppendLine("ClusterId: 0x" + ClusterID.ToString("X8") + " (" + ClusterID + ")");
     SceneCachedValues.AsText(b, pad);
     b.Append(' ', --pad);
     b.AppendLine("}");
 }
Example #22
0
 /* Autogenerated by R# */
 public bool Equals(AdventurePhysics other) => HangTime == other.HangTime && FloorGrip.Equals(other.FloorGrip) && HorizontalSpeedCap.Equals(other.HorizontalSpeedCap) && VerticalSpeedCap.Equals(other.VerticalSpeedCap) && UnknownAccelRelated.Equals(other.UnknownAccelRelated) && Unknown1.Equals(other.Unknown1) && InitialJumpSpeed.Equals(other.InitialJumpSpeed) && SpringControl.Equals(other.SpringControl) && Unknown2.Equals(other.Unknown2) && RollingMinimumSpeed.Equals(other.RollingMinimumSpeed) && RollingEndSpeed.Equals(other.RollingEndSpeed) && Action1Speed.Equals(other.Action1Speed) && MinWallHitKnockbackSpeed.Equals(other.MinWallHitKnockbackSpeed) && Action2Speed.Equals(other.Action2Speed) && JumpHoldAddSpeed.Equals(other.JumpHoldAddSpeed) && GroundStartingAcceleration.Equals(other.GroundStartingAcceleration) && AirAcceleration.Equals(other.AirAcceleration) && GroundDeceleration.Equals(other.GroundDeceleration) && BrakeSpeed.Equals(other.BrakeSpeed) && AirBrakeSpeed.Equals(other.AirBrakeSpeed) && AirDeceleration.Equals(other.AirDeceleration) && RollingDeceleration.Equals(other.RollingDeceleration) && GravityOffsetSpeed.Equals(other.GravityOffsetSpeed) && MidAirSwerveAcceleration.Equals(other.MidAirSwerveAcceleration) && MinSpeedBeforeStopping.Equals(other.MinSpeedBeforeStopping) && ConstantSpeedOffset.Equals(other.ConstantSpeedOffset) && UnknownOffRoad.Equals(other.UnknownOffRoad) && Unknown3.Equals(other.Unknown3) && Unknown4.Equals(other.Unknown4) && CollisionSize.Equals(other.CollisionSize) && GravitationalPull.Equals(other.GravitationalPull) && YOffsetCamera.Equals(other.YOffsetCamera) && YOffset.Equals(other.YOffset);
Example #23
0
 public override string ToString()
 {
     return($"{{{nameof(Offset)}={Offset.ToString("X")}, {nameof(Unknown0)}={Unknown0.ToString("X")}, {nameof(Unknown1)}={Unknown1.ToString("X")}, {nameof(Unknown2)}={Unknown2.ToString("X")}, {nameof(Unknown3)}={Unknown3.ToString("X")}, {nameof(Unknown4)}={Unknown4.ToString("X")}, {nameof(Unknown5)}={Unknown5.ToString("X")}, {nameof(Unknown6)}={Unknown6.ToString("X")}, {nameof(Unknown7)}={Unknown7.ToString("X")}}}");
 }
        public override void Load(ExtendedBinaryReader fileReader, bool keepOpen = false)
        {
            // Read STSC
            base.Load(fileReader);

            StreamBlock block;

            // System text
            block = GetStreamBlockAndJump(0, fileReader);
            while (!EndOfBlock(fileReader, block))
            {
                SystemText.Add(fileReader.ReadStringElsewhere());
            }

            // CGs
            block = GetStreamBlockAndJump(1, fileReader);
            while (!EndOfBlock(fileReader, block))
            {
                CGs.Add(fileReader.ReadStruct <CGEntry>());
            }

            // Movies
            block = GetStreamBlockAndJump(2, fileReader);
            while (!EndOfBlock(fileReader, block))
            {
                Movies.Add(fileReader.ReadStruct <MovieEntry>());
            }

            // Memories
            block = GetStreamBlockAndJump(3, fileReader);
            while (!EndOfBlock(fileReader, block))
            {
                Memories.Add(fileReader.ReadStruct <MemoryEntry>());
            }

            // Characters
            block = GetStreamBlockAndJump(4, fileReader);
            while (!EndOfBlock(fileReader, block))
            {
                Characters.Add(fileReader.ReadStruct <CharacterEntry>());
            }

            // Unknown2
            block = GetStreamBlockAndJump(5, fileReader);
            while (!EndOfBlock(fileReader, block))
            {
                Unknown2.Add(fileReader.ReadStruct <Unknown2Entry>());
            }

            // Unknown3
            block = GetStreamBlockAndJump(6, fileReader);
            while (!EndOfBlock(fileReader, block))
            {
                Unknown3.Add(fileReader.ReadStruct <Unknown3Entry>());
            }

            // Voices
            block = GetStreamBlockAndJump(7, fileReader);
            while (!EndOfBlock(fileReader, block))
            {
                Voices.Add(fileReader.ReadStruct <VoiceEntry>());
            }

            // Unknown4
            block = GetStreamBlockAndJump(8, fileReader);
            while (!EndOfBlock(fileReader, block))
            {
                Unknown4.Add(fileReader.ReadStruct <Unknown4Entry>());
            }

            // Older versions may not include art books and drama CDs
            if (Version == 7)
            {
                // Art Book Page
                block = GetStreamBlockAndJump(9, fileReader);
                while (!EndOfBlock(fileReader, block))
                {
                    ArtBookPages.Add(fileReader.ReadStruct <ArtBookPageEntry>());
                }

                // DramaCDs
                block = GetStreamBlockAndJump(10, fileReader);
                while (!EndOfBlock(fileReader, block))
                {
                    DramaCDs.Add(fileReader.ReadStruct <DramaCDEntry>());
                }
            }
        }
Example #25
0
        public override void ReadBinary(ESPReader reader)
        {
            List <string> readTags = new List <string>();

            readTags.Add(reader.PeekTag());
            Marker.ReadBinary(reader);

            while (reader.BaseStream.Position < reader.BaseStream.Length)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "FULL":
                    if (readTags.Contains("FULL"))
                    {
                        return;
                    }
                    if (Unknown1 == null)
                    {
                        Unknown1 = new SimpleSubrecord <Byte[]>();
                    }

                    Unknown1.ReadBinary(reader);
                    break;

                case "CNAM":
                    if (readTags.Contains("CNAM"))
                    {
                        return;
                    }
                    if (AudioLocation == null)
                    {
                        AudioLocation = new RecordReference();
                    }

                    AudioLocation.ReadBinary(reader);
                    break;

                case "BNAM":
                    if (readTags.Contains("BNAM"))
                    {
                        return;
                    }
                    if (Unknown2 == null)
                    {
                        Unknown2 = new SimpleSubrecord <Byte[]>();
                    }

                    Unknown2.ReadBinary(reader);
                    break;

                case "MNAM":
                    if (readTags.Contains("MNAM"))
                    {
                        return;
                    }
                    if (Unknown3 == null)
                    {
                        Unknown3 = new SimpleSubrecord <Single>();
                    }

                    Unknown3.ReadBinary(reader);
                    break;

                case "NNAM":
                    if (readTags.Contains("NNAM"))
                    {
                        return;
                    }
                    if (Unknown4 == null)
                    {
                        Unknown4 = new SimpleSubrecord <Single>();
                    }

                    Unknown4.ReadBinary(reader);
                    break;

                default:
                    return;
                }

                readTags.Add(subTag);
            }
        }
Example #26
0
        public override void ReadData(ESPReader reader, long dataEnd)
        {
            while (reader.BaseStream.Position < dataEnd)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "EDID":
                    if (EditorID == null)
                    {
                        EditorID = new SimpleSubrecord <String>();
                    }

                    EditorID.ReadBinary(reader);
                    break;

                case "FULL":
                    if (Name == null)
                    {
                        Name = new SimpleSubrecord <String>();
                    }

                    Name.ReadBinary(reader);
                    break;

                case "NAM1":
                    if (Unknown1 == null)
                    {
                        Unknown1 = new SimpleSubrecord <Byte[]>();
                    }

                    Unknown1.ReadBinary(reader);
                    break;

                case "NAM2":
                    if (Unknown2 == null)
                    {
                        Unknown2 = new SimpleSubrecord <Byte[]>();
                    }

                    Unknown2.ReadBinary(reader);
                    break;

                case "NAM3":
                    if (Unknown3 == null)
                    {
                        Unknown3 = new SimpleSubrecord <Byte[]>();
                    }

                    Unknown3.ReadBinary(reader);
                    break;

                case "NAM4":
                    if (LocationDelay == null)
                    {
                        LocationDelay = new SimpleSubrecord <Single>();
                    }

                    LocationDelay.ReadBinary(reader);
                    break;

                case "NAM5":
                    if (DayStart == null)
                    {
                        DayStart = new SimpleSubrecord <UInt32>();
                    }

                    DayStart.ReadBinary(reader);
                    break;

                case "NAM6":
                    if (NightStart == null)
                    {
                        NightStart = new SimpleSubrecord <UInt32>();
                    }

                    NightStart.ReadBinary(reader);
                    break;

                case "NAM7":
                    if (RetriggerDelay == null)
                    {
                        RetriggerDelay = new SimpleSubrecord <Single>();
                    }

                    RetriggerDelay.ReadBinary(reader);
                    break;

                case "HNAM":
                    if (MediaSetsNeutral == null)
                    {
                        MediaSetsNeutral = new List <RecordReference>();
                    }

                    RecordReference tempHNAM = new RecordReference();
                    tempHNAM.ReadBinary(reader);
                    MediaSetsNeutral.Add(tempHNAM);
                    break;

                case "ZNAM":
                    if (MediaSetsAlly == null)
                    {
                        MediaSetsAlly = new List <RecordReference>();
                    }

                    RecordReference tempZNAM = new RecordReference();
                    tempZNAM.ReadBinary(reader);
                    MediaSetsAlly.Add(tempZNAM);
                    break;

                case "XNAM":
                    if (MediaSetsFriend == null)
                    {
                        MediaSetsFriend = new List <RecordReference>();
                    }

                    RecordReference tempXNAM = new RecordReference();
                    tempXNAM.ReadBinary(reader);
                    MediaSetsFriend.Add(tempXNAM);
                    break;

                case "YNAM":
                    if (MediaSetsEnemy == null)
                    {
                        MediaSetsEnemy = new List <RecordReference>();
                    }

                    RecordReference tempYNAM = new RecordReference();
                    tempYNAM.ReadBinary(reader);
                    MediaSetsEnemy.Add(tempYNAM);
                    break;

                case "LNAM":
                    if (MediaSetsLocation == null)
                    {
                        MediaSetsLocation = new List <RecordReference>();
                    }

                    RecordReference tempLNAM = new RecordReference();
                    tempLNAM.ReadBinary(reader);
                    MediaSetsLocation.Add(tempLNAM);
                    break;

                case "GNAM":
                    if (MediaSetsBattle == null)
                    {
                        MediaSetsBattle = new List <RecordReference>();
                    }

                    RecordReference tempGNAM = new RecordReference();
                    tempGNAM.ReadBinary(reader);
                    MediaSetsBattle.Add(tempGNAM);
                    break;

                case "RNAM":
                    if (ConditionalFaction == null)
                    {
                        ConditionalFaction = new RecordReference();
                    }

                    ConditionalFaction.ReadBinary(reader);
                    break;

                case "FNAM":
                    if (Unknown4 == null)
                    {
                        Unknown4 = new SimpleSubrecord <Byte[]>();
                    }

                    Unknown4.ReadBinary(reader);
                    break;

                default:
                    throw new Exception();
                }
            }
        }
 public override void UpdateData()
 {
     Data = Unknown1.ToString() + ", " + Unknown2.ToString() + ", " + Unknown3.ToString() + ", " + Unknown4.ToString() + ", " + Unknown5.ToString();
 }
Example #28
0
        public override void ReadDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("EditorID", false, out subEle))
            {
                if (EditorID == null)
                {
                    EditorID = new SimpleSubrecord <String>();
                }

                EditorID.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Name", false, out subEle))
            {
                if (Name == null)
                {
                    Name = new SimpleSubrecord <String>();
                }

                Name.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Unknown1", false, out subEle))
            {
                if (Unknown1 == null)
                {
                    Unknown1 = new SimpleSubrecord <Byte[]>();
                }

                Unknown1.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Unknown2", false, out subEle))
            {
                if (Unknown2 == null)
                {
                    Unknown2 = new SimpleSubrecord <Byte[]>();
                }

                Unknown2.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Unknown3", false, out subEle))
            {
                if (Unknown3 == null)
                {
                    Unknown3 = new SimpleSubrecord <Byte[]>();
                }

                Unknown3.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("LocationDelay", false, out subEle))
            {
                if (LocationDelay == null)
                {
                    LocationDelay = new SimpleSubrecord <Single>();
                }

                LocationDelay.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("DayStart", false, out subEle))
            {
                if (DayStart == null)
                {
                    DayStart = new SimpleSubrecord <UInt32>();
                }

                DayStart.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("NightStart", false, out subEle))
            {
                if (NightStart == null)
                {
                    NightStart = new SimpleSubrecord <UInt32>();
                }

                NightStart.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("RetriggerDelay", false, out subEle))
            {
                if (RetriggerDelay == null)
                {
                    RetriggerDelay = new SimpleSubrecord <Single>();
                }

                RetriggerDelay.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("MediaSets/Neutral", false, out subEle))
            {
                if (MediaSetsNeutral == null)
                {
                    MediaSetsNeutral = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempHNAM = new RecordReference();
                    tempHNAM.ReadXML(e, master);
                    MediaSetsNeutral.Add(tempHNAM);
                }
            }
            if (ele.TryPathTo("MediaSets/Ally", false, out subEle))
            {
                if (MediaSetsAlly == null)
                {
                    MediaSetsAlly = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempZNAM = new RecordReference();
                    tempZNAM.ReadXML(e, master);
                    MediaSetsAlly.Add(tempZNAM);
                }
            }
            if (ele.TryPathTo("MediaSets/Friend", false, out subEle))
            {
                if (MediaSetsFriend == null)
                {
                    MediaSetsFriend = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempXNAM = new RecordReference();
                    tempXNAM.ReadXML(e, master);
                    MediaSetsFriend.Add(tempXNAM);
                }
            }
            if (ele.TryPathTo("MediaSets/Enemy", false, out subEle))
            {
                if (MediaSetsEnemy == null)
                {
                    MediaSetsEnemy = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempYNAM = new RecordReference();
                    tempYNAM.ReadXML(e, master);
                    MediaSetsEnemy.Add(tempYNAM);
                }
            }
            if (ele.TryPathTo("MediaSets/Location", false, out subEle))
            {
                if (MediaSetsLocation == null)
                {
                    MediaSetsLocation = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempLNAM = new RecordReference();
                    tempLNAM.ReadXML(e, master);
                    MediaSetsLocation.Add(tempLNAM);
                }
            }
            if (ele.TryPathTo("MediaSets/Battle", false, out subEle))
            {
                if (MediaSetsBattle == null)
                {
                    MediaSetsBattle = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempGNAM = new RecordReference();
                    tempGNAM.ReadXML(e, master);
                    MediaSetsBattle.Add(tempGNAM);
                }
            }
            if (ele.TryPathTo("ConditionalFaction", false, out subEle))
            {
                if (ConditionalFaction == null)
                {
                    ConditionalFaction = new RecordReference();
                }

                ConditionalFaction.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Unknown4", false, out subEle))
            {
                if (Unknown4 == null)
                {
                    Unknown4 = new SimpleSubrecord <Byte[]>();
                }

                Unknown4.ReadXML(subEle, master);
            }
        }
Example #29
0
        public void ToStructVariables(TextWriter writer, LandTableFormat format, List <string> labels, string[] textures = null)
        {
            List <COL> cnk = new List <COL>();
            List <COL> bas = new List <COL>();

            foreach (COL item in COL)
            {
                if (item.Model.Attach is BasicAttach)
                {
                    bas.Add(item);
                }
                else
                {
                    cnk.Add(item);
                }
            }
            COL.Clear();
            COL.AddRange(cnk);
            COL.AddRange(bas);
            for (int i = 0; i < COL.Count; i++)
            {
                if (!labels.Contains(COL[i].Model.Name))
                {
                    labels.Add(COL[i].Model.Name);
                    COL[i].Model.ToStructVariables(writer, format == LandTableFormat.SADX, labels, textures);
                }
            }
            for (int i = 0; i < Anim.Count; i++)
            {
                string aniid = Anim[i].Animation.Name.MakeIdentifier();
                if (!labels.Contains(Anim[i].Model.Name))
                {
                    labels.Add(Anim[i].Model.Name);
                    Anim[i].Model.ToStructVariables(writer, format == LandTableFormat.SADX, labels, textures);
                }
                if (!labels.Contains(aniid))
                {
                    labels.Add(aniid);
                    Anim[i].Animation.ToStructVariables(writer);
                    writer.Write("NJS_ACTION action_");
                    writer.Write(aniid);
                    writer.Write(" = { &");
                    writer.Write(Anim[i].Model.Name);
                    writer.Write(", &");
                    writer.Write(aniid);
                    writer.WriteLine(" };");
                    writer.WriteLine();
                }
            }
            if (!labels.Contains(COLName))
            {
                labels.Add(COLName);
                writer.Write("COL ");
                writer.Write(COLName);
                writer.WriteLine("[] = {");
                List <string> lines = new List <string>(COL.Count);
                foreach (COL item in COL)
                {
                    lines.Add(item.ToStruct(format));
                }
                writer.WriteLine("\t" + string.Join("," + Environment.NewLine + "\t", lines.ToArray()));
                writer.WriteLine("};");
                writer.WriteLine();
            }
            if (Anim.Count > 0 && !labels.Contains(AnimName))
            {
                labels.Add(AnimName);
                writer.Write("GeoAnimData ");
                writer.Write(AnimName);
                writer.WriteLine("[] = {");
                List <string> lines = new List <string>(Anim.Count);
                foreach (GeoAnimData item in Anim)
                {
                    lines.Add(item.ToStruct());
                }
                writer.WriteLine("\t" + string.Join("," + Environment.NewLine + "\t", lines.ToArray()));
                writer.WriteLine("};");
                writer.WriteLine();
            }
            writer.Write("LandTable ");
            writer.Write(Name);
            writer.Write(" = { LengthOfArray<int16_t>(");
            writer.Write(COLName);
            writer.Write("), ");
            switch (format)
            {
            case LandTableFormat.SA1:
            case LandTableFormat.SADX:
                writer.Write(Anim.Count > 0 ? "LengthOfArray<int16_t>(" + AnimName + ")" : "0");
                writer.Write(", ");
                writer.Write(Flags.ToCHex());
                writer.Write(", ");
                writer.Write(Unknown1.ToC());
                writer.Write(", ");
                writer.Write(COLName);
                writer.Write(", ");
                writer.Write(Anim.Count > 0 ? AnimName : "NULL");
                writer.Write(", ");
                writer.Write(TextureFileName.ToC());
                writer.Write(", (NJS_TEXLIST *)");
                writer.Write(TextureList.ToCHex());
                writer.Write(", ");
                writer.Write(Unknown2.ToCHex());
                writer.Write(", ");
                writer.Write(Unknown3.ToCHex());
                break;

            case LandTableFormat.SA2:
                writer.Write(cnk.Count);
                writer.Write(", 0, 0, 0, 0, ");
                writer.Write(Unknown1.ToC());
                writer.Write(", ");
                writer.Write(COLName);
                writer.Write(", ");
                writer.Write(Anim.Count > 0 ? AnimName : "NULL");
                writer.Write(", ");
                writer.Write(TextureFileName.ToC());
                writer.Write(", (NJS_TEXLIST *)");
                writer.Write(TextureList.ToCHex());
                break;
            }
            writer.WriteLine(" };");
        }
        protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            ele.TryPathTo("AnimationType", true, out subEle);
            subEle.Value = AnimationType.ToString();

            ele.TryPathTo("AnimationMultiplier", true, out subEle);
            subEle.Value = AnimationMultiplier.ToString("G15");

            ele.TryPathTo("Reach", true, out subEle);
            subEle.Value = Reach.ToString("G15");

            ele.TryPathTo("Flags1", true, out subEle);
            subEle.Value = Flags1.ToString();

            ele.TryPathTo("GripAnimation", true, out subEle);
            subEle.Value = GripAnimation.ToString();

            ele.TryPathTo("AmmoUse", true, out subEle);
            subEle.Value = AmmoUse.ToString();

            ele.TryPathTo("ReloadAnimation", true, out subEle);
            subEle.Value = ReloadAnimation.ToString();

            ele.TryPathTo("MinSpread", true, out subEle);
            subEle.Value = MinSpread.ToString("G15");

            ele.TryPathTo("Spread", true, out subEle);
            subEle.Value = Spread.ToString("G15");

            ele.TryPathTo("Unknown", true, out subEle);
            subEle.Value = Unknown.ToHex();

            ele.TryPathTo("SightFOV", true, out subEle);
            subEle.Value = SightFOV.ToString("G15");

            ele.TryPathTo("Unknown2", true, out subEle);
            subEle.Value = Unknown2.ToString("G15");

            ele.TryPathTo("Projectile", true, out subEle);
            Projectile.WriteXML(subEle, master);

            ele.TryPathTo("BaseVATSToHitChance", true, out subEle);
            subEle.Value = BaseVATSToHitChance.ToString();

            ele.TryPathTo("AttackAnimation", true, out subEle);
            subEle.Value = AttackAnimation.ToString();

            ele.TryPathTo("ProjectileCount", true, out subEle);
            subEle.Value = ProjectileCount.ToString();

            ele.TryPathTo("EmbeddedWeaponActorValue", true, out subEle);
            subEle.Value = EmbeddedWeaponActorValue.ToString();

            ele.TryPathTo("Range/Min", true, out subEle);
            subEle.Value = MinRange.ToString("G15");

            ele.TryPathTo("Range/Max", true, out subEle);
            subEle.Value = MaxRange.ToString("G15");

            ele.TryPathTo("LimbKillBehavior", true, out subEle);
            subEle.Value = LimbKillBehavior.ToString();

            ele.TryPathTo("Flags2", true, out subEle);
            subEle.Value = Flags2.ToString();

            ele.TryPathTo("AttackAnimationMultiplier", true, out subEle);
            subEle.Value = AttackAnimationMultiplier.ToString("G15");

            ele.TryPathTo("FireRate", true, out subEle);
            subEle.Value = FireRate.ToString("G15");

            ele.TryPathTo("ActionPointCost", true, out subEle);
            subEle.Value = ActionPointCost.ToString("G15");

            ele.TryPathTo("Rumble/LeftMotorStrength", true, out subEle);
            subEle.Value = RumbleLeftMotorStrength.ToString("G15");

            ele.TryPathTo("Rumble/RightMotorStrength", true, out subEle);
            subEle.Value = RumbleRightMotorStrength.ToString("G15");

            ele.TryPathTo("Rumble/Duration", true, out subEle);
            subEle.Value = RumbleDuration.ToString("G15");

            ele.TryPathTo("DamageToWeaponMult", true, out subEle);
            subEle.Value = DamageToWeaponMult.ToString("G15");

            ele.TryPathTo("AttackShotsPerSecond", true, out subEle);
            subEle.Value = AttackShotsPerSecond.ToString("G15");

            ele.TryPathTo("ReloadTime", true, out subEle);
            subEle.Value = ReloadTime.ToString("G15");

            ele.TryPathTo("JamTime", true, out subEle);
            subEle.Value = JamTime.ToString("G15");

            ele.TryPathTo("AimArc", true, out subEle);
            subEle.Value = AimArc.ToString("G15");

            ele.TryPathTo("Skill", true, out subEle);
            subEle.Value = Skill.ToString();

            ele.TryPathTo("Rumble/Pattern", true, out subEle);
            subEle.Value = RumblePattern.ToString();

            ele.TryPathTo("Rumble/Wavelength", true, out subEle);
            subEle.Value = RumbleWavelength.ToString("G15");

            ele.TryPathTo("LimbDamageMult", true, out subEle);
            subEle.Value = LimbDamageMult.ToString("G15");

            ele.TryPathTo("ResistanceType", true, out subEle);
            subEle.Value = ResistanceType.ToString();

            ele.TryPathTo("SightUsage", true, out subEle);
            subEle.Value = SightUsage.ToString("G15");

            ele.TryPathTo("SemiAutomaticFireDelay/Min", true, out subEle);
            subEle.Value = SemiAutomaticFireDelayMin.ToString("G15");

            ele.TryPathTo("SemiAutomaticFireDelay/Max", true, out subEle);
            subEle.Value = SemiAutomaticFireDelayMax.ToString("G15");

            ele.TryPathTo("Unknown3", true, out subEle);
            subEle.Value = Unknown3.ToString("G15");

            ele.TryPathTo("Mods/Mod1/Effect", true, out subEle);
            subEle.Value = Mod1Effect.ToString();

            ele.TryPathTo("Mods/Mod2/Effect", true, out subEle);
            subEle.Value = Mod2Effect.ToString();

            ele.TryPathTo("Mods/Mod3/Effect", true, out subEle);
            subEle.Value = Mod3Effect.ToString();

            ele.TryPathTo("Mods/Mod1/ValueA", true, out subEle);
            subEle.Value = Mod1ValueA.ToString("G15");

            ele.TryPathTo("Mods/Mod2/ValueA", true, out subEle);
            subEle.Value = Mod2ValueA.ToString("G15");

            ele.TryPathTo("Mods/Mod3/ValueA", true, out subEle);
            subEle.Value = Mod3ValueA.ToString("G15");

            ele.TryPathTo("PowerAttackAnimation", true, out subEle);
            subEle.Value = PowerAttackAnimation.ToString();

            ele.TryPathTo("StrengthRequirement", true, out subEle);
            subEle.Value = StrengthRequirement.ToString();

            ele.TryPathTo("Unknown4", true, out subEle);
            subEle.Value = Unknown4.ToString();

            ele.TryPathTo("Mods/Mod1/ReloadAnimation", true, out subEle);
            subEle.Value = Mod1ReloadAnimation.ToString();

            ele.TryPathTo("Unknown5", true, out subEle);
            subEle.Value = Unknown5.ToHex();

            ele.TryPathTo("AmmoRegenRate", true, out subEle);
            subEle.Value = AmmoRegenRate.ToString("G15");

            ele.TryPathTo("KillImpulse", true, out subEle);
            subEle.Value = KillImpulse.ToString("G15");

            ele.TryPathTo("Mods/Mod1/ValueB", true, out subEle);
            subEle.Value = Mod1ValueB.ToString("G15");

            ele.TryPathTo("Mods/Mod2/ValueB", true, out subEle);
            subEle.Value = Mod2ValueB.ToString("G15");

            ele.TryPathTo("Mods/Mod3/ValueB", true, out subEle);
            subEle.Value = Mod3ValueB.ToString("G15");

            ele.TryPathTo("ImpulseDistance", true, out subEle);
            subEle.Value = ImpulseDistance.ToString("G15");

            ele.TryPathTo("SkillRequirement", true, out subEle);
            subEle.Value = SkillRequirement.ToString();
        }