Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parsing and saving a map results in: 'Couldn't load map!' #4

Open
XertroV opened this issue Nov 1, 2023 · 1 comment
Open

parsing and saving a map results in: 'Couldn't load map!' #4

XertroV opened this issue Nov 1, 2023 · 1 comment

Comments

@XertroV
Copy link
Contributor

XertroV commented Nov 1, 2023

script to reproduce:

import sys
from src.parser import parse_node, generate_node

def main(filepath: str):
    data, nb_nodes, raw_bytes = parse_node(filepath)
    print(f"Parsed nb nodes: {nb_nodes}, bytes len: {len(raw_bytes)}")
    print("Generating gbx")
    gbx_bs = generate_node(data)
    print(f"Generated len: {len(gbx_bs)}")
    with open(filepath[:-8] + "_resaved.Map.gbx", "wb") as f:
        f.write(gbx_bs)
    print("done")

if __name__ == "__main__":
    file = sys.argv[1]
    main(file)
@schadocalex
Copy link
Owner

I will add MT chunks soon, you could try without. You may add a GUI (for dev) to see if something is wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants