|
| 1 | +--- |
| 2 | +title: Basic Messages |
| 3 | +description: Showing different types of messages |
| 4 | +slug: basic-messages |
| 5 | +tableOfContents: true |
| 6 | +--- |
| 7 | + |
| 8 | +## Help Boxes |
| 9 | + |
| 10 | +In the base game, text commands require a GXT key - an 8-character string referencing one of the predefined text entries in the active GXT file (for example, `american.gxt` when the game language is set to English). |
| 11 | + |
| 12 | +For example, to display a help box with the text 'San Andreas', you need to use the command `PRINT_HELP` with the key `'SAN_AND'`: |
| 13 | + |
| 14 | +```sb |
| 15 | +PRINT_HELP {key} 'SAN_AND' |
| 16 | +``` |
| 17 | + |
| 18 | +<img src="/img/ch-04-01.png" alt="Help box example" /> |
| 19 | + |
| 20 | +:::tip |
| 21 | +How one could find what key refers to what text? There is an online tool |
| 22 | +that lets you navigate all standard game messages and their keys: |
| 23 | +https://public.sannybuilder.com/GXT/search/?game=SA%20PC. It supports all |
| 24 | +available languages and can work with user-provided GXT files. |
| 25 | +::: |
| 26 | + |
| 27 | +Sometimes you need custom text that doesn’t exist in the original GXT files. There are two easy ways to do this: |
| 28 | + |
| 29 | +1. CLEO supports custom text dictionary format called `FXT`, which allows you to define new keys and messages without having to edit GXT files. FXT files are loaded automatically from the `CLEO_TEXT` folder. |
| 30 | + |
| 31 | +Each FXT file contains a list of plain text entries in the following format: |
| 32 | + |
| 33 | +``` |
| 34 | +<KEY> <TEXT> |
| 35 | +``` |
| 36 | + |
| 37 | +2. Use CLEO commands that accept strings directly, without using a GXT key. For example, to display the same help box use: |
| 38 | + |
| 39 | +```sb |
| 40 | +PRINT_HELP_STRING {text} "San Andreas" |
| 41 | +``` |
| 42 | + |
| 43 | +Notice that because the text is longer than 8 characters, you need to use double quotes. |
| 44 | + |
| 45 | +## Mission Text |
| 46 | + |
| 47 | +Here is some other message commands and their CLEO counterpart: |
| 48 | + |
| 49 | +**PRINT_NOW** |
| 50 | + |
| 51 | +| Native Command | CLEO Command | |
| 52 | +| ----------------------------------------------------- | ------------------------------------------------------- | |
| 53 | +| `PRINT_NOW {key} 'SAN_AND' {duration} 3000 {style} 1` | `PRINT_STRING_NOW {text} "San Andreas" {duration} 3000` | |
| 54 | + |
| 55 | +<img src="/img/ch-04-02.png" alt="PRINT_NOW Example" /> |
| 56 | + |
| 57 | +**PRINT_BIG** |
| 58 | + |
| 59 | +| Native Command | CLEO Command | |
| 60 | +| ----------------------------------------------------- | ----------------------------------------------------------------- | |
| 61 | +| `PRINT_BIG {key} 'SAN_AND' {duration} 3000 {style} 1` | `PRINT_BIG_STRING {text} "San Andreas" {duration} 3000 {style} 1` | |
| 62 | + |
| 63 | +<img src="/img/ch-04-03.png" alt="PRINT_BIG Example" /> |
| 64 | + |
| 65 | +To find more information about each command and different styles, visit [the Text class](https://library.sannybuilder.com/#/sa/script/classes/Text) in Sanny Builder Library. |
0 commit comments