• 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 External files problem

K

Kabcorp

Guest
I'm trying to have a "maps" folder for placing maps manually and get a file listing by GM:S.

I seen GM:S use AppData\Local\gm_ttt_xxxxx as working_directory when i play the game from the IDE.
But when i export the game to standalone ZIP project, working_directory is the same folder where the .EXE is.

Is it possible to set the working_directory folder for when i play the game by IDE? else i need to copy copy copy externals files.

ps: i can't use "Included Files" in IDE because files will be edited manually / deleted / new maps etc etc...
 
P

PandaPenguin

Guest
short answere: NO
long answere here

it is impossible to select any other folder locations via code than working_directory and program_directory
you can have the player select a custom folder each time the game starts with the get_open_file and get_save_file functions to get access to other directories but that's rather inconvenient

I have struggled with the sandbox and tested for workarounds for my own game a lot but it's not working other than intended by YoYo Games
 
D

DennisGMC

Guest
There is a fix for this, first of all download this extension:
http://gmc.yoyogames.com/index.php?showtopic=567528
By putting "FS_" in front of any of the file functions you won't be limit to the working directory and can acces almost any place on the pc.

However to get it to work you must do one of the two things.
Downgrade to version 1.4.1757 (http://store.yoyogames.com/downloads/gm-studio/GMStudio-Installer-1.4.1757.exe)
It is the latest stable version of gamemaker which fully works with the extension.
The updater will say its a beta and you need to be on the beta channel, even though it's an stable version.

If you want to use the latest version of gamemaker you have to do the following since the compiler will give 2 errors with the latest release:
search for "sound_add" in the bottom left search bar of gamemaker, then delete that function from the extension. Do the same for "sound_replace".
Then navigate to your project folder and find the file "GMResources.gml" somewhere in the extension folder i assume.
Using notepad++ (because this shows line numbers) comment out line 250 and 240 (or just delete those 2 lines) and save it.
 
K

Kabcorp

Guest
Ok, thank you PandaPenguin & DennisGMC, i'll try it.

But that mean the game Data can not be dynamic in classic use?
 
K

Kabcorp

Guest
I only have a problem with FS_file_find_first() now. It returns nothing at all. Else, all works =)
 
Last edited by a moderator:
D

DennisGMC

Guest
Ok, thank you PandaPenguin & DennisGMC, i'll try it.

But that mean the game Data can not be dynamic in classic use?
I don't really understand what you mean, the only difference is that you aren't limit to the working_directory.

I only have a problem with FS_file_find_first() now. It returns nothing at all. Else, all works =)
I don't use the latest version of gamemaker nor this function but it works similiar to the default gamemaker function:
https://docs.yoyogames.com/source/dadiospice/002_reference/file handling/file system/file_find_first.html
If it worked fine without the extension then you could give the full path to the directory, so like this:
file = FS_file_find_first("C:\TestFolder\User Content\*.doc", fa_readonly);
But i'm not really sure what the problem is since i don't use that function.
 
K

Kabcorp

Guest
I tryed to unuse FA_READONLY and use -1, it works now.
Thanks
 
Top