Help tracking down "Cannot display message with extended characters" error

Started by Ashera, Fri 22/07/2005 22:07:59

Previous topic - Next topic

Ashera

There's an error that's been plaguing my game for a while, but I can't get it to happen consistently and I haven't been able to track it down.

The error says "Error: cannot display message with extended characters in SCI font." I'm not using extended characters that I know of. Another thread about the error said that the problem can be caused by using chars as ints, and by trying to display empty strings. I've gone through my game and rooted out the places with empty strings, so I don't know what's causing it.

The problem most often seems to involve the top menu bar, but I'm sure that section of code doesn't have any empty strings.

What should I be looking for? What sections of script should I post that would help?

-Ashera

monkey0506

Perhaps you could post the keycodes of the chars you do try to display.  That could help to eliminate the chance that maybe you typed the wrong keycode or something at some point.  Other than that I haven't ever had problems with this type of thing, so I don't know what else the problem might be.

strazer

Quote from: Ashera on Fri 22/07/2005 22:07:59I'm not using extended characters that I know of.

No Ã,,, Ö, Ü or ' or ` (instead of ' )?

Ashera

I'm not using any special characters. Everything has been typed in using a text editor.

However, I *think* I've found the problem. I'm not sure because it's so hard to get it to show up.
Code: ags

	// Top menu bar tooltips
	if (gMenubar.Visible)
	{
		GUIControl* myButton = GUIControl.GetAtScreenXY(x, y);

		string labelText;

		if (myButton == gMenuExit)
		{
			StrCopy(labelText, "Exit game");
		}
		else if (myButton == gMenuHelp)
		{
			StrCopy(labelText, "Help");
		}
		else if (myButton == gMenuInv)
		{
			StrCopy(labelText, "Inventory");
		}
		else if (myButton == gMenuLoad)
		{
			StrCopy(labelText, "Load game");
		}
		else if (myButton == gMenuNew)
		{
			StrCopy(labelText, "Restart game");
		}
		else if (myButton == gMenuOptions)
		{
			StrCopy(labelText, "Options");
		}
		else if (myButton == gMenuPda)
		{
			StrCopy(labelText, "PDA");
		}
		else if (myButton == gMenuSave)
		{
			StrCopy(labelText, "Save game");
		}

		gStatusLineLabel.SetText(labelText);
	}


There's a missing "else" clause at the end which means that if the mouse is not over a button, it's not clear what it'll set gStatusLineLabel to.

If that's not it, then I have no idea.

Gilbert

It's possible, since variables local to functions are not automatically initialized to 0, "", etc. (if the varaibles are declared outside of functions they're initialized), so if you don't initialize labelText, it may contain some rubbish. So, try adding else StrCopy(labelText, ""); and test again.


Also. Will it be possible that in the initial label text you set for it in the editor has some accented characters?

Gregjazz

It could be the apostrophe thing. I know when I copy dialogue lines from Word to AGS it uses these funny slanted apostrophes rather than the straight vertical apostrophes that AGS likes.

SMF spam blocked by CleanTalk