Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
input text adventure room desc. from text file
#1
Hello. I would like some help with displaying room descriptions for my text adventure game taken from a text file. I am using a sequential file and inputing the string with: input #. Even if I put quotes around my description (inside my text file), I can't get the description to print out neat and in paragraph style. The only thing that I can think of at this point is using LINE INPUT # in a loop and print everything one line at a time until I get to a certain character in my text file, such as '}'. What do you think? Am I going at this the wrong way? I know there has got to be an easier way to do this and make the room descriptions look good. I'd be happy if someone who has been where I am now could show me how they did it. Thank you in advance for your reply.

Regards,

K.S.
Reply
#2
That is what I'd do. Except I'd use a a fewwordstogether instead of just one character IE:

Code:
CLS
OPEN "test.txt" FOR INPUT AS #1
DO
LINE INPUT #1, a$
IF a$ = "lineendthingy" THEN END ELSE PRINT a$
LOOP UNTIL EOF(1)
CLOSE
Quote:a
s
asdd
]
lineendthingy
asd231
asd
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#3
That pretty much clears it up. Thank you for the information whitetiger0990! You know your stuff.

Sincerely,

K.S.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)