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

Extension (SOLVED) Help with GMFileSystem

Discussion in 'Programming' started by JesterOC, Mar 6, 2019.

  1. JesterOC

    JesterOC Member

    Joined:
    Jun 27, 2016
    Posts:
    23
    So i'm having an issue...
    My script below uses GMFileSystem extension...
    It's supposed to copy a file from inside some folders in working_directory....

    However, it shows my message "No OUT file"
    meaning the file didn't get copied out of the sandbox.

    FS_file_copy() and/or FS_file_exists() MUST be the culprit...
    I just don't know why...

    Code:
    ///FS_COPY_SafeSaveFile_OUT(number, SAVETYPE)
    var copyNum = real(argument0);
    var saveType = argument1;
    
    
    var BS = "/";
    var folderdood = "ShootAndLoot/SavedChars";
    var filenamedood = "SavedChar"+string(copyNum);
    
    if saveType == SAVETYPE.gun{
    folderdood = "ShootAndLoot/SavedGuns";
    filenamedood = string(copyNum)+".CUSTOM_GUN"
    }
    else if saveType == SAVETYPE.gunMap{
    folderdood = "ShootAndLoot/SavedGuns";
    filenamedood = string(copyNum)+".CUSTOM_GUN_MAP"
    }
    
       if directory_exists(working_directory+folderdood)
       {
       if file_exists(working_directory+folderdood+BS+filenamedood)
       {
       FS_file_copy(
       working_directory+folderdood+BS+filenamedood,
       global.DriveLetter+folderdood+BS+filenamedood
       )
       //check for the copy
       if FS_file_exists(global.DriveLetter+folderdood+BS+filenamedood)
       {return true}else{show_message("No OUT file")}
       }else{show_message("No sandbox file")}
     
       }else{show_message("No dir")}
     
       return false;

    global.DriveLetter + /ShootAndLoot/SavedChars exists as far as FS_directory_exists() is concerned, and i ca see it at C:/ShootAndLoot/SavedChars...

    I've tried everything I can think of....
    - Changed backslashes to forward slashes...
    - removed the slash on the end of folderdood... and added when needed...
    - removed working_directory from FS_file_copy...

    I'm using version 1.4.4a of the extension found here.

    Any help or suggestions would be much appreciated...

    Edit: fixed it by replacing
    working_directory
    with
    game_save_id
     
    Last edited: Mar 6, 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