Steam achievements for PC & MAC Instructions

BlitzMax Forums/BlitzMax Programming/Steam achievements for PC & MAC Instructions

coffeedotbean(Posted 2016) [#1]
After struggling today I wanted to put this together to clear up the old discussion posts about integrating steam achievements on PC and MAC, more so for MAC as PC is super easy.

http://www.blitzmax.com/Community/posts.php?topic=84183
http://www.blitzmax.com/Community/posts.php?topic=96950

skidracer did all the work in getting integration going with his steamstub so a big thankyou to him; below I aim to clear up how you get it working, MAC is rather involved, I have included a new example.bmx with a steam.type to show achievements working with the test application.

If you can get this working with the example.bmx, it should be clear how to integrate it to your own projects, big thanks again to skidracer.

Tested with STEAM_SDK v138a, BMax 1.50/1.51, windows 10, OS X 10.11

MAC

1. Download latest Steam SDK from https://partner.steamgames.com/ (you need to be a member)
2. Extract to Desktop (recommended)
3. Download steamstub4a.zip from https://code.google.com/archive/p/max-edit/downloads
4. Extract some place
5. ** Copy the steamstub.cpp text from this forum post and save as steamstub.cpp within the steamstub4a folder (might need to use xcode editor)
6. Copy and paste example.bmx code to a file and save inside steamstub4a folder
7. Open example.bmx and edit the 1st IMPORT under ?MacOS to point to the the ‘osx32’ folder in the steam SDK folder (/users/?/desktop/sdk_x/sdk/redist_bin/osx32)
8. Open example.bmx and edit the 3rd IMPORT under ?MacOS to point to the ‘steamstub.cpp’ file you saved
9. Open steamstub.cpp and edit the ‘steam_api.h’ path at the top to point to the steam_api.h file inside the steam SDK folder (/users/?/desktop/sdk_x/sdk/public/steam)
10. Compile and run example.bmx (it will fail with error: dyld: Library not loaded: @loader_path/libsteam_api.dylib)
11. Right click and open the example.debug.app or example.app file that's been created, show package contents, in the Contents/MacOS folder copy over the ‘libsteam_api.dylib’ found in the steam SDK folder ’/users/?/desktop/sdk_x/sdk/redist_bin/osx32
12. Compile and run example.bmx

All being good it should work. Remember to do step 11 if you delete the app.

** I am no MAC expert but I had issues saving this in TextEdit (it seemed to have mangled the file when saved), had to save in 'xcode > file:new > os x > other > empty' else I got error 'error: expected unqualified-id' when I compiled.


PC

1. Download steamstub4a.zip from https://code.google.com/archive/p/max-edit/downloads
2. Extract some place
3. Copy and paste example.bmx code to a file and save inside steamstub4a folder
4. Compile and run example.bmx

All being good it should work.


example.bmx


steamstub.cpp



Pingus(Posted 2016) [#2]
Thanks, it will be definitivly usefull one day.