Comments (7)
Tracked down the problem to the writeFile() calls resulting in incomplete files. There is a closed issue ( nim-lang/Nim#12315 ) with details on the fix. Compiling nim from devel branch and recompiling the tools with the devel build fixes the issue.
from neverwinter.nim.
Same issue when trying to run nwn_gff installed from nimble on Win10. Tried compiling it with mingw-w64 and MSVC, both resulting binaries giving me the header.structOffset == 56
error.
The precompiled binaries (1.2.7) from the releases tab are working with some issues. Mod files can be unpacked, files can be converted to json but it fails to convert some files back to GFF:
nwn_gff -i Repute.json -o Repute.fac --verbose
D [2019-10-12T17:56:00] NWN file encoding: windows-1252
D [2019-10-12T17:56:00] Other file encoding: windows-1252
fatal.nim(39) sysFatal
Error: unhandled exception: value out of range [RangeError]
Running nwn_gff on linux on that same file works without issues. I tracked down the problem to the GFF->JSON conversion, where invalid values are written as signed (-1
) instead of unsigned (4294967295
) values.
Linux output, working:
{
"__struct_id": 1,
"FactionGlobal": {
"type": "word",
"value": 1
},
"FactionName": {
"type": "cexostring",
"value": "Hostile"
},
"FactionParentID": {
"type": "dword",
"value": 4294967295
}
},
Windows output, not readable:
{
"__struct_id": 1,
"FactionGlobal": {
"type": "word",
"value": 1
},
"FactionName": {
"type": "cexostring",
"value": "Hostile"
},
"FactionParentID": {
"type": "dword",
"value": -1
}
},
EDIT: RE: the header.structOffset == 56
, I noticed that the extracted files (using a self-compiled version of the tools) when unpacking a module are incomplete. At least for areas (.are and .git files) the file length is 1/3 of what it should be and the struct offset value has the right value on the first byte and garbage on the following 3 bytes, causing the assertion to fail. It only happens on windows.
EDIT2: Laputian Bird confirmed that the latest precompiled binaries throw an error when converting a faction file from GFF->JSON->GFF on Win7 too.
from neverwinter.nim.
Also experiencing this issue on windows 10 pro.
Extracting DungeonEternalX.mod to C:\Users\urothis\Documents\Projects\dex
Error: Could not parse .nasher\tmp\011.uti: gff.nim(534) readGffRoot
... Error: unhandled exception: Expectation failed: header.structOffset == 56
... [ValueError]`
from neverwinter.nim.
I'm trying this file on Linux and getting the same error:
# nwn_gff -i module.ifo -o module.ifo.json --verbose
D [2019-10-12T18:20:40] NWN file encoding: windows-1252
D [2019-10-12T18:20:40] Other file encoding: UTF-8
gff.nim(534) readGffRoot
Error: unhandled exception: Expectation failed: header.structOffset == 56 [ValueError]
from neverwinter.nim.
The problem with that file is that it was corrupted because it wasn't extracted properly from the .mod file, causing the header to hold unexpected values. Linux binaries seem to be working fine.
I don't know what could cause the linux and windows versions to behave differently but the issue is with the windows version not reading files properly (this includes unpacking mod files, as I explained in my previous comment) and writing the json files differently from the linux version (in the case of FAC files it writes signed values instead of unsigned values).
PS: To summarize, windows self compiled binaries truncate and corrupt files extracted from .mod files. The precompiled binaries extract the .mod files properly but write incorrect .json files that can't be converted back to GFF. The problems are isolated to the windows binaries, I tested the same modules on linux and had no issues at all.
from neverwinter.nim.
Compiling nim from devel branch and recompiling the tools with the devel build fixes the issue.
Confirmed that this resolved the issue. As it is a Nim issue and not these tools specifically, I'd suggest the issue can be closed.
Suggestion to @niv to update the binaries to resolve this alongside the issues GoLoT noted in the pre-compiled binaries.
EDIT: Nim has released 1.0.2, which fixes the compiler issue at the root of this.
from neverwinter.nim.
https://github.com/niv/neverwinter.nim/releases/tag/1.2.8
Thanks everyone for chasing this down. Hopefully that'll be the end of that.
from neverwinter.nim.
Related Issues (20)
- nwn_script_comp: Too many open files
- nwn_script_comp: Allow case-insensitive script parsing HOT 3
- Script comp fails on PRC includes HOT 1
- nwn_script_comp: v1.7.1 doesn't properly utilize threads HOT 2
- nwn_script_comp: Existing but null/empty include files trigger an "ERROR: FILE NOT FOUND" when compiling the script HOT 1
- nwn_script_comp: Mismatched data type between function declaration and implementation is not properly detected
- scriptcomp: Ability to emit warnings
- nwn_script_comp: type mismatch on assignment isn't detected in non-void-main and non-starting-conditional scripts
- nwn_script_comp: Wrong error type detected upon using an unknown identifier as an if() argument
- Error when using a positive value with the + sign HOT 1
- nwn_nwsync_write throw error about size HOT 1
- scriptcomp: Avoid needless heap allocs HOT 2
- Windows releases have double ".exe.exe" extensions HOT 3
- Install Error: cannot open file: std/db_sqlite HOT 2
- NWN_GFF Assert Defects with gff output in stdout [Windows] HOT 3
- nwn_script_comp: Illegal storage access
- scriptcomp: ERROR: "for" STATEMENT CANNOT BE FOLLOWED BY A NULL STATEMENT.
- nwn_script_comp: Info level logs sent to stderr instead of stdout in node HOT 6
- nwn_script_comp: Custom directories for includes doesn't seem to be supported HOT 2
- nwn_script_comp: Cannot compile an include file on its own HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neverwinter.nim.