//this was used once to generate wheel labrune/vlt public static void GenerateWheelNames(string filesPath, WheelsArr allwheels) { int LowerRimSize = 17; int UpperRimSize = 21; string catalogHead = "GM_CATALOG_"; for (int i = 0; i < allwheels.wheels.Length; i++) { for (int j = 0; j < allwheels.wheels[i].rims.Length; j++) { string style = "STYLE0" + (j + 1).ToString(); for (int k = LowerRimSize; k < UpperRimSize + 1; k++) { string itemName = allwheels.wheels[i].brand + "_" + style + "_" + k.ToString() + "_" + "25"; uint itembinHash = Hashing.BinHash(itemName); string nodeName = VLTOps.GetVltNodeHash(itemName); string catalogName = catalogHead + itemName; string text = allwheels.wheels[i].rims[j] + " " + k.ToString() + '"' + " WHEELS"; uint catalogBinHash = Hashing.BinHash(catalogName); string catalogbinHex = Hashing.HexHash(catalogBinHash); StreamWriter labrunew = new StreamWriter(filesPath + "labrune.txt", true); labrunew.Write("0\t" + catalogbinHex + "\t" + catalogName + "\t" + text + "\n"); labrunew.Dispose(); StreamWriter vltedw = new StreamWriter(filesPath + "vlted.nfsms", true); vltedw.Write(VLTOps.vltedCommands[0] + " virtualitem " + nodeName + " title " + catalogName + "\n"); vltedw.Dispose(); } } } }
public static string GenerateLabrune(string text, string catalog) { string catalogName = "GM_CATALOG_" + catalog; string hash = Hashing.HexHash(Hashing.BinHash(catalogName)); return("0 "+ hash + " " + catalogName + " " + text); }
public static JObject Plate(string plateName) { Templates temp = new Templates(); JObject o = (JObject)temp.mainTemplate.DeepClone(); string name = "LICENSEPLATE_" + plateName; o["Name"] = name; JObject nameOffset = (JObject)temp.template1.DeepClone(); JArray strings = (JArray)nameOffset["Strings"]; strings.Add(name); nameOffset["Name"] = "NAME_OFFSET"; JObject textureHash = (JObject)temp.template1.DeepClone(); textureHash.Add("Value", Hashing.BinHash(name)); textureHash["Name"] = "TEXTUREHASH"; JObject idUpdateGroup = (JObject)temp.template1.DeepClone(); idUpdateGroup.Add("Value", 25632); idUpdateGroup["Name"] = "PARTID_UPGRADE_GROUP"; strings = (JArray)o["Attributes"]; strings.Add(nameOffset); strings.Add(textureHash); strings.Add(idUpdateGroup); return(o); }
//FindNodeByString public static string GetVltNodeHash(string name) { //get hex from BinHash //turn it to string string hash = "0x" + Hashing.HexHash(Hashing.BinHash(name)); //turn it lowercase hash = hash.ToLower(); //put that string to VLTHash string vlthash = "0x" + Hashing.HexHash(Hashing.VLTHash(hash)); //get node name lowercase vlthash = vlthash.ToLower(); return(vlthash); }
public static void CreateVisualPartVirtualitemData(StreamWriter vltedw, string partName, string shortDesc, Construct struc, int i) { string longDesc = "GM_CATALOG_00000000"; //forall string type = "visualpart"; //forall string brand = struc.brand; //depends on struc int resellPrice = 0; //forall int tier = 0; //forall string warnOnDelete = "False"; //forall int catalogMultiplier = -1; //struc depend if (struc is HoodCF) { catalogMultiplier = 0; //struc depend } string index = i.ToString(); //dependant on loop counter if (i < 10) { index = "0" + index; } //individual car string partName = car + struc.firstPartName + index + struc.secondPartName; //depends on global/private //spoiler global/cf string partName = struc.firstPartName + index + AllCars.sizes[j] + struc.secondPartName; //global neon/plate string partName = struc.firstPartName + "STYLE" + index + struc.secondPartName; //individual car string shortDesc = "GM_CATALOG_0000" + carcatalog; //depends on global/private/spoiler //spoiler global/cf string shortDesc = "GM_CATALOG_0000" + AllCars.sizeCatalog[j]; //global neon/plate string shortDesc = "GM_CATALOG_0000" + "49F3"; uint partHash = Hashing.BinHash(partName); //same string nodeName = GetVltNodeHash(partName); //same string icon = struc.icon; //struc string subtype = struc.subtype; //struc string title = "GM_CATALOG_" + struc.catalogs[i + catalogMultiplier]; //struc //same for everything vltedw.WriteLine(vltedCommands[1] + " virtualitem " + nodeName); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " title " + title); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " hash " + partHash); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " icon " + struc.icon); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " itemName " + partName); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " longdescription " + longDesc); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " shortdescription " + shortDesc); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " subType " + struc.subtype); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " type " + type); vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " brand"); vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " resellprice"); vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " tier"); vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " warnondelete"); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " brand " + brand); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " resellprice " + resellPrice.ToString()); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " tier " + tier.ToString()); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " warnondelete " + warnOnDelete); //same for everything }
public static void CreateNVisualPartVirtualItem(Construct struc, string car, string carcatalog, string filesPath, bool more, bool all) { if (struc.global == false) { uint carID = Hashing.BinHash(car); string longDesc = "GM_CATALOG_00000000"; //forall string type = "visualpart"; //forall string brand = "visual_brand_nfs"; //depends on struc int resellPrice = 0; //forall int tier = 0; //forall string warnOnDelete = "False"; //forall int catalogMultiplier = -1; //struc depend if (struc is HoodCF) { catalogMultiplier = 0; //struc depend } int counter = more ? struc.newUpper : struc.upper; //struc and outer dependant int lowCount = all ? struc.lower : struc.upper + 1; //struc and outer dependant for (int i = lowCount; i < counter + 1; i++) //go through every part in Struc { string index = i.ToString(); //dependant on loop counter if (i < 10) { index = "0" + index; } string partName = car + struc.firstPartName + index + struc.secondPartName; //depends on global/private uint partHash = Hashing.BinHash(partName); //same string nodeName = GetVltNodeHash(partName); //same string icon = struc.icon; //struc string subtype = struc.subtype; //struc string title = "GM_CATALOG_000" + struc.catalogs[i + catalogMultiplier]; //depends idk string shortDesc = "GM_CATALOG_0000" + carcatalog; //depends on global/private/spoiler StreamWriter vltedw = new StreamWriter(filesPath, true); //same for everything vltedw.WriteLine(vltedCommands[1] + " virtualitem " + nodeName); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " title " + title); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " hash " + partHash); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " icon " + struc.icon); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " itemName " + partName); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " longdescription " + longDesc); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " shortdescription " + shortDesc); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " subType " + struc.subtype); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " type " + type); vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " brand"); vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " resellprice"); vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " tier"); vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " warnondelete"); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " brand " + brand); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " resellprice " + resellPrice.ToString()); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " tier " + tier.ToString()); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " warnondelete " + warnOnDelete); //same for everything //different vltedw.WriteLine(vltedCommands[1] + " visualpart " + nodeName); vltedw.WriteLine(vltedCommands[2] + " visualpart " + nodeName + " baseCarHashes 1"); vltedw.WriteLine(vltedCommands[0] + " visualpart " + nodeName + " visualPartHash " + partHash); vltedw.WriteLine(vltedCommands[0] + " visualpart " + nodeName + " baseCarHashes[0] " + carID); //different vltedw.Dispose(); //optional // StreamWriter sw = File.AppendText("./hashes/" + car + ".txt"); // // if(i == struc.lower) sw.WriteLine("//vanilla"); // // else if (i == struc.upper + 1) sw.WriteLine("\n//addon"); // sw.WriteLine(partName + "\t" + partHash); // sw.Dispose(); } } else { if (struc is SpoilerGlobal || struc is SpoilerGlobalCF) { //NEED 3 ARRAYS OF HATCH, LARGE AND SMALL string longDesc = "GM_CATALOG_00000000"; string type = "visualpart"; string brand = "visual_brand_nfs"; int resellPrice = 0; int tier = 0; string warnOnDelete = "False"; int catalogMultiplier = -1; int counter = more ? struc.newUpper : struc.upper; int lowCount = all ? struc.lower : struc.upper + 1; for (int j = 0; j < AllCars.sizes.Length; j++) { for (int i = lowCount; i < counter + 1; i++) { string index = i.ToString(); if (i < 10) { index = "0" + index; } string partName = struc.firstPartName + index + AllCars.sizes[j] + struc.secondPartName; uint partHash = Hashing.BinHash(partName); string nodeName = GetVltNodeHash(partName); string icon = struc.icon; string subtype = struc.subtype; string title = "GM_CATALOG_" + struc.catalogs[i + catalogMultiplier]; string shortDesc = "GM_CATALOG_0000" + AllCars.sizeCatalog[j]; StreamWriter vltedw = new StreamWriter(filesPath, true); vltedw.WriteLine(vltedCommands[1] + " virtualitem " + nodeName); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " title " + title); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " hash " + partHash); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " icon " + struc.icon); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " itemName " + partName); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " longdescription " + longDesc); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " shortdescription " + shortDesc); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " subType " + struc.subtype); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " type " + type); vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " brand"); vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " resellprice"); vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " tier"); vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " warnondelete"); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " brand " + brand); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " resellprice " + resellPrice.ToString()); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " tier " + tier.ToString()); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " warnondelete " + warnOnDelete); vltedw.WriteLine(vltedCommands[1] + " visualpart " + nodeName); vltedw.WriteLine(vltedCommands[2] + " visualpart " + nodeName + " baseCarHashes " + AllCars.sizeArraysNew[j].Length.ToString()); if (i <= struc.upper) { vltedw.WriteLine(vltedCommands[3] + " visualpart " + nodeName + " baseCarHashes 0"); vltedw.WriteLine(vltedCommands[3] + " visualpart " + nodeName + " baseCarHashes " + AllCars.sizeArraysNew[j].Length.ToString()); } vltedw.WriteLine(vltedCommands[0] + " visualpart " + nodeName + " visualPartHash " + partHash); for (int k = 0; k < AllCars.sizeArraysNew[j].Length; k++) { vltedw.WriteLine(vltedCommands[0] + " visualpart " + nodeName + " baseCarHashes[" + k.ToString() + "] " + AllCars.sizeArraysNew[j][k]); } vltedw.Dispose(); // StreamWriter sw = File.AppendText("./hashes/" + "SPOILER" + AllCars.sizes[j] + ".txt"); // sw.WriteLine(partName + "\t" + partHash); // sw.Dispose(); } } } else if (struc is Neon || struc is LicensePlate) { string longDesc = "GM_CATALOG_00000000"; string type = "visualpart"; string brand = (struc is Neon) ? "visual_brand_lumox" : "visual_brand_nfs"; int resellPrice = 0; int tier = 0; string warnOnDelete = "False"; int catalogMultiplier = 0; int counter = more ? struc.newUpper : struc.upper; int lowCount = all ? struc.lower : struc.upper + 1; for (int i = lowCount; i < counter + 1; i++) { string index = i.ToString(); if (i < 10) { index = "0" + index; } string partName = struc.firstPartName + "STYLE" + index + struc.secondPartName; uint partHash = Hashing.BinHash(partName); string nodeName = GetVltNodeHash(partName); string icon = struc.icon; string subtype = struc.subtype; string title = "GM_CATALOG_" + struc.catalogs[i + catalogMultiplier]; string shortDesc = "GM_CATALOG_000049F3"; StreamWriter vltedw = new StreamWriter(filesPath, true); vltedw.WriteLine(vltedCommands[1] + " virtualitem " + nodeName); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " title " + title); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " hash " + partHash); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " icon " + struc.icon); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " itemName " + partName); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " longdescription " + longDesc); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " shortdescription " + shortDesc); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " subType " + struc.subtype); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " type " + type); vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " brand"); vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " resellprice"); vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " tier"); vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " warnondelete"); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " brand " + brand); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " resellprice " + resellPrice.ToString()); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " tier " + tier.ToString()); vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " warnondelete " + warnOnDelete); vltedw.WriteLine(vltedCommands[1] + " visualpart " + nodeName); vltedw.WriteLine(vltedCommands[0] + " visualpart " + nodeName + " visualPartHash " + partHash); vltedw.WriteLine(vltedCommands[2] + " visualpart " + nodeName + " baseCarHashes " + AllCars.everyCarHash.Length.ToString()); for (int k = 0; k < AllCars.everyCarHash.Length; k++) { vltedw.WriteLine(vltedCommands[0] + " visualpart " + nodeName + " baseCarHashes[" + k.ToString() + "] " + AllCars.everyCarHash[k]); } vltedw.Dispose(); } } } }