1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    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:
    397
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice