Topic:   FILEIO grid nav [GM/SC?]   (Read 33472 times)


0 Members and 1 Guest are viewing this topic.

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
FILEIO grid nav [GM/SC?]
« on: June 21, 2011, 12:26:19 PM »
This can definitely be used for GameMaker, and if someone could convert it, than also for SilverCreator.

If you base grid nav on arrays that take up 60-100 lines of code like me, than this i'll save you.
Code: [Select]
    IF stage = 1 THEN
      REPEAT vertical_positioning
        FILEIO INPUT 1 stage1
        FILEIO READ 1 array$
      END REPEAT
      FILEIO CLOSE 1
    END IF
all you need to do is set up the file (ie. stage1) in the first card like so
Code: [Select]
FILEIO OUTPUT 1 stage1
FILEIO WRITE 1 11111000000000000000000000
FILEIO WRITE 1 11111000000000000000000000
FILEIO WRITE 1 01111000000000000000000000
FILEIO WRITE 1 01111100000000000000000000
FILEIO WRITE 1 01111110000000000000000000
FILEIO WRITE 1 00111110000000000000000000
FILEIO WRITE 1 00111111000000000000000000
FILEIO WRITE 1 00111111000000000000000000
FILEIO WRITE 1 01111110000000000000000000
FILEIO WRITE 1 11111110000000000000000000
FILEIO WRITE 1 11111110000000000000000000
FILEIO WRITE 1 01111110000000000000000000
FILEIO WRITE 1 01111111111111111111100000
FILEIO WRITE 1 01111111111111111111110000
FILEIO WRITE 1 01111111111111111111111000
FILEIO WRITE 1 00111111111111111111111000
FILEIO WRITE 1 00011111111111111111110000
FILEIO WRITE 1 00000011111111111111100000
FILEIO WRITE 1 00000000110000001110000000
FILEIO WRITE 1 00000000010000000100000000
FILEIO WRITE 1 00000000000000000000000000
FILEIO WRITE 1 00000000000000000000000000
FILEIO WRITE 1 00000000000000000000000000
FILEIO WRITE 1 00000000000000000000000000
FILEIO WRITE 1 00000000000000000000000000
FILEIO WRITE 1 00000000000000000000000000
FILEIO CLOSE 1
you can see the stage. neat huh!

physically writhing the array out (even on separate lines) doesn't work.
and you don't even have to make the file,
but if you want to (such as when cheating) open a new doc in Text Edit, and click Format>Make Plain Text then save it w/ text encoding: 'Western (Mac OS Roman)' The numbers and such still have to be put in through GM though.

^---I spent so much time on the explanation above, because you can use it to cheat at GM games that utilize the FILEIO command. Albeit this only works if you own GM, and know how the developer encoded his document. A hard task especially if they decide to hide them!---^


7-5 lines of code compared to 60-100 lines, not to shabby don't you think?
I developed this with my new (short) RPG 'Fathers'
and since it'll be open source you can see more examples in that.

P.S. If you found this useful or amazing. click my reputation counter.
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: FILEIO grid nav [GM/SC?]
« Reply #1 on: June 22, 2011, 06:25:35 AM »
What exactly does this do?
I survived the spammage of 2007

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: FILEIO grid nav [GM/SC?]
« Reply #2 on: June 23, 2011, 12:18:28 PM »
it's just like having an array hold your grid nave values, but it makes a text doc do that instead.
It shrinks the file
it takes less time to program
and as said above: less lines of code

and theres a fail safe: If anyone tampers with the documents. it resets them to their original values.
« Last Edit: June 23, 2011, 12:18:50 PM by KurtManion »
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: FILEIO grid nav [GM/SC?]
« Reply #3 on: July 10, 2011, 08:51:02 AM »
I developed a SC method, and accidentally put it in another post. I only realized just now, so here's the SC along with the GM method explained differently

This can definitely be used for GameMaker, and SilverCreator
I'll be making a tutorial on it also


If you base grid nav on arrays that take up 60-100 lines of code like me, than this i'll save you.

Code: [Select]
    IF stage = 1 THEN
 Â     REPEAT vertical_positioning
 Â       FILEIO INPUT 1 stage1
 Â       FILEIO READ 1 array$
 Â     END REPEAT
 Â     FILEIO CLOSE 1
 Â   END IF

first set up the file (ie. stage1) in the first card like so
Code: [Select]
FILEIO OUTPUT 1 stage1
FILEIO WRITE 1 11111000000000000000000000
FILEIO WRITE 1 11111000000000000000000000
FILEIO WRITE 1 01111000000000000000000000
FILEIO WRITE 1 01111100000000000000000000
FILEIO WRITE 1 01111110000000000000000000
FILEIO WRITE 1 00111110000000000000000000
FILEIO WRITE 1 00111111000000000000000000
FILEIO WRITE 1 00111111000000000000000000
FILEIO WRITE 1 01111110000000000000000000
FILEIO WRITE 1 11111110000000000000000000
FILEIO WRITE 1 11111110000000000000000000
FILEIO WRITE 1 01111110000000000000000000
FILEIO WRITE 1 01111111111111111111100000
FILEIO WRITE 1 01111111111111111111110000
FILEIO WRITE 1 01111111111111111111111000
FILEIO WRITE 1 00111111111111111111111000
FILEIO WRITE 1 00011111111111111111110000
FILEIO WRITE 1 00000011111111111111100000
FILEIO WRITE 1 00000000110000001110000000
FILEIO WRITE 1 00000000010000000100000000
FILEIO WRITE 1 00000000000000000000000000
FILEIO WRITE 1 00000000000000000000000000
FILEIO WRITE 1 00000000000000000000000000
FILEIO WRITE 1 00000000000000000000000000
FILEIO WRITE 1 00000000000000000000000000
FILEIO WRITE 1 00000000000000000000000000
FILEIO CLOSE 1
you can see the stage. neat huh!

physically writhing the array out (even on separate lines) doesn't work.
and you don't even have to make the file,
but if you want to (such as when cheating) open a new doc in Text Edit, and click Format>Make Plain Text then save it w/ text encoding: 'Western (Mac OS Roman)' The numbers and such still have to be put in through GM though.

^---I spent so much time on the explanation above, because you can use it to cheat at GM games that utilize the FILEIO command. Albeit this only works if you own GM, and know how the developer encoded his document. A hard task especially if they decide to hide them!---^


7-5 lines of code compared to 60-100 lines, not to shabby don't you think?
I developed this with my new (short) RPG 'Fathers'
and since it'll be open source you can see more examples in that.

SC is the same basis. (any differences you may notice is that there are also built in SPRITE commands)
set up in the 'open card'
Code: [Select]
CREATESPRITE 1, "redsnake.png"
MOVESPRITE 1, 0, 0
OPENOUTFILE 1, "stage1"
FILEWRITELINE 1, "110110111"
FILEWRITELINE 1, "101011101"
FILEWRITELINE 1, "111111111"
FILEWRITELINE 1, "111100110"
FILEWRITELINE 1, "101100111"
FILEWRITELINE 1, "111111101"
FILEWRITELINE 1, "011111111"
CLOSEOUTFILE 1

then in keydown is the bulk
Code: [Select]
   LET yco = newy / 48
 Â  LET yco = yco + 1
 Â  LET xco = newx / 33
 Â  LET xco = xco + 1
 Â  OPENINFILE 1, "stage1"
 Â 
 Â  FOR repeat = 1 to yco
 Â     LET quadrant$=FILEREADLINE$(1)
 Â  NEXT
 Â 
 Â  LET space$ = MID$(quadrant$, xco, 1)
directions are almost identical to the Gm version

To develop the SC port I had too make my own application. My first SC application
http://www.mediafire.com/?qfd287g17gfyk4a
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: FILEIO grid nav [GM/SC?]
« Reply #4 on: December 08, 2011, 06:06:29 PM »
So when Conors wanted a 2-D array for SC it just hit me my SC grid nav. did just that.

It used to work, but now it doesn't.  [smiley=lolk.gif] since I forgot the very little SC that I knew, and can't find out where the 1.5 documents are :-/. I can't fi it myself
The error should be somewhere in the way I took data from the .txt document, or the MID function. I hate to bring up this old thread but it's bugging me that it inexplicably broke.
« Last Edit: December 08, 2011, 06:07:04 PM by KurtManion »
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: FILEIO grid nav [GM/SC?]
« Reply #5 on: December 10, 2011, 07:44:27 PM »
Oh yeah how does SC's file reading work? Will it take just any .txt file?
« Last Edit: December 10, 2011, 07:48:30 PM by Connors »
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: FILEIO grid nav [GM/SC?]
« Reply #6 on: December 10, 2011, 08:16:43 PM »
It'll take any file as long as it contains text.

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: FILEIO grid nav [GM/SC?]
« Reply #7 on: December 10, 2011, 08:24:02 PM »
I may just have the levels stored in a method for now actually, since I still have to type in all the tiles. However I could also add a function that loads a map from a file since it would have the same end result. If I do add custom support the game's levels will remain in the game so you can't cheat and it will be able to load custom levels from files.
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: FILEIO grid nav [GM/SC?]
« Reply #8 on: December 11, 2011, 09:07:08 PM »
Yes is was your level editor you were making a while ago, that gave me the initial idea, that and how cluttered QOM's grid nav. was.
Also it was how nobody used FILEIO commands, and I was looking for a good excuse to use them.

I'm going to use something similar for my iPhone game (which I've finnaly started  [smiley=WaveyWave2.gif]) So players can transfer maps even between computers.  [smiley=happy.gif]
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: FILEIO grid nav [GM/SC?]
« Reply #9 on: December 12, 2011, 10:04:22 AM »
Sounds pretty awesome.
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/