• 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!

Legacy GM Surface_save to a sub directory? (SOLVED)

S

Steve Gal

Guest
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.
 

Lukan

Gay Wizard Freak
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?
 
S

Steve Gal

Guest
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?
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 by a moderator:
Top