GoG SDK

You’re welcome. Would have posted it sooner, but this thread completely escaped my radar. Thanks to Bjorn for the tag.

4 Likes

I’ve only implemented it in your example project, not my actual game, but I did use my own client id/secret and this is the result:

image

Once again, thank you very much! This has saved me a ton of grief. I’d put you in the credits, but well, thanks to your work on DefOS you’re already there.

Also thank you to @britzl and @Mathias_Westerdahl for your guidance, thankfully I didn’t have to bombard you with a thousand follow up questions in the end.

4 Likes

Is it ok if I create an Asset Portal entry for this?

And I must say I not not like this line of code:

Usually, we recommend code like this for checking the existance of a native extension module:

if gog then
    gog.do_stuff()
end

Yeah, sure. Go for it!

Those pharanteses creeped in because the original Interrogation code was something like local available = not not (env.build_with_gog_achievements and gog_galaxy). I should remove them. The not not is there to convert to a bool.

I had multiple achievement implementations (Steam, GoG and a debug logger) and they all followed the same API, so that’s why I needed that M.available there.

UPDATE: I removed it now. There’s really no need for it outside of that context.

Yeah, I understand why it’s there, but in a conditional check it doesn’t really matter if it’s a table or a boolean, as long as it evaluates to true. Also this as an alternative:

local available = (gog_galaxy ~= nil)

Yes, this notation is more explicit. :+1: I think I carried over this double negation idiosyncrasy from JS, where you otherwise have to check against both null and undefined.

2 Likes

I suspect @dapetcu21 and I are the only ones using this for now. However I figure it’s worth mentioning anyway in case someone else is having issues.

Mac builds recently started failing for me. It seems it’s because GOG’s SDK has been updated. I grabbed the ‘Mac OS X 10.10+ (64 bit)’ download from here (login required) and replaced the old libGalaxy.dylib with libGalaxy64.dylib in lib/osx and res/osx. Seems to be building fine now!

5 Likes