• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

How to add file extention to get_save_filename

J

jb skaggs

Guest
Hi I can I set it so that the fille extension is added to the file when I use get_save_filename?
I dont want the enduser t have to type the ext manually.


Code:
leftclick code-----
window_set_cursor(cr_none);
 obj_screenshot.visible=0;
 obj_gotosettings.visible=0;
var name="";
screenshot=get_save_filename("*.png",name);
 if screenshot != ""
    {
 alarm_set(1,10);
       }
       else
show_message("file exists, file not saved")


alarm1-- code
screen_save(screenshot+".png");
 show_message(screenshot);
  window_set_cursor(cr_default);
 room_goto(0);

this throws the error:
Error! not allowing save with filename 'C:\Users\JBS\Documents\3.png'
Error! not allowing save with filename ''


But if I use this without the extension it saves just fine, or if I hand type the extension into the input box on the get _save_filename dialog it works fine.
 
Top