Jump to content


Photo

Saving File


  • Please log in to reply
7 replies to this topic

#1 Questioningorno

Questioningorno

    GMC Member

  • New Member
  • 621 posts

Posted 18 August 2009 - 02:23 AM

Uhh... well I don't know how to start this. I have a drawing program and I want all the drawing I have made to be saved so you can edit it later. But I looked through the actions and am wondering how you can save a file onto your computer. How would you go about this? And be able to open it fine?


Thanks in advance.
  • 0

#2 2DLuis

2DLuis

    Graphic Designer

  • GMC Member
  • 2493 posts
  • Version:GM8

Posted 18 August 2009 - 02:28 AM

Look into GM's built in saving and loading system.
Or use encrypted INI's :)
  • 0

#3 Questioningorno

Questioningorno

    GMC Member

  • New Member
  • 621 posts

Posted 18 August 2009 - 02:31 AM

I have never used INI files much less encrypted could you explain more what they are?
  • 0

#4 2DLuis

2DLuis

    Graphic Designer

  • GMC Member
  • 2493 posts
  • Version:GM8

Posted 18 August 2009 - 02:35 AM

Sure, it is a text file that looks like:
[INI]
key1=value
key2=value2
[Drawing]
shape1=circle
shape2=rectangle

Basicly, [INI] and [Drawing] are called sections.

the other arguments are called keys, so you can store alot of data in INIs in different sections under different keys.
  • 0

#5 Questioningorno

Questioningorno

    GMC Member

  • New Member
  • 621 posts

Posted 18 August 2009 - 02:39 AM

How would I start saving an INI file?
  • 0

#6 2DLuis

2DLuis

    Graphic Designer

  • GMC Member
  • 2493 posts
  • Version:GM8

Posted 18 August 2009 - 02:42 AM

Here is a code that writes Datagoeshere in a test.ini file, in the same directory as the game

ini_open('test.ini')
ini_write_string('Data','Test','Datagoeshere')
ini_close()

  • 0

#7 Questioningorno

Questioningorno

    GMC Member

  • New Member
  • 621 posts

Posted 18 August 2009 - 02:50 AM

I'm really confused. Do I need an .ini file for each saved file?

Edited by Questioningorno, 18 August 2009 - 02:51 AM.

  • 0

#8 2DLuis

2DLuis

    Graphic Designer

  • GMC Member
  • 2493 posts
  • Version:GM8

Posted 18 August 2009 - 02:52 AM

I think for what you are doing you are best off with GM's built in save function, because INI's may take a while to grasp
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users