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

a command to convert HD 5.X hotkey profile to AoC? #55

Open
gregstein opened this issue Sep 26, 2018 · 7 comments
Open

a command to convert HD 5.X hotkey profile to AoC? #55

gregstein opened this issue Sep 26, 2018 · 7 comments

Comments

@gregstein
Copy link

Hello,

I was wondering if your python project has a command to convert HD 5.0+ hotkeys version to AoC/FE/HD 2.0?

@crimsoncantab
Copy link
Owner

crimsoncantab commented Sep 26, 2018 via email

@Jineapple
Copy link

It should be noted that (at least as far as I know), there's no reason to downgrade the version. A HD 5.0+ file works fine for AoC as well, it just can't use the extra hotkeys encoded in it.

@crimsoncantab
Copy link
Owner

For some details on how the conversion currently works on the hotkeys site programmatically (sorry, it's a bit convoluted):

  • load_file() uses a "default" file for a particular version to create a HotkeyFile object
  • download() takes one HotkeyFile object ("assign") and copies it into another HotkeyFile object ("hkfile")
  • You could simply convert an hki file by turning it into a HotkeyFile a la load_file(), then turn the version you want into a HotkeyFile and copy your first HotkeyFile to the version template a la download()

Hopefully that makes sense. Some of that convolution may not be necessary, if, as @Jineapple states, any version of the game will accept a *.hki file from any version. If the game rejects the file header, then it's only necessary to set the .version attribute of the HotkeyFile then .serialize() it, rather than copy the hotkeys into it from the first version.

@gregstein
Copy link
Author

@Jineapple thank you!! I didn't know that
@crimsoncantab Beautiful answer! Thank you so much! It would be great if you could add an argument to load and download a hotkey file to the respected version using your method.

@crimsoncantab
Copy link
Owner

@gregstein are you looking to do this programmatically (i.e. adding a utility script to the codebase), or have a utility on the site to do that?

@gregstein
Copy link
Author

@crimsoncantab I need this so badly for my project AoE2Tools project and I would also love to credit/link to your project. "utility script to the codebase" just like the one you have in hkizip.py d <player0.hki> player0.bin .

@crimsoncantab
Copy link
Owner

Sorry @gregstein, this issue fell through the cracks since it was already closed. I think I can whip something up real quick, if you're still needing it. As mentioned above downgraded versions seem to pull in the hotkeys file just fine, but it doesn't hurt to have one that matches the version you're downgrading to.

@crimsoncantab crimsoncantab reopened this Mar 5, 2019
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

3 participants