-
Notifications
You must be signed in to change notification settings - Fork 0
Tumbleweed_translation
To make the verbs work with translations, strings are being used to define the button graphics, hotkeys and so on. If you like to customize your game or get it translated, you need to take a closer look at the function AdjustLanguage.
void Verbs.TranslateAction(int action, int tr_lang);
This function defines the text for the verb buttons, e.g. if you click on the talk verb button, "Talk to" is being displayed in the action/status bar. The second parameter defines the returned language. If you want to customize this text, you have to edit this function.
void Verbs.AdjustLanguage();
This function has to be called from inside the template's game_start() function. It sets up everything related to the verb buttons, so you need to take a look at this, if you want to customize your GUI. It is also import to understand, how this function works, if you want to get you game translated. If you take a closer look at this function, you will notice the following lines:
Verbs.SetActionButtons(eGA_Open, 0, 59, 60, 'q');
Verbs.SetActionButtons(eGA_Close, 1, 61, 62, 'a');
Verbs.SetActionButtons(eGA_GiveTo, 2, 63, 64, 'z');
and so on.
Your verb buttons are initialized here, by calling the function SetActionButtons. The parameters define the following:
- Defined Action/Verb
- GUI-button ID
- Spriteslot normal
- Sprite slot highlighted
- Keyboard-Shortcut.
This line
Verbs.SetActionButtons(eGA_GiveTo, 2, 63, 64, 'z');
tells the AGS:
- We want to define a button for the verb "Give"
- The buttons has the GUI-ID 2. If you take a look at the GUI "gMaingui", you can see several buttons. The one with the ID 2 will be used for the action you define here.
- The button will use the sprite-slot 63 as the default graphic and sprite-slot 64,
if it's highlighted.
This can be a little bit confusing, since if you look at
gMaingui
, those graphics have already been assigned. But you also need to define the graphics slots in this function, because eventually these are the ones being used. - The last parameter defines the hotkey for this action.
You might wonder, why this function overrides the values of gMaingui. But in some other languages the translation for use could be a very long word, so you might want to swap it with something else. E.g. in German "use" means "Benutze", so you need more space for the verb. But "pick up" can be translated to "nimm", so you save some space here.
Unlike the 9Verb MI-Style template, the fonts can be customized and overwritten in AdjustGUIText().
See also: Verbs.SetActionButtons
void Verbs.AdjustGUIText();
This function will also be called inside the template's game_start() function. Here you can modify the labels of your GUI buttons for the options GUI. In case you need it, you can also define alternative fonts for different languages.
See also: Verbs.AdjustLanguage
Getting Started in AGS
Editor Reference
- Music and sound
- Distributing your game
- Backing up your game
- The text parser
- Translations
- Global variables
- Custom Properties
- Plugins
- Lip sync
- New Game templates
- Debugging features
- Auto-number speech files
- Integration with Windows
- Source Control integration
Engine
Scripting
- Scripting tutorial part 1
- Scripting tutorial part 2
- Pointers in AGS
- Calling global functions from local scripts
- The script header
- String formatting
- Multiple Scripts
- Understanding blocking scripts
- Dynamic Arrays
- Extender functions
- Game variables
- Predefined global script functions
- repeatedly_execute (_always)
- Custom dialog options rendering
- Built-in enumerated types
- Script language keywords
- AudioChannel functions and properties
- AudioClip functions and properties
- Character functions and properties
- DateTime functions and properties
- Dialog functions and properties
- DialogOptionsRenderingInfo functions and properties
- DrawingSurface functions and properties
- DynamicSprite functions and properties
- File functions and properties
- Game / Global functions
- GUI functions and properties
- GUI control functions and properties
- GUI Button functions and properties
- GUI InvWindow functions and properties
- GUI Label functions and properties
- GUI List Box functions and properties
- GUI Slider properties
- GUI Text Box functions and properties
- Hotspot functions and properties
- Inventory item functions and properties
- Maths functions and properties
- Mouse functions and properties
- Multimedia functions
- Object functions and properties
- Overlay functions and properties
- Palette functions
- Parser functions
- Region functions and properties
- Room functions
- Screen functions
- Speech functions and properties
- String functions
- System functions and properties
- Text display / Speech functions
- ViewFrame functions and properties
Working on Legacy games
Upgrading from a previous version
- Upgrading to AGS 2.7
- Upgrading to AGS 2.71
- Upgrading to AGS 3.0
- Upgrading to AGS 3.1
- Upgrading to AGS 3.2
- Upgrading to AGS 3.3
- Upgrading to AGS 3.3.5
- Upgrading to AGS 3.4
- Upgrading to AGS 3.4.1
Legal Notice
Getting in touch