Changing Language.. (SOLVED)

Started by Mosk, Mon 11/12/2006 20:36:16

Previous topic - Next topic

Mosk

okay, this is what I want to know...
I created a game in spanish, and made the english translations, BUT I want to know if there's a code or something like that to solve my problem; for example, spanish is the game's default language, so all the game is in spanish. but if the player wants to play it in english, he'll get the dialogs and speech translations, but not the whole game. so here's what I want to know; how can I change for example, the sprites that appear in the intro room of the game (abrir-->restore as a sprite) when the player changes in the setup the language to english.
I don't know if I was clear enough; if nobody understand my issue, I'll try to explain it again in a better way. :)

here's a crappy draft I made to explain what I want to know :P

Remember to visit http://satchplace.co.nr There are a lot of cool things!

Khris

In the room's player enters screen (before fadein):

Code: ags
  if (Game.TranslationFilename=="english") {
    // change buttons/sprites here
  }


I'm not sure if this fully answers your question or if you need to know how to change the sprites, too?

Mosk

Quote from: KhrisMUC on Mon 11/12/2006 20:46:43
In the room's player enters screen (before fadein):

Code: ags
Ã,  if (Game.TranslationFilename=="english") {
Ã,  Ã,  // change buttons/sprites here
Ã,  }


Hey dude! thanks a lot! I'll do this, I think this is going to work! ;D

Quote
I'm not sure if this fully answers your question or if you need to know how to change the sprites, too?

I'm gonna post again if I still have some problems :P
Thank you very much!


Remember to visit http://satchplace.co.nr There are a lot of cool things!

monkey0506

Just a thought but if you number all your graphics so that each language has an offset from the default, i.e.:

    0 Spanish
    1 English
    2 French
    3 Italian
    4 German

So that, for example, if your default sprite for a button is sprite 38, the English sprite would be sprite 39, French would be sprite 40, Italian sprite 41, and German sprite 42.

Then you could just set all your graphics to their default (Spanish) graphics, and depending on the translation being used offset the graphics by that much.

Might help to simplify some things. :)

SilverWizard_OTF

Keep in mind that you can also create an "english" background. So, if player selects spanish, then in the other room (before fade in) you can have the script commands:
  if(player_option==0) {
    SetBackground(1);
  else
    SetBackground(2);
    }

(I am not sure it is SetAckground, check it in AGS' help).

Or you can have different objects (some with english words and some with spanish, but if player selects e.g. spanish, then the english one will be turned off --- object
  • .visible=false;)
"All we have to decide is what to do, with the time that is given to us"

Mosk

Hey thanks a lot mates!  :)
I'll have in mind all your suggestions!
so, let's start working ;)
Remember to visit http://satchplace.co.nr There are a lot of cool things!

SMF spam blocked by CleanTalk