Modding on OS X

Questions specific to OpenMW-CS can be asked, and content development related topics can be discussed here
Erasmus
Posts: 3
Joined: 16 Nov 2016, 18:28

Modding on OS X

Post by Erasmus »

Hey everyone, I've been trying to mod OpenMW on my Macbook for the past day with no success. I've looked at the wiki and asked reddit, but I still can't figure it out so I thought I'd make an account and ask here.

I created the directory "data" under $HOME/Library/Preferences/openmw/ (the directory was not created automatically, is it supposed to be?), and I added the mod folders to that folder. I then followed the instructions on the wiki and edited the config file. My problem is that no mods are activated when I run OpenMW and no .esps show up in the data files tab on the launcher. I'm also positive that my mod folders are normalized.

Here's what I have in my config file so far for reference:

data="/Users/me/morrowind_files/Data Files"
data="/Users/me/Library/Preferences/openmw/data/AnimationCompilation"
data="/Users/me/Library/Preferences/openmw/data/BetterBodies'

Am I missing something obvious or doing something wrong? Any help would really be appreciated.
User avatar
AnyOldName3
Posts: 2677
Joined: 26 Nov 2015, 03:25

Re: Modding on OS X

Post by AnyOldName3 »

What happens if you leave the quote marks out of the data= lines? It's supposed to require them, but recently, someone said it wasn't doing on their system.
Erasmus
Posts: 3
Joined: 16 Nov 2016, 18:28

Re: Modding on OS X

Post by Erasmus »

AnyOldName3 wrote:What happens if you leave the quote marks out of the data= lines? It's supposed to require them, but recently, someone said it wasn't doing on their system.
Yeah that fixed it! Thanks so much.
User avatar
Atahualpa
Posts: 1176
Joined: 09 Feb 2016, 20:03

Re: Modding on OS X

Post by Atahualpa »

@AnyOldName3: Still no idea why this happens? Maybe we should update the Wiki and/or create a bug report?
User avatar
AnyOldName3
Posts: 2677
Joined: 26 Nov 2015, 03:25

Re: Modding on OS X

Post by AnyOldName3 »

I'm going to have a more in-depth look. If I had to guess, I'd say that different builds may be using different versions of Boost.
User avatar
Svetomech
Posts: 69
Joined: 01 Jun 2014, 12:51
Location: Moscow
Contact:

Re: Modding on OS X

Post by Svetomech »

Probably reading of values is done in incorrect way. E.g. in C# I would do it like this:

Code: Select all

string fileLine;

using (var reader = new StreamReader(filePath))
    while (!(fileLine = reader.ReadLine()).StartsWith("Key")) ;

if (String.IsNullOrWhiteSpace(fileLine))
    return null;

index = fileLine.IndexOf("/");

return (index != -1) ? fileLine.Substring(index).TrimEnd("\"") : null;
User avatar
AnyOldName3
Posts: 2677
Joined: 26 Nov 2015, 03:25

Re: Modding on OS X

Post by AnyOldName3 »

I've had a more detailed look, and it definitely should still require the double quotes, even if Boost has changed, as their documentation for the specific function being called has not changed. Neither has the code for the function, and the code that function calls is something that should have had no reason to change, and no reason to differ between different operating systems.

It definitely requires quotes on the Windows build of 0.40, which Ace provides via Chocolatey. He might have to correct me on this, but I think that's built against Boost 1.58.

We now have confirmed that it doesn't work with quotes on:

This user's OSX system (It might help to know where the build came from and which OSX version is used, so we can work out which Boost version is being used).

SteveODom's linux system with an unknown distro and unknown build source.

Ideally, we should get both of these users to test older builds which were less likely to be up to date.
User avatar
AnyOldName3
Posts: 2677
Joined: 26 Nov 2015, 03:25

Re: Modding on OS X

Post by AnyOldName3 »

The actual read code basically works as follows:

We give Boost Program Options a load of descriptions of keys and the C++ types to map them to.

We get an input stream for the config file, wrap it in an escape hash filter (to stop Boost being mean and breaking on certain characters), and give it to Boost.

For each key-value pair, Boost checks if the value type has an operator>> to initialise it. If so, it gives that function the input stream. If not, it needs to have a validate function for that type, which it passes a sequence of tokens taken from the stream until a value is returned.

All value types which can be affected by the escape filter have an operator>> or a validate function that is aware of this - in the case of some types, it reads the string and then reverses the action of the filter, but the rest use a filter with the opposite action.

In the case of paths, most of OpenMW uses boost::filesystem::path objects, which can be created via operator>>. However, the actual value type we tell Boost to create is a custom components::files::EscapePath, has a path field and an operator>> which just wraps the stream in an unescape hash filter and then calls the path field's operator>> with the wrapped stream. According to Boost's documentation, the operator>> function for paths checks for a quotation mark, and if it's there, puts the contents of the stream into the path until a second unescaped quotation mark is reached. I've looked at the code, and it seems to do this by calling another boost function specifically designed to add or remove quotes round things when putting them into or removing them from streams, and things would be badly broken in a lot of places if this didn't work.
Erasmus
Posts: 3
Joined: 16 Nov 2016, 18:28

Re: Modding on OS X

Post by Erasmus »

AnyOldName3 wrote: This user's OSX system (It might help to know where the build came from and which OSX version is used, so we can work out which Boost version is being used).
I'm running the latest release of OpenMW (0.40.0) that I got from Github, and my OS is El Capitan 10.11.5. I'm happy to provide any other system information if you need it.
User avatar
AnyOldName3
Posts: 2677
Joined: 26 Nov 2015, 03:25

Re: Modding on OS X

Post by AnyOldName3 »

That should be enough, thanks.
Post Reply