cyberrumor / ammo

Almost Manual Mod Organizer - Linux MO for Bethesda Games
GNU General Public License v2.0
25 stars 6 forks source link

Add Morrowind support #20

Closed cyberrumor closed 6 months ago

cyberrumor commented 1 year ago

I'll be honest, I'm dragging my feet on this because I would need to carefully replace every case-insensitive occurrence of "data" with a variable that could either be "Data" or "Data Files" depending on the game. It's not necessarily difficult, but it's not exactly fun and it will probably take a long time.

On the bright side, that should really be the only requirement for Morrowind support. Might need to double check that it uses the typical location for Plugin.txt. Pretty straight forward.

RPINerd commented 9 months ago

I'm installing openmw on my laptop right now, might take a crack at this

cyberrumor commented 9 months ago

Nice! Ammo isn't compatible yet is because "Data" is hard coded everywhere. If we replace instances of "Data" with self.game.data.name and make sure Morrowind gets assigned "Data Files" instead of "Data", it should fix compatibility (self in this case referring to mod_controller).

I think the bulk of the work here is testing. We would want a way to separate mods using "Data Files" folder and mods using "Data" folders. The best way to do that would probably be to make new folders "test/morrowind/Downloads" and put the mock mods Morrowind needs in there, and tests for it in "test/morrowind".

cyberrumor commented 6 months ago

I looked into this a bit, and it appears that Morrowind determines plugin load order by file modified date. We can achieve this with a python version of something like touch -m <date> <file> , but it would require a bit of logic to wrangle the dates. I'm also not sure if it cares about the symlink modified date or the target's modified date (if they're even different). Additionally, you have to list the plugins in the actual .ini instead of a Plugins.txt like the other games, which is also a bit hairy.

I had a go at this but wasn't happy with the code at all. It impeded the clarity of everything else. With the way Morrowind handles load order being a bit of an outlier and not really fitting well with the current design, I don't currently have plans to support Morrowind anymore.

On the bright side, the work to easily allow a different name for a game's Data folder is done, so if you're still looking to make this work, a good place to start would be game_controller.py, where you can assign Game.data = Game.directory / "Data Files" for Morrowind.