1. Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

GM:S 1.4 Surface_save to a sub directory? (SOLVED)

Discussion in 'Programming' started by Steve Gal, Aug 18, 2019.

  1. Steve Gal

    Steve Gal Member

    Joined:
    Jul 25, 2016
    Posts:
    18
    I have been looking for a while now, and I cant seem to find a way to save surfaces to, or even move a saved surface file to a sub-directory I created. Am I missing something? or the folder creation only for text files?

    The reason I want this is because upon exiting a room in my current game the "clutter" surface (containing a bunch of debris, gore, and destroyed remains) is saved for later use. Issue is I have a good 300 rooms and manually "going through every file to check if they exist and delete them if they do" is a bit messy. Was hoping I could just dump them all in a sub directory and delete the whole thing when needed instead.

    As I said I can't even see any functions that would move created files into a sub directory, am I missing something? I am aware GMS is sandboxed but I only want to work inside the working directory.
     
  2. Lukan

    Lukan Gay Wizard Freak

    Joined:
    Jun 20, 2016
    Posts:
    429
    You should just be able to surface_save("PATH_TO_SUB_DIRECTORY/filename.png");
    I do this for my game and it works fine, unless your sub directory is outside the sandbox?
     
    Lonewolff likes this.
  3. Steve Gal

    Steve Gal Member

    Joined:
    Jul 25, 2016
    Posts:
    18
    Oh thank you!

    If you could answer one more thing,
    is it full path, or just path inside the working directory?

    EDIT: Never mind I tested it, no full path needed, thank you again!
     
    Last edited: Aug 18, 2019

Share This Page