Implementing Steam achievements?

  • #10, by hallinniklasWednesday, 29. July 2015, 21:07 9 years ago
    Hi all

    I am also struggling with this.

    I have the steam_api.dll in the game's folder. When I start the game via steam I get the "Access Steam while playing"- popup in the corner, so I'm pretty sure that works.

    My version of Visionaire is 3.7.1. The wiki says this should work since version 3.6..

    Do I literally just write it like in the attached screenshot? Or are there other ways to put code into your game? These are the first lines of code I have written in Visionaire.

    Thanks!

    Newbie

    15 Posts


  • #11, by BigStansTuesday, 04. August 2015, 23:28 9 years ago
    Hi, right you can use this.

    But it was better to script a little bit smile

    For example:


    -- let's check if steam has initialized & set a value based on return value
    local steamLoaded == getProperty("steam_initialized")
    
    if steamLoaded then
       local bAchievement1 = getSteamAchievement(apiName)
       if bAchievement1 then
         print("Egg unlocked")
       end
    else
      print("no")  
    end
    


    Hm… But i am nur sure, if you can use the steam_api.dll with the current steam client. We update the steam SDK much times for the client. But try it smile

    Great Poster

    361 Posts

  • #12, by JoemcrThursday, 28. January 2016, 12:15 8 years ago
    Helloooooo,

    I'm trying to implement Steam achievments, but can't seem to get them working.

    I set up the achievements via steamworks, I added the setGameClientAchievement script in the game, I included the steam_api.dll in the content folder when I built the game and I launched from the Steam client... but the achievements didn't show.

    I'm using Visionaire 4.2

    Is there something obvious I'm missing?

    Newbie

    96 Posts

  • #13, by CactusMuffinTuesday, 02. February 2016, 20:21 8 years ago
    Hi.

    First of all: I'm not able to answer your question. I'd like to ask another one.

    My question is quite off-topic, but I didn't want to make a new thread only because of one little question. Sorry if this isn't allowed, but I don't know where I should ask otherwise.
    So, i've read that LUA is relatively easy to learn. Do you guys think it's that easy that it's possible to learn it by reading tutorials on the internet, or do I have to find another way?
    How have you learned LUA?

    Thanks in advance.

    Newbie

    27 Posts

  • #14, by MachtnixTuesday, 02. February 2016, 20:48 8 years ago
    Here are some threads about "how to learn Lua" on the forum.

    I think, learning Lua isn't the problem - it's similar to other script languages - and simple enough (f.e.without declaring variable types as integer, string...). The problem (for me) is to connect the Visionaire specific libraries - the Vis data structures - to Lua and to the editor. This Vis object structure thing. You don't find something about it in a Lua book. There is a lack of documentation ... It's only the wiki and the fabulous work of AFRLme.

    Thread Captain

    1097 Posts

  • #15, by CactusMuffinTuesday, 02. February 2016, 21:03 8 years ago
    Here are some threads about "how to learn Lua" on the forum.


    Well... I don't know why, but I didn't even think of looking for this topic in the forum. Thanks. confuse

    I think, learning Lua isn't the problem - it's similar to other script languages - and simple enough (f.e.without declaring variable types as integer, string...). The problem (for me) is to connect the Visionaire specific libraries - the Vis data structures - to Lua and to the editor. This Vis object structure thing. You don't find something about it in a Lua book.


    cry I don't have a clue about anything in this topic. I don't know what this "Vis object/data structure" is.
    So this whole thing doesn't seem to be as easy as i thought (Write any working LUA script into this "Script editor" in Visionaire grin)
    Damn.

    Newbie

    27 Posts

  • #16, by MachtnixTuesday, 02. February 2016, 21:19 8 years ago
    Example: you have a game character. You want him walking to a tree. This object structure is the interface, the "translator" between Lua (as the big mother language with tons of functions) and the structure inside of Visionaire, which is only for Visionaire. That's how I understand it. In Lua you can write: "if there is a tree, the character has to stop there". Dot!. Something like this: if object_tree = true then (call) function stop_character end... But how can you make the character really stop? You have to know the specific orders and structures, how the script "talks" to the character and how you have to put them into the Lua sript...

    Thread Captain

    1097 Posts

  • #17, by CactusMuffinTuesday, 02. February 2016, 21:24 8 years ago
    Oh, that's what you've meant. Alright, thanks. I'll try to learn more about this.

    Newbie

    27 Posts

  • #18, by smac96Wednesday, 12. July 2017, 16:54 7 years ago
    Hi guys,

     
    I still have Visionaire v3.7 and I would like to implement Steam achievements on my game. This is the first time I do it. Do you guys can please tell me if the following is all I have to do to implement it?

    1. create the Steam achievements for the game in the Steamworks website:
    (image 1)

    2. open the project of the game in Visionaire and create a script in order to unlock the Steam achievement when needed:
    (image 2)

    3. Remember to drop the .dll/.so/.dylib files from the steam SDK into the executable directory of the game:
       - Under Windows:
         yourgame/steam_api.dll
       - Under Linux:
         yourgame/steam_api.so
       - Under MacOS:
         yourgame.app/Contents/MacOS/steam_api.dylib

    Newbie

    97 Posts

  • #19, by smac96Thursday, 13. July 2017, 20:18 7 years ago
    Uhm... I tried but it doesn't work.

    Is the code wrong or do I need to add more code when the game starts?

    I think I miss something but I don't know what.

    Any suggestions?

    Newbie

    97 Posts

  • #20, by afrlmeThursday, 13. July 2017, 21:12 7 years ago
    I don't think you need to copy the entire script into your execute a script mate. It was syntax.
    setSteamAchievement("STEAM_ACHIEVEMENT_CHAPTER_1") -- set achievement to true

    The flags bit is for resetting the achivement. By default it's false so not needed. If you are wanting to test whether the game is triggering the achievement when the achievement goal is met, then you might want to reset your achievements using the flag...
    setSteamAchievement("STEAM_ACHIEVEMENT_CHAPTER_1", flags=1, clear = true})

    Anyway, hopefully this makes some sense now.

    Imperator

    7278 Posts