Jump to content


Photo

export resorces from in game


  • This topic is locked This topic is locked
7 replies to this topic

#1 kelson

kelson

    GMC Member

  • GMC Member
  • 323 posts

Posted 16 April 2012 - 05:18 AM

what i want is a way to export resorses from in game. the reason i want to do this is because i want to make a sprite creator that is made for game maker, so that you can creat a sprite by adding body parts together then animate your charector. so i want to be able to make a .gmres file that contains the animation as a script and all of the sprites used for the charecter. I know it is posible what i want to know is whether it is probable to export resorses as a gmres file that will be compatable with gm.

thanks for reading

Kelson
  • 0

#2 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9331 posts
  • Version:Unknown

Posted 16 April 2012 - 04:00 PM

Sure, just decode the .gmres format :lol: .

But seriously, is there any reason you want to make a .gmres file instead of just saving the code and images and using execute_file() or some other custom reading method? If you want it to be compatible with GM, then just save your own .GML files with the code and the images separately.

A .gml file has a simple format:

#script_name
/* Code for script_name() goes here */
#other_script
/* Code for other_script() goes here */

Etc. for all your scripts.

-IMP
  • 1

#3 turgon

turgon

    VP Studios

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

Posted 16 April 2012 - 04:32 PM

IMP,

I coincidentally was just trying to figure out how to export .gml scripts. I don't quite understand the method however.

Here is what I currently have:
file = file_text_open_write('test_script.gml');
file_text_write_string(file, '#test_script'); file_text_writeln(file);
file_text_write_string(file, "show_message('Example script');");
file_close();

Am I on the right track?
  • 0

#4 kelson

kelson

    GMC Member

  • GMC Member
  • 323 posts

Posted 16 April 2012 - 05:10 PM

IceMetalPunk

thanks for the advice. i have already thought of doing that. but it would just be more simple for people to import .gmres into there games. but i can manage with .gml files. but if anyone can tell me how to decode and code a .gmres that would be great.
  • 0

#5 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9331 posts
  • Version:Unknown

Posted 17 April 2012 - 07:45 AM

IMP,

I coincidentally was just trying to figure out how to export .gml scripts. I don't quite understand the method however.

Here is what I currently have:

file = file_text_open_write('test_script.gml');
file_text_write_string(file, '#test_script'); file_text_writeln(file);
file_text_write_string(file, "show_message('Example script');");
file_close();

Am I on the right track?

Close, but the last function should be file_text_close(file) ;) .

IceMetalPunk

thanks for the advice. i have already thought of doing that. but it would just be more simple for people to import .gmres into there games. but i can manage with .gml files. but if anyone can tell me how to decode and code a .gmres that would be great.

I haven't seen any documentation on the GMRES format, and I believe there's at least some encryption in it; so while I can't help you further, I do wish you luck in your attempts :) .

-IMP
  • 0

#6 turgon

turgon

    VP Studios

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

Posted 18 April 2012 - 04:31 PM

Thanks IMP. It doesn't quite work the way I wanted it to (where you could use 'import script' in gamemaker to import the file), even though it outputs a '.gml' file. Any suggestions?
  • 0

#7 kelson

kelson

    GMC Member

  • GMC Member
  • 323 posts

Posted 18 April 2012 - 07:36 PM

hey turngon you need to put define anfter your # like so

file = file_text_open_write('test_script.gml');
file_text_write_string(file, '#define test_script');
file_text_writeln(file);
file_text_write_string(file, "show_message('Example script');");
file_text_close(file);
  • 0

#8 turgon

turgon

    VP Studios

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

Posted 18 April 2012 - 07:52 PM

hey turngon you need to put define anfter your # like so

file = file_text_open_write('test_script.gml');
file_text_write_string(file, '#define test_script');
file_text_writeln(file);
file_text_write_string(file, "show_message('Example script');");
file_text_close(file);


Ah, thanks Kelson! That should work.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users