Skip to content

Alchemy API

The editor is built on a custom C# library, the Alchemy namespace, that you can use directly to script archive edits. It needs the .NET SDK 9.0 and the source code of the project.

Open a level archive, move every entity of the crates file up by 100 units, and save:

// Open archive
IgArchive archive = IgArchive.Open(archiveDir + "L101_NSanityBeach.pak");
// Find archive file
IgArchiveFile file = archive.FindFile("L101_NSanityBeach_Crates.igz", FileSearchType.NameWithExtension)!;
// Convert to igz file
IgzFile igz = file.ToIgzFile();
// List objects of type CEntity
List<CEntity> entities = igz.FindObjects<CEntity>();
// Move all entities up
entities.ForEach(entity => entity._parentSpacePosition._z += 100.0f);
// Save igz file in archive
file.SetData(igz.Save());
// Save updated archive to disk
archive.Save();
  • Directorysrc/
    • DirectoryAlchemy/ Alchemy-related classes
      • DirectoryIgArchive/ .pak files
        • …
      • DirectoryIgzFile/ .igz files
        • …
      • DirectoryigObject/ Alchemy objects
        • …
    • DirectoryHavok/ Havok-related classes
      • DirectoryHavokFile/ .hkx files
        • …
      • DirectoryhkObject/ Havok objects
        • …
    • DirectoryEditor/ the editor application
      • …
    • DirectoryUtils/ common utilities
      • …
    • Program.cs entry point

The source code is on GitHub. Questions about the internals are welcome in the #nst-level-editor or #alchemy channels of the Alchemy Reverse Engineering discord server.