Accented Characters Appearing?

Started by Valentine, Sun 08/06/2008 14:03:38

Previous topic - Next topic

Valentine

Hi, I'm having a problem with my game crashing, and I can't understand why. The error message I receive is:

An error has occured. Please contact the game author for support, as this is likely to be a scripting error and not a bug in AGS. (ACI version 3.00.1000)

in "room2.asc", line 290

Error: Cannot display message with extended characters in SCI font

(Accented characters, for example the special French and German e/a/u/i letters cannot be used by default. You need to import a TTF font to do so).


The thing is, I don't WANT to show these accented characters.

Line 290 of my code is:

cTeller.SayBackground(String.Format("$%d", BlockRefund[Clicker1]));}

Would anyone be able to suggest what I need to do to correct this? Thanks :)

skuttleman

Hmmm. What's BlockRefund[Clicker1]? I mean, what is it declares as and what value does it contain?

Valentine

#2
Hey thanks for responding.

Its a simple int, just declared as int Clicker1;
Its value changes, but when it crashed it would be at 100.

EDIT

Oh, and BlockRefund is an array: int BlockRefund[500];

Khris

No, what's BlockRefund[]? Clicker1 has got to be an int since it's used as array index.
Is BlockRefund[] an integer array?

Valentine

Lol, I realised just after I posted and edited my post.

BlockRefund is an array: int BlockRefund[500];

skuttleman

I'm stumped. Try this:

* Import a TTF Font.
* In the game_start() function, put:
Code: ags

Game.SpeechFont = eFontFont3; // OR WHATEVER THE NEW FONT IS


Then run the game and see what text is displayed when it gets to the erroneous line.

Let us know the result.

Valentine

Thanks again for the replies.

I switched it to a TTF font, and now its appearing as the symbol þ.
Oh, and a correction, the value is -100, not 100.
Is $-100 code for that symbol in AGS?

The strange thing is, it doesn't happen all the time, only sometimes, even though the code isn't changing.

Khris

So BlockRefund[Clicker1] is -100?
Or is Clicker1 itself -100?
And why would an int end up as "þ"?

What does BlockRefund[] contain? And what is it supposed to contain? More info, please.

Valentine

#8
BlockRefund[Clicker1] is -100.
And I have no idea why it's ending up as þ lol.

I'm not sure what you mean by what it contains?
It's meant to end up with the character saying $-100, and it is doing that most of the time. But every so often it's showing þ instead, even though the information isn't changing.

EDIT

Ok, I've let it run a whole bunch of times, and it turns out its not just the þ appearing. A "J", "G", ">", and one of those square symbols you get on webpages when your browser doesn't have the font has appeared too lol. I'm completely lost why this is happening lol.

skuttleman

he means Clicker1 has a value. Like 69. and then BlockRefund[69] has a SEPARATE value. So,

* What is Clicker1 at the time of the error?
* And what is BlockRefund[Clicker1] at the time of the error?

Valentine

Clicker1 is changing, but the weird symbols seem to appear/not appear at random regardless of its value (I've tried it with many different values but the weird symbols seem to appear around 10% of the time no matter wha the number is).
BlockRefund[Clicker1] is always -100.

skuttleman

BlockRefund[Clicker1] is probably NOT always -100. When you declare an array, like BlockRefund[500], you have effectively delcared 500 integers.
BlockRefund[0] has a value, BlockRefund[1] has a value, BlockRefund[2] has a value, ....  So unless your code assigns each and every one of the those integers to '-100', or Clicker1 is NOT in fact changing, then something else is wrong with your code.
Try changing the line to this:

Code: ags

cTeller.SayBackground(String.Format("$%d", Clicker1));}


And see what it says.

Valentine

Okay, I changed it to remove the - sign, but the symbols still appear.

I also fixed Clicker1 so that it was always at 100 and didn't change, but the symbols still appeared.

The part I can't understand is that sometimes the symbols appear, at other times they don't, even when the code isn't changing - ie. Clicker1 is staying at 100.

Pumaman

Hmm this does sound like a bug of some sort, because no matter what the value of BlockRefund[Clicker1], it should still just be displaying a number and not any wacky characters.

Would you be able to upload a sample game that demonstrates the error?

Valentine

Of course  :)

I don't want to release all of my code publicly and I'm not too sure how to isolate the problem script from the rest of my game, but I'll upload the files and send you a PM with its URL so you can have a look at it. I'm happy it might not be my amateurish scripting that's the problem lol.

Matti

To demonstrate the problem you can just upload the compiled-folder. No scripting in there..

SSH

Have you ever cut-and-pasted anything into a script from Microsoft Word?

It changes quotes and hyphens to odd characters that AGS doesn't display.
12

Valentine

#17
Quote from: matti on Mon 09/06/2008 13:55:46
To demonstrate the problem you can just upload the compiled-folder. No scripting in there..

Oh heh silly me. Yeah will do.

Quote from: SSH on Mon 09/06/2008 14:05:41
Have you ever cut-and-pasted anything into a script from Microsoft Word?

It changes quotes and hyphens to odd characters that AGS doesn't display.

Nope, I'm pretty sure I haven't. At least looking through the scripts in AGS doesn't show any of the symbols that are appearing.

EDIT

Okay, I've uploaded a demonstration of the problem here: http://disneysneverland.angelfire.com/AGS_Tycoon.rar

To replicate it, just click the construction tab at the top (anyone who's played RCT will recognise my placeholder graphics lol), select the hut, and then basically just keep building huts on the map.
Sometimes it crashes straight away, other times it crashes on the fiftieth attempt at building the hut. It seems random to me so I'm sorry if I can't give any better instructions :-\... basically just keep building them and it'll crash eventually within a couple of minutes.

SSH

Could you try replacing the line with this:

Code: ags

String temp=String.Format("$%d", Clicker1);
cTeller.SayBackground(String.Format("DBG: %d %s", temp.Chars[1], temp));}


and then tell us what it says when the money goes negative?
12

Valentine

Ah thankyou! It seems to be working now - at least, it's not crashing. It's reading "DBG: 49 100".
What was I doing wrong here? temp.Chars[1] should give the first character of the string if I understand this correctly... how comes its coming up as 49?

SMF spam blocked by CleanTalk