Usage examples for reading, writing, and editing AAMP files using AampLibrary.
Examples
Editing an ActorPack's AAMP files.
Uses AampLibray, SarcLibrary, and Yaz0Library
usingNintendo.Aamp;usingNintendo.Sarc;usingNintendo.Yaz0;// Store the SARC file pathstring sarcFile ="C:\Botw\Game\content\Actor\Pack\Armor_001_Upper.sbactorpack";// Decompress the Yaz0 compressed SARC// and store the decompressed bytesbyte[] sarcData =Yaz0.DecompressFast(sarcFile);// Construct a SarcFile object from// the decompressed bytesSarcFile sarc =new(sarcData);// Load the gparamlist AAMP file from the SARCvar aamp =AampFile.FromBinary(sarc.Files[$"Actor/GeneralParamList/{name}.bgparamlist"]);// Use indexing on the RootNode to// modify the AAMP keys// // In this example, I'm indexing for the EffectType// and EffectLevel in the first ParamObjectaamp.RootNode.ParamObjects[1].ParamEntries[0].Value=newStringEntry("AttackUp");aamp.RootNode.ParamObjects[1].ParamEntries[1].Value=2;// Once the edits have been made, serialize// the object to binary to be put back in// the SarcFilebyte[] aampData =aamp.ToBinary();// Update the SarcFile entrysarc.Files[$"Actor/GeneralParamList/{name}.bgparamlist"] = aampData;// Serialize and compress the SarcFilebyte[] compressedSarcData =Yaz0.CompressFast(sarc.ToBinary());// Finally, write the modified SARCFile.WriteAllBytes(file, );