UnrealPackageReader.js
    Preparing search index...

    Class UnrealPackageReader

    The public entry class.

    Construction parses the package. Consumers then use that one object for everything: header, tables, queries, and lookup tables.

    Index
    propertyTypes: readonly [
        "Unknown",
        "Byte",
        "Integer",
        "Boolean",
        "Float",
        "Object",
        "Name",
        "String",
        "Class",
        "Array",
        "Struct",
        "Vector",
        "Rotator",
        "Str",
        "Map",
        "Fixed Array",
    ] = PROPERTY_TYPES
    objectFlags: {
        RF_Transactional: 1;
        RF_Unreachable: 2;
        RF_Public: 4;
        RF_TagImp: 8;
        RF_TagExp: 16;
        RF_SourceModified: 32;
        RF_TagGarbage: 64;
        RF_NeedLoad: 512;
        RF_HighlightedName: 1024;
        RF_EliminateObject: 1024;
        RF_InSingularFunc: 2048;
        RF_RemappedName: 2048;
        RF_Suppress: 4096;
        RF_StateChanged: 4096;
        RF_InEndState: 8192;
        RF_Transient: 16384;
        RF_PreLoading: 32768;
        RF_LoadForClient: 65536;
        RF_LoadForServer: 131072;
        RF_LoadForEdit: 262144;
        RF_Standalone: 524288;
        RF_NotForClient: 1048576;
        RF_NotForServer: 2097152;
        RF_NotForEdit: 4194304;
        RF_Destroyed: 8388608;
        RF_NeedPostLoad: 16777216;
        RF_HasStack: 33554432;
        RF_Native: 67108864;
        RF_Marked: 134217728;
        RF_ErrorShutdown: 268435456;
        RF_DebugPostLoad: 536870912;
        RF_DebugSerialize: 1073741824;
        RF_DebugDestroy: 2147483648;
    } = OBJECT_FLAGS
    soundFlags: {
        SF_None: 0;
        SF_Looping: 2;
        SF_Streaming: 4;
        SF_Music: 8;
        SF_No3D: 16;
        SF_UpdatePitch: 32;
        SF_NoUpdates: 64;
        SF_HasLipSync: 128;
        SF_Compressed: 256;
    } = SOUND_FLAGS
    polyFlags: {
        PF_Invisible: 1;
        PF_Masked: 2;
        PF_Translucent: 4;
        PF_NotSolid: 8;
        PF_Environment: 16;
        PF_ForceViewZone: 16;
        PF_Semisolid: 32;
        PF_Modulated: 64;
        PF_FakeBackdrop: 128;
        PF_TwoSided: 256;
        PF_AutoUPan: 512;
        PF_AutoVPan: 1024;
        PF_NoSmooth: 2048;
        PF_BigWavy: 4096;
        PF_SpecialPoly: 4096;
        PF_SmallWavy: 8192;
        PF_Flat: 16384;
        PF_LowShadowDetail: 32768;
        PF_NoMerge: 65536;
        PF_CloudWavy: 131072;
        PF_DirtyShadows: 262144;
        PF_BrightCorners: 524288;
        PF_SpecialLit: 1048576;
        PF_Gouraud: 2097152;
        PF_NoBoundRejection: 2097152;
        PF_Unlit: 4194304;
        PF_HighShadowDetail: 8388608;
        PF_Memorized: 16777216;
        PF_RenderHint: 16777216;
        PF_Selected: 33554432;
        PF_Portal: 67108864;
        PF_Mirrored: 134217728;
        PF_Highlighted: 268435456;
        PF_FlatShaded: 1073741824;
        PF_EdProcessed: 1073741824;
        PF_RenderFog: 1073741824;
        PF_EdCut: 2147483648;
        PF_Occlude: 2147483648;
    } = POLY_FLAGS
    brushClasses: readonly [
        "AssertMover",
        "AttachMover",
        "Brush",
        "ElevatorMover",
        "GradualMover",
        "LoopMover",
        "MixMover",
        "Mover",
        "RotatingMover",
    ] = BRUSH_CLASSES
    moverClasses: readonly [
        "AssertMover",
        "AttachMover",
        "ElevatorMover",
        "GradualMover",
        "LoopMover",
        "MixMover",
        "Mover",
        "RotatingMover",
    ] = MOVER_CLASSES
    meshClasses: readonly ["Mesh", "LodMesh", "SkeletalMesh", "SkelModel"] = MESH_CLASSES
    enumBumpType: readonly ["BT_PlayerBump", "BT_PawnBump", "BT_AnyBump"] = BUMP_TYPE
    enumMoverEncroachType: readonly [
        "ME_StopWhenEncroach",
        "ME_ReturnWhenEncroach",
        "ME_CrushWhenEncroach",
        "ME_IgnoreWhenEncroach",
    ] = MOVER_ENCROACH_TYPE
    enumMoverGlideType: readonly ["MV_MoveByTime", "MV_GlideByTime"] = MOVER_GLIDE_TYPE
    enumCsgOper: readonly [
        "CSG_Active",
        "CSG_Add",
        "CSG_Subtract",
        "CSG_Intersect",
        "CSG_Deintersect",
    ] = CSG_OPER
    enumSheerAxis: readonly [
        "SHEER_None",
        "SHEER_XY",
        "SHEER_XZ",
        "SHEER_YX",
        "SHEER_YZ",
        "SHEER_ZX",
        "SHEER_ZY",
    ] = SHEER_AXIS
    fileTypesByExt: {
        u: "System";
        uax: "Sound";
        umod: "UMOD";
        umx: "Music";
        unr: "Map";
        sac: "Map";
        utx: "Texture";
        uxx: "Cache";
        uz: "Zip";
        tmp: "Zip";
    } = FILE_TYPE_BY_EXTENSION
    extByFileType: {
        system: "u";
        maps: "unr";
        textures: "utx";
        sounds: "uax";
        music: "umx";
    } = EXTENSION_BY_PACKAGE_PATH
    defaultPackages: ReadonlyMap<PackagePath, readonly string[]> = DEFAULT_PACKAGES
    • Resolve an object reference: zero is null, and an index beyond either table is undefined. The internal resolver (UnrealPackage.object) folds that second case into null; this method keeps the two apart because a consumer can distinguish "no object" from "dangling reference" with === null.

      Parameters

      • index: number

      Returns UObject | null | undefined

    • Parameters

      • index: number

      Returns string

    • Returns { grouped: Record<string, string[]>; ungrouped: string[]; length: number }

    • Every sound in the package, with display metadata added.

      Mutates each sound's cached readData() result - name, package, and, when the payload looks like plain PCM WAVE, the channel/rate/depth fields sniffed from the RIFF header. Compressed or extended WAVEs keep whatever the object itself carried.

      Returns SoundInfo[]

    • A light actor's colour as HSL. UT stores hue and saturation as bytes, with saturation inverted (0 = full colour), and the defaults are UT's own.

      Parameters

      Returns { h: number; s: number; l: number }

    • Parameters

      • flags: number

      Returns (
          | "PF_Invisible"
          | "PF_Masked"
          | "PF_Translucent"
          | "PF_NotSolid"
          | "PF_Environment"
          | "PF_ForceViewZone"
          | "PF_Semisolid"
          | "PF_Modulated"
          | "PF_FakeBackdrop"
          | "PF_TwoSided"
          | "PF_AutoUPan"
          | "PF_AutoVPan"
          | "PF_NoSmooth"
          | "PF_BigWavy"
          | "PF_SpecialPoly"
          | "PF_SmallWavy"
          | "PF_Flat"
          | "PF_LowShadowDetail"
          | "PF_NoMerge"
          | "PF_CloudWavy"
          | "PF_DirtyShadows"
          | "PF_BrightCorners"
          | "PF_SpecialLit"
          | "PF_Gouraud"
          | "PF_NoBoundRejection"
          | "PF_Unlit"
          | "PF_HighShadowDetail"
          | "PF_Memorized"
          | "PF_RenderHint"
          | "PF_Selected"
          | "PF_Portal"
          | "PF_Mirrored"
          | "PF_Highlighted"
          | "PF_FlatShaded"
          | "PF_EdProcessed"
          | "PF_RenderFog"
          | "PF_EdCut"
          | "PF_Occlude"
      )[]

    • A map's LevelInfo actor, or null for a package that is not a map.

      The engine defines it as the first entry of the level's actor list (ULevel::GetLevelInfo in Engine/Inc/UnLevel.h of the UT 436 source release), so that is what is returned. The actor is usually named LevelInfo0, but not always.

      Falls back to the first LevelInfo export if the level data cannot be read.

      Returns ExportTableObject | null

    • A map's event links: each actor whose Event is set, paired with every actor whose Tag matches it.

      Returns EventLink[]

    • The LevelInfo summary shown for maps: title, author, song, etc. with the object-reference properties resolved to names.

      Parameters

      • allProperties: boolean = false

      Returns Record<string, unknown>

    • Parameters

      • packageName: string

      Returns boolean

    • Top-level package imports: the files this one needs alongside it.

      The file type of a custom package is not recorded anywhere, so ext and type are only set where they can be inferred. A custom package that supplies a Music object is labelled .umx here as a convenience. The label comes from the imported object's package, not the level's Song name, so music named differently from its package (e.g. St3nge.st3_nge) is covered.

      Returns Dependency[]

    • getDependencies() split into stock (default) and custom packages. When ignoreCore is set (it is by default), the stock packages that virtually every game package depends on (Core, Engine, ...) are omitted entirely, length included - their presence goes without saying, so a consumer listing dependencies rarely wants them.

      Parameters

      • ignoreCore: boolean = true

      Returns DependenciesFiltered

    • Export counts per class name, lowercased.

      Returns Record<string, number>

    • A map's screenshot frames, in order.

      The game menus load the texture named Screenshot and draw it (UMenu/UMenuScreenshotCW.uc, UBrowser/UBrowserScreenshotCW.uc). A montage is ordinary texture animation: UTexture::ConstantTimeTick walks AnimNext from frame to frame, restarting from the first texture at a null link. The walk in this reader stops at: a null link, an import object (this reader only holds one package at a time), and at a frame already collected, since some maps link the last frame back to the head.

      With no Screenshot texture the game shows nothing. As a convenience, this reader falls back to LevelInfo.Screenshot, when that lives in this package.

      Returns LevelScreenshots