Results 1 to 10 of 13

Thread: Steam wrapper, exploring options

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member
    Join Date
    Apr 2014
    Location
    Lower Saxony, Germany
    Posts
    38
    I have been asked for an additional listing covering Steam achievements.
    So this is my current unit "steam" which deals with achievements and stats (integer stats only).

    Please note: This only works with the compiler target Win32 for now!

    https://docs.google.com/document/d/10O1GtdrLxHQxYbDQ9KyG5DcGLofBRnRAWFbxprcDcpA/edit?usp=sharing

    The following is a rough game framework in order to show how to use the unit.

    Code:
    program mygame;
    uses
      ...
      steam;
    
    procedure update_event;
    begin
      steam_update;
      ...
    end;
    
    procedure run_level;
    begin
      ...
      repeat
        update_event;
        ...
        if steam_overlay then begin
          if not gamepaused then start_break;
        end
        else begin
          if gamepaused then finish_break;
        end;
        ...
      until quit;
      ...
    end;
    
    procedure mainloop;
    begin
      ...
      repeat
        update_event;
        steam_debuguserstats;
        ...
        run_level;
        ...
      until quit;
    
      if not mission_survived then begin
        incandstore_istat(1); // stat "NumLosses"
        i := get_istat(1);
        case i of
          // died 1x
          1: setandstore_achievement(0); // Lazarus
          // died 9x
          9: setandstore_achievement(1); // cat
          // died 99x
          99: setandstore_achievement(2); // Coyote
        end;
      end;
      ...
    end;
    
    begin
      ...
      if steam_init({your APP ID})=-1 then halt;
      ...
      mainloop
    end.

  2. #2
    Not bad update, that's something at least.

    May i propose that a steam -> c wrapper library could be automaticly generated with including pascal headers in something like a scripting language like php? i had a lot of luck with this for newton dynamics.
    This is my game project - Top Down City:
    http://www.pascalgamedevelopment.com...y-Topic-Reboot

    My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
    http://www.pascalgamedevelopment.com...source+manager

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •