Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: rockeh on Tue 22/08/2006 19:58:37

Title: Yet another font question (different speech fonts for different characters)
Post by: rockeh on Tue 22/08/2006 19:58:37
Hi everyone :)

I have a quick question regarding fonts, or, more to the point, the usage of 2 different fonts. Now, I did look through both the manual and this subforum, but I didn't find a solution to my liking.

So, what I want to do is this: I have the character and an NPC, talking to eachother. However, for the NPC I want to use a different font, to suggest it uses a different language. The font used for this would be a separate one, with none of the letters actually looking like letters :)

Now, I've found 2 solutions so far: either replace unneeded characters in the font with the NPC's characters, or replace the upper- or  lowercase letters in the font.

However, I'd rather not do that.

So, is this possible? If so, how?

Thanks :)
Title: Re: Yet another font question (different speech fonts for different characters)
Post by: Ashen on Wed 23/08/2006 10:36:13
Import a second font, and use SetSpeechFont (http://www.adventuregamestudio.co.uk/manual/SetSpeechFont.htm) to switch between them for the different characters. You might be interested in Alynn's CharacterFonts Module (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=27485.0), which does most of the coding for you. (Although, if it's only for one NPC, it's easy enough to do yourself - Alynn's code may still help.)

If you've already seen this, and it's 'not to your liking' - Sorry, AFAIK it's this, or the way you suggested. If you explained why you don't like it, maybe it could be worked around.
Title: Re: Yet another font question (different speech fonts for different characters)
Post by: Alynn on Wed 23/08/2006 10:40:17
Bah beat me to plugging my own module :P
Title: Re: Yet another font question (different speech fonts for different characters)
Post by: rockeh on Wed 23/08/2006 10:56:22
Thanks for the replies, guys :)

I'll have a look at the module -- it seems like the best solution.

As to why I didn't like the replacing font characters idea, it's because of 2 things:
1. I want to use all the available characters
2. I don't want to write gibberish for the NPC, because my idea involves translatng what the NPC says; that is, EGO is supposed to find a translator; is he has it, the NPC will speak using the regular font; if not, the NPC will say the same things, but using the alternate font.
Title: Re: Yet another font question (different speech fonts for different characters)
Post by: Alynn on Wed 23/08/2006 11:42:26
Very easy to do with the charfont module

Say font 2 is  your untranslated font, and font 3 is your translated font. cForigner is your character to be translated

if (player.InventoryQuantity(iTranslator.ID) == 1) {
  CharFont.SetCharFont(cForigner, 3);
}
else {
  CharFont.SetCharFont(cForigner, 2);
}
Title: Re: Yet another font question (different speech fonts for different characters)
Post by: rockeh on Wed 23/08/2006 13:43:47
^ You da man :D