crimsoncantab / aok-hotkeys

Hotkey Editor for Age of Empires II
Other
25 stars 9 forks source link

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

Open gregstein opened 6 years ago

gregstein commented 6 years ago

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 commented 6 years ago

You can do it from the editor on the site. Upload your 5.0+ hki file, then select a different version and download.

Jineapple commented 6 years ago

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 commented 6 years ago

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

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 commented 6 years ago

@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 commented 6 years ago

@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 commented 6 years ago

@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 commented 5 years ago

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.