Skip to content

Error when trying to translate a Scenario file with still compressed text block #5

@HolographicWings

Description

@HolographicWings

Getting this error:
PS D:\XXXXXX\MH Frontier\translation> D:\Python\3.12.1-FrontierTextHandler\python.exe .\FrontierTextHandler\main.py --scenario-to-bin .\outputscenarioen\scenario-1_0_0_0_S1_T102_C0.json .\scenariosjp\1_0_0_0_S1_T102_C0.bin
INFO: Found 1 scenario translations to write
Traceback (most recent call last):
File "D:\XXXXXX\MH Frontier\translation\FrontierTextHandler\main.py", line 630, in
main(parse_inputs().parse_args())
File "D:\XXXXXX\MH Frontier\translation\FrontierTextHandler\main.py", line 538, in main
src.import_scenario_from_csv(
File "D:\XXXXXX\MH Frontier\translation\FrontierTextHandler\src\import_data.py", line 1824, in import_scenario_from_csv
rebuild_scenario_file(output_file, new_strings, output_path)
File "D:\XXXXXX\MH Frontier\translation\FrontierTextHandler\src\import_data.py", line 1748, in rebuild_scenario_file
output_data[offset + len(encoded)] = 0x00
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
IndexError: bytearray index out of range

with half of scenario files
it happens when one of the secondary text blocks are JKR
It's gonna happen with 1_0_0_0_S1_T102_C0.bin by example.
But it won't happen on 1_0_0_0_S1_T10_C0.bin by example, which have only one text block.

Screenshot showing the presence of a JKR block still compressed
Image

Used json file
scenario-1_0_0_0_S1_T102_C0.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions