Closed ghost closed 3 years ago
Sorry for reporting bugs all the time 😂
Haha no problem! It's good that you report them, else they would not be fixed and other people would keep encountering them \:)
I just updated the library, let me know if the error still occurs! Btw, your file doesn't appear to have an UTexture2D export so it won't work either way (you would get a different error though).
C:\Users\a_dep\Documents\test fortnite bot\node_modules\unreal.js\dist\ue4\assets\Package.js:11 class Package extends UObject_1.UObject { ^
TypeError: Class extends value undefined is not a constructor or null
at Object.
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:94:18)
at Object.
Still
And you updated the library?
Normally yes. Lemme recheck
yes
Do u have discord so i can send code?
MarcelWRLD#4682
Should be fixed in the newest update.
C:\Users\a_dep\Documents\test fortnite bot\node_modules\unreal.js\dist\ue4\assets\Package.js:11 class Package extends UObject_1.UObject { ^
TypeError: Class extends value undefined is not a constructor or null at Object. (C:\Users\a_dep\Documents\test fortnite bot\node_modules\unreal.js\dist\ue4\assets\Package.js:11:33)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32) (C:\Users\a_dep\Documents\test fortnite bot\node_modules\unreal.js\dist\ue4\assets\PakPackage.js:5:19)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
PS C:\Users\a_dep\Documents\test fortnite bot>
at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:94:18)
at Object.
Code is :
// Create new instance const unreal = require('unreal.js') const fs = require('fs') const usmap = new unreal.UsmapTypeMappingsProvider(fs.readFileSync("++Fortnite+Release-18.30-CL-17882303-Windows_oo.usmap")) const provider = new unreal.FileProvider("C:/Program Files/Epic Games/Fortnite/FortniteGame/Content/Paks", unreal.Ue4Version.GAME_UE4_LATEST, usmap) provider.mappingsProvider.reload() // Loads .usmap // Setting this to '0' will skip reading directory index // Means it will not populate .utoc file entries, so.getFiles() will be empty
// Leaving it to default value will slightly increase pak mounting time
provider.ioStoreTocReadOptions = 0
// 'start' the provider
await provider.initialize()
// submit aes key to decrypt paks
await provider.submitKey(unreal.FGuid.mainGuid, "fa2aabc586ac624ba24a9e69729da9fef8e10402b79b975a6081a561fe26c555")
const pkg = provider.loadGameFile("FortniteGame/Content/Athena/Items/Cosmetics/Characters/CID_144_Athena_Commando_M_SoccerDudeA")
console.log(pkg.toJson()[0])
const tex = pkg.getExportOfTypeOrNull(UTexture2D)
const image = unreal.Image.convert(tex) // converts texture to image (import Image class from unreal.js)
// writes it it a file
fs.writeFileSync("image.png", image)