Author Topic: Formatting text for SatCom messages  (Read 347 times)

Offline Bhudh

  • Дважды герой
  • **
  • Posts: 7815
  • Карма: +2538/-491
    • View Profile
Formatting text for SatCom messages
« on: 15 June 2025, 22:03:43 »
  • 0
  • 0
Formatting text for SatCom messages

The files containing official Colobot Help texts and instructions shown in the SatCom are located in the help\ folder. These texts contain special formatting commands which begin with a back slash "\" and end by a semicolon ";". A paragraph is delimited by an end of line "¶".
Here is an example of a source text:

Quote from:
\b;Objective¶
Program the \l;grabber bot\u object\botgr; to change the \l;power cell\u object\power; of the \l;winged shooter\u object\botfj;. The winged shooter can then shoot the spiders.¶

\t;Procedure¶
1) Program the \l;grabber bot\u object\botgr;. ¶
2) Execute the program with the arrow button \button 21;. ¶
The \l;winged shooter\u object\botfj; is already programmed, it will do its job as soon as it has got a new power cell.¶

\t;Program¶
You will need the following instructions:¶
\c;¶
\s;grab();\n;¶
\n;Takes whatever there is in front of the bot.¶
\c;¶

\b;
Big title with brown background. This command must be at the beginning of the line and ends automatically at the end of the line.

\t;
Subtitle with brown background. This command must be at the beginning of the line and ends automatically at the end of the line.

\s;
Subtitle with yellow background. This command must be at  the beginning of the line and ends automatically at the end of the line. It is mostly used for displaying CBOT programs.

\tab;
Table with orange background, used for satellite reports. This command must be at the beginning of the line and it ends automatically at the end of the line.

\l;hypertext\u file;
Hypertext link. The word surrounded by \l; and \u; is the link name that is displayed. The \u; command indicates the file to which the link points. For example, \u object\botgr; points to the standard file help\object\botgr.txt. Another example: \u %user%\mlink; points to the user level specific file user\sample01\mlink.txt.

\c;
Use the Courier fixed pitch font, used for CBOT programs.

\n;
Use the normal Colobot font.

\image %user%\filename dx dy;
Show a .bmp image contained in the user mission specific folder. If the %user%\ is omitted, image will be fetched from the general folder diagram\.
Example: \image %user%\sample01 8 8; displays user\sample01\sample01.bmp.
Example: \image sniff1 12 12; displays diagram\sniff1.bmp.
dx is width in characters, and dy is height in characters. The image is stretched to fit into the specified size. The values 12 12 used here result in a square image.

\token;
Use an orange background. Used generally for instructions of the CBOT language. The command \norm; returns to standard background.

\type;
Use a green background. Used generally for variable types of the CBOT language (for example int, float, point, etc.). The command \norm; returns to the standard background.

\const;
Use a red background. Used generally for CBOT language constants. The command \norm; returns to the standard background.

\key;
Use a grey background. Used generally for key names as F1, F2. The command \norm; returns to the standard background.

\norm;
Return to the standard background after following commands: \token;, \type;, \const;, \key;.

\key name;
Display a key name. For example \key help; shows the name of the key which activates the SatCom, generally F1. But if the user has modified the key mapping  in the Colobot options, the new name will be shown. Never to write F1 directly but rather use \key help; instead.
As keys are generally shown with a gray background, you should use the combination of following commands to indicate a key name :
\key;\key help;\norm;
Jestem dokładny i dociekliwy. (Wg Pinii.)
Всё, что нужно для торжества зла — это бездействие добрых людей. Поэтому бездействовать не надо. Алексей Навальный
Ceterum censeo gebniam esse delendam.
…Когда ты чем-то не интересуешься, то после шокового события ты готов принять любую удобную интерпретацию, которую тебе предложат. Григорий Юдин

Offline Bhudh

  • Дважды герой
  • **
  • Posts: 7815
  • Карма: +2538/-491
    • View Profile
Re: Formatting text for SatCom messages
« Reply #1 on: 15 June 2025, 22:07:39 »
  • 0
  • 0
Интересно, часто ли разработчики игр заморачиваются над созданием собственного языка разметки для внутреннего хелпа игры?
Причём языка не единственного, в этой игре есть ещё отдельный язык разметки уровней игры, которые описываются обычными текстовыми файлами, и язык (диалект C++, если быть точным) для программирования роботов в процессе игры.
Или для начала 2000-х это было нормально?
Jestem dokładny i dociekliwy. (Wg Pinii.)
Всё, что нужно для торжества зла — это бездействие добрых людей. Поэтому бездействовать не надо. Алексей Навальный
Ceterum censeo gebniam esse delendam.
…Когда ты чем-то не интересуешься, то после шокового события ты готов принять любую удобную интерпретацию, которую тебе предложат. Григорий Юдин