how to create and save a text file for io read in later?

My wargame will allow you to pick the map to fight on.

Ok I found this:

I need to transfer a file from my pc to the directory where text files are saved - how would I do that? I know I was able to load my own sprites and found the posts showing how to load into the Codea sync’d dropbox but since the post above mentions a directory(local file = os.getenv(“HOME”)…“/Documents/Dropbox.spritepack/myFile1.txt”), how do i get a window open to it and get my file from my pc to there?


@Gib Do you have Dropbox on your PC and is it sync’d with your iPad. Anything you put in the Dropbox file on your PC should show on the iPad once you do the sync. There’s more info in the link you posted above.

I syncd it after I pasted in my map.txt file but don’t see it in the codea Dropbox…? I only see my graphics files

@Gib Unfortunatly, only files with a .png extension show in the Dropbox sprite area. The file is there, but doesn’t show. Try reading the file even though you don’t see it.

@dave ty sir. Is that a bug then?

or if not a bug, can we get make a folder so it shows every kind of file?

@Gig not for now, unforunately. It might even be against the rules of Apple.

@Gib One thing you can do is instead of making your files .txt, make them .png . That way they will show up in the folder for you to see and you can still read them. One thing, make sure you delete any file that you created as .txt because they will be there forever and you won’t see them on the iPad. They’ll just use up memory.

@Gib One other thing you might consider is naming your file something like “nameTxt.png”. That way when you look at the sprite pack you can see which are true png and which are just txt. Even though they will show in the sprite pack as a png without an image and a 0x0 size, when you do a spritelist(), you’ll be able to identify them as txt by the name. @Simeon, is there any reason why you can’t show all the files with their .extension .

@Jmv38 What does Apple have against showing files other than png’s? I don’t understand.

@dave1707 roger that, I’ll change to .png but I don’t understand why only those show?

@Gib @Jmv38 I don’t think Apple has anything against showing files. Before I switched to Codea, I was coding with iLuaBox Pro. That had file io that did directories, folders, and anything else to do with files. It was very similar to the file system on a PC. There was even SQL library code for working with databases.

@Gib Apple doesn’t want people exploring the file systems of iOS, or installing any other OS. Therefore they locked everything down so you can only use their software or applications from the App Store (which they can gaurantee has no apps for accessing the file system). Then came Jailbreaking. Look it up.

As for why Apple doesn’t want it, it’s because if you had freedom and installed whatever the heck you wanted, they would get less money, because you wouldn’t use their stuff. Also, they want to insure no viruses, inappropriate apps, etc.

Basically: money, control, and power.