How to set up a text file to read?

Started by W.A.S.P.r.o.c.k.s, Wed 29/10/2008 00:25:57

Previous topic - Next topic

W.A.S.P.r.o.c.k.s

I read how to use the ReadRawLineBack() function as well as trying this syntax: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=29871.0 but it returns an error because the file is null. Is there a specific location the text file should be in so that my program can find it? Or am I doing something else wrong?

Also once it's imported, is there a way to get it into a dialog?

Ghost

#1
The syntax in the thread you linked to seems to be valid- where did you put the file? Technically it should *need* to be in your game's COMPILED folder.

For your second question, no. You can GET but not SET the text of a line. You could theoretically write your own dialog system, but it would be quite a lot of work. Why do you need to get those texts from a file, by the way? Maybe there is a different way to solve your problem.

Dualnames

If you ask if you can use the line somewhere there's a yes and no.
You can display the line as a message since you probably gonna save it into a string variable. As for the exists thing you should check the manual there's a file.Exist command. The file can be either in the compiled folder(main folder of the game) or in the savegames folder(that might cause problems if you want to use the file from the beginning since players would have to copy it to their savegames and that would cause problems to newbies).
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Trent R

Quote from: Dualnames on Wed 29/10/2008 11:28:13
(that might cause problems if you want to use the file from the beginning since players would have to copy it to their savegames and that would cause problems to newbies).

A installer might cause problems, but it'd solve that one.


~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

SMF spam blocked by CleanTalk