Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: edmundito on Sat 08/10/2005 18:06:02

Title: Special Characters and ReadRaw (SOLVED)
Post by: edmundito on Sat 08/10/2005 18:06:02
I have a text file I'm trying to read with my AGS game, and this text file has strings with quotes around them. For example:

"You win!"
"You didn't win!"
"You lose!"

I'd like to check for those quotes, and I'm inputting the text one character at a time for a good reason (obviously I'm very secretive and my file looks much more complex than simple quoted lines.) The problem is that when I read the input from the file, I don't ever get those quotes ("), or at least as ASCII decimal 34... so, basically, I can't check it like this:

char ch;
ch = input.ReadRawChar(); //(input being of *File Type)
if(ch == 34) DoSomething();

If you would like to know, I also tried if (ch == '"') just to see if it would work. and if (ch == '\"') gives me an error.

So, where are my quotes going, anyway? is there something else I need to know?

Edit: D'oh! I knew it was my fault. HOWEVER, it would have been easier if this were addressed in the manual, for us programmers who get confused.
Title: Re: Special Characters and ReadRaw
Post by: Rui 'Trovatore' Pires on Sat 08/10/2005 18:18:06
For curiosity's sake, and for the record, what was the problem?
Title: Re: Special Characters and ReadRaw
Post by: edmundito on Sat 08/10/2005 18:48:38
Well, there were many problems, but here are the reasons, in general:

1) The limits of ags make me think of clever ways to make my code work, but because I keep thinking that AGS is limited, I like to put the blame on it.

2) Learning the 2.71 string method, which is very useful in this case, but I'm still a little confused since I started working on this yesterday evening while I was falling asleep.

3) I ares an idiot. Which is the true reason why I wasn't seeing those quotes. Basically I was outputting stuff to a label to see what was going on, and I had it change the label at two places before a Wait(1); so it would display a quote, but then it would display the string, and because I had bugs, it displayed nothing but blank. So, that's why I didn't see the quotes.