GameMaker How to make Steam Screenshots?

D

Dwighty4000

Guest
I tried to incorporate the code from the wiki page but this is wrong when you insert it!
What am I doing wrong here and what do I have to do so that I can take screenshots that are then saved on Steam?
Unbenannt.PNG

Code:
/// @description Making Steam Screenshot
steam_send_screenshot(filename, width, height);

if steam_is_screenshot_requested()
   {
   var file = "Catch_The_Haggis_" + string(global.scrn_num) + ".png");
   screen_save(file)
   steam_send_screenshot(file, window_get_width(), window_get_height());
   global.scrn_num += 1;
   }
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
There is but an extra closing parenthesis in that example, has that proven to be an obstacle?
Code:
if steam_is_screenshot_requested()
    {
    var file = "Catch_The_Haggis_" + string(global.scrn_num) + ".png";
    screen_save(file)
    steam_send_screenshot(file, window_get_width(), window_get_height());
    global.scrn_num += 1;
    }
 
D

Dwighty4000

Guest
There is but an extra closing parenthesis in that example, has that proven to be an obstacle?
Code:
if steam_is_screenshot_requested()
    {
    var file = "Catch_The_Haggis_" + string(global.scrn_num) + ".png";
    screen_save(file)
    steam_send_screenshot(file, window_get_width(), window_get_height());
    global.scrn_num += 1;
    }
all what you can see on my screenshot is everything. no script and no other objects...
But the code is instandly wrong after pasting it in the step event of my persistent object!
 

sv3nxd

Member
There is but an extra closing parenthesis in that example, has that proven to be an obstacle?
Code:
if steam_is_screenshot_requested()
    {
    var file = "Catch_The_Haggis_" + string(global.scrn_num) + ".png";
    screen_save(file)
    steam_send_screenshot(file, window_get_width(), window_get_height());
    global.scrn_num += 1;
    }



all what you can see on my screenshot is everything. no script and no other objects...
But the code is instandly wrong after pasting it in the step event of my persistent object!
As YellowAfterlife said, there is a missing parenthesis "(".
Using his code example, it's working for me.

Wrong:
var file = "Catch_The_Haggis_" + string(global.scrn_num) + ".png");

Right:
var file = ("Catch_The_Haggis_" + string(global.scrn_num) + ".png");
or
var file = "Catch_The_Haggis_" + string(global.scrn_num) + ".png";
 
D

Dwighty4000

Guest





As YellowAfterlife said, there is a missing parenthesis "(".
Using his code example, it's working for me.

Wrong:
var file = "Catch_The_Haggis_" + string(global.scrn_num) + ".png");

Right:
var file = ("Catch_The_Haggis_" + string(global.scrn_num) + ".png");
or
var file = "Catch_The_Haggis_" + string(global.scrn_num) + ".png";
Thanks, it works now, but with the small change that I have removed: "global.scrn_num" and replaced it with different times to prevent the screenshots from being overwritten later and to make it easier to find specific screenshots ...
But I still have a little question?
How hard would it be, and what exactly would I have to do to have the screenshot function executed by an additional CPU thread in order to ensure that the game was not exposed to any lag while taking the screenshot?

This is my curren step-event code in the persistent obj_Steamscreenshot object:
Code:
if (screenshotcooldown == false)
{
   screenshotcooldown = true;
   alarm[0] = room_speed * 1.1;

   if steam_is_screenshot_requested()
    {
       var file = ("Steam_Screenshots" + string(current_year) + "," + string(current_month) + "," + string(current_day) + "," + string(current_hour) + "," + string(current_minute) + "," + string(current_second) + ".png");
       screen_save(file)
       steam_send_screenshot(file, window_get_width(), window_get_height());
    }
}
 
Top