How to Display A Chinese Word With The cEgo.say("你好")?

Started by jixleimo, Tue 06/05/2008 10:43:21

Previous topic - Next topic

jixleimo

I Meet A Questing
First,i install a chinese font to AGS
then When I Input A Chinese Word "你好"(That Means "Hello") In AGS's Script Editor,then click the right mouse,The AGS show:
-------------------------------------------------------------------------------------------------------------------
Error: Index and length must refer to a location within the string.
Parameter name: length
System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
   at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   at AGS.Editor.ScintillaWrapper.InsideStringOrComment(Boolean charJustAdded, Int32 position)
   at AGS.Editor.ScriptEditor.scintilla_ConstructContextMenu(ContextMenuStrip menuStrip, Int32 clickedPositionInDocument)
   at AGS.Editor.ScintillaWrapper.ScintillaWrapper_MouseUp(Object sender, MouseEventArgs e)
   at System.Windows.Forms.Control.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at Scintilla.ScintillaControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
-------------------------------------------------------------------------------------------------------------------
and still i can run the game,and Ego say the word:"  !'
and when i use translation.trs to display it ,it respond a lots of mess Symbol too

it must be the problem that the AGS's Script Editor can't encode the chinese word into it's system.string function and process it correctly...

How Can I Fix This Question? or are there any way to display a chinese word?

thanks to all.^_^

Khris

Afaik, AGS can't handle unicode symbols yet.
It can handle the first 256 characters of a TrueType font though.

So either find a font with those characters among the first 256 or create one yourself.
Alternatively, use a graphical overlay to display a picture of the symbols.

Gilbert

Right. AGS currently can't display symbols outside of the basic 0-255 range of a true type font.

So, as you are limited to 256 different charecters max. the font method is not very useful for most games (unless it's very simple with very limited text).

The graphical overlay method is more applicable here (this game is an example of using overlays to display Japanese text) but then you will need to create a sprite for each line of text.

Multiple byte font support would be great, but unfortunately it's not of high demand (not even me really want it) so I think it probably won't be implemented some time very soon.

Dualnames

You can import a chinese font and just use a function like
function CSay(string text) {
game.NormalFont=chinesefont;
cEgo.Say(text);
game.NormalFont=normalfont;
}
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)

Gilbert

Nope. As mentioned above, that won't work since AGS should need to support multibyte characters for ordinary CJK fonts.

Radiant

What you can do, is modify the font to draw characters for the Chinese text you want displayed. This is assuming you want only a couple of characters, not more than about 150 of them.

There's a font editing tool on my webpage (look in the Attic, under AGS resources).

jixleimo

Oh,i know,so it is...
AGS can't handle unicode symbols yet
it's means,use The graphical overlay method is more applicable,yes i downloaded the game ,thanks Gilbot V7000a!

en,i use the method,it's the code i write:
///////////////////////////////
Game.NormalFont=4;
Game.SpeechFont=4;
cEgo.Say("你好");
///////////////////////////////
unfortunately,it don't work ,display a mess,thanks Dualnames!

and i download the tool ,thank you ,Radiant!

actually,I plan to creat a game system use the AGS,this is my plan:
I plan to use the dialog class's Attribute--"Appearance",set it to true,Then i can recieve Chinese Characters from user,then get it into a Text Parser,then Analysis what it means,then the cEgo can do what he can do,like :play,laugh,sleep,etc
it can be a Interactive game that use user's input to control charactors in the game ,not only chick and point,but to use the keyboard
it like a text adventure game,but it has a colorful Screen and chars which offer by AGS
i think it will be more fun and more Interactive
far the more,it will be develop into a adventure net game that can be play by two or three friends,like a puzzle room display in front of you and your friends,you and your friends can play a role in the game,can input the words to comunicate with each others,using TCP/IP Module(the words is display by AGS Engine),so ,it like a role adventure game,and the words are changeable,and it can be record to a movie share with others

every action input in text,like a graph text adventure game,i think it will be fun! ^_^

jixleimo

i think the real fun point of a game ,it can be divide into two parts:
first,is a story telling process(a fun,real,have motion story) which can tell a story to the people
second,it a muti Interactive process,it can provide a Platform allow people to comunicate to each other or the NPC World

first is usually develop into a Adventure Game
second is usually develop into a WOW Game ^_^(Of course the WOW has it's big Background story)

so i want to creat a muti player Adventure Game,^_^,hehe,or just a Interactive Cartoon

long way to go...i think

Gilbert

What you want to do can't be done at the moment (at least not in an easy way, unless someone makes a plugin).

As mentioned, you can't display characters other than the 256 ASCII coded ones in a font and the overlay method is not practical either as you'll need a lot of sprites (I have some ideas in mind but I don't think it's worth the nuisance to try it).

Moreover, CJK input modules don't work well with AGS games, so it would be hard to make your game.

jixleimo

yes ,i know it's hard
as you mentioned :(I have some ideas in mind but I don't think it's worth the nuisance to try it)
please tell me your idea,i try it,thank you ,:)

SMF spam blocked by CleanTalk