Jump to content


Photo

Included Files


  • Please log in to reply
4 replies to this topic

#1 Chrscool8

Chrscool8

    Call me Chris.

  • GMC Member
  • 2243 posts
  • Version:GM:Studio

Posted 05 March 2012 - 10:36 PM

Alright, so included files is a mess. I can see the frameworks for the options you'd normally have in GM8.1 in the project file with notepad, but the dialog is missing. I cant get it to work by manipulating those values, either.

What's the situation with this? I'd like to have my files exported to the temp directory as I used to in 8.1. Is this feature something that might be re-implemented soon in an update, or is this something that will take a while? Or is there a workaround of some kind right now without having it crap files all around the working directory?

Thanks,
Chris


*Also check my post two down for a little more info.

Edited by chrscool8, 05 March 2012 - 10:54 PM.

  • 0

#2 Samuel Venable

Samuel Venable

    GMC Member

  • Banned Users
  • 632 posts
  • Version:GM:Studio

Posted 05 March 2012 - 10:51 PM

If you compile exe with GM html5 it should work if you use the exporting via gml functions, rather than in the include files dialog. Not sure if the temp_directory works in HTML5 though, couldn't hurt to try it.

#3 Chrscool8

Chrscool8

    Call me Chris.

  • GMC Member
  • 2243 posts
  • Version:GM:Studio

Posted 05 March 2012 - 10:53 PM

Right, I meant exporting to exe. I wanted the auto-export to the temp dir, though, rather than doing them all with gml.

To add, it looks like it's at least fairly planned since I found this in the manual. That's promising, at least.



Here you can indicate a number of properties. You can press the Load button to indicate which file must be included. You can change the File Name if you want to save the file under a different name than the original file name.

There are a number of options you can set. When you check Store in the editable .gmx file the included file in not only added to the executable but also to the editable version of the game. The advantage is that you can send the editable version to somebody else and can be sure the file is still there. Also, you can remove the included file if you want or move it elsewhere without problems. The disadvantage is that the editable version of the game becomes larger and takes longer to load.

Checking the option Free memory after export means that after the file has been exported (when running the game) it will be removed from memory. If you want to be able to export it again later you should uncheck this option. If a file that is exported already exists it is normally not written. You can change this behavior by checking Overwrite existing files. Also, when the game is finished the files are normally not removed (unless they are in the temporary folder which is completely removed). You can change this by checking Remove at game end.

A word of warning is in place here. If you are testing your game, the working directory of the game is the directory where the .gmx file is stored. If your include files are also stored here and you choose to remove them at the end of the game you might loose them alltogether! So better not store these files with the .gm81 file but e.g. in a subfolder!

Finally you can indicate to what folder the files are exported. There are four options here. In the default situation the files are exported in the folder where the stand-alone game is stored. This is also the working directory for the game. So the game can just use the file names to access them (no paths are required). This works well if the stand-alone is stored e.g. on the hard disk but will fail if it is stored on a read-only device, e.g. on a CD.

The second possibility is to indicate that the files must be exported into the temporary folder that is created during the running of the game. If you select this option you will need to provide the path to the temporary folder when you use the file name during the game. This path can be obtained using the built-in variable temp_directory. Don't forget to add the backslash in this case. So to e.g. play a video file you might type in the following piece of code:



{ splash_show_video(temp_directory+'\movie.avi',true);}

Realize that this temporary folder is removed once the game is finished. So you e.g. cannot store save games or special information in this case. Only choose this option when you want the game to be run from a CD or when you do not write any files from within your game.

The third option is to indicate the folder to which the file must be exported yourself. If it does not exist it will be created. E.g. you could specify C:\MyGame. (Note that you need to provide a full patgh and that you should not include a backslash at the end.) This is only allowed when the game does not run in secure mode.

Finally, you can indicate not the export the file automatically. In this case you should use e.g. the function export_include_file(fname) to export it yourself when required.




  • 0

#4 alexandervrs

alexandervrs

    GMC Member

  • GMC Member
  • 708 posts
  • Version:GM:Studio

Posted 07 March 2012 - 02:53 AM

Mike replied that they changed the functionality to be plain "auto-export on game start > use file > delete after game end" because HTML5 didn't support the extra options.

However, I posted myself a request to change slightly the functionality on the Windows version, since the included files are auto exported, they should do so inside the temp_directory when on Windows and clear that up automatically on game end. Exporting files automatically in the game's working directory can be messy and dangerous in case the working_directory is the Desktop (can litter with files, overwrite existing files with same name etc.)

Edited by alexandervrs, 07 March 2012 - 02:54 AM.

  • 0

#5 Chrscool8

Chrscool8

    Call me Chris.

  • GMC Member
  • 2243 posts
  • Version:GM:Studio

Posted 07 March 2012 - 02:57 AM

Mike replied that they changed the functionality to be plain "auto-export on game start > use file > delete after game end" because HTML5 didn't support the extra options.

However, I posted myself a request to change slightly the functionality on the Windows version, since the included files are auto exported, they should do so inside the temp_directory when on Windows and clear that up automatically on game end. Exporting files automatically in the game's working directory can be messy and dangerous in case the working_directory is the Desktop (can litter with files, overwrite existing files with same name etc.)


Ah. I agree that there should be Seperate options for the platforms. Why limit them all if 1 can't handle it? Good to see you're right on the same page as I.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users