Различия
Здесь показаны различия между двумя версиями данной страницы.
| Следующая версия | Предыдущая версия | ||
|
authors_main:task_editor:ai_authoring [2026/06/15 21:27] 127.0.0.1 внешнее изменение |
authors_main:task_editor:ai_authoring [2026/08/16 20:24] (текущий) |
||
|---|---|---|---|
| Строка 74: | Строка 74: | ||
| %} | %} | ||
| ``` | ``` | ||
| + | Special branch values, used instead of a concrete answer: | ||
| + | - `!no_answer!`: nothing has been submitted yet (for `task_N` the empty state is `!no_status!` instead). | ||
| + | - `!any_answer!`: any answer has been submitted. Unlike `?`, it does **not** match `!no_answer!`. Use it when a code has synonyms and only the fact that it is solved matters. | ||
| + | - `?`: any value at all, **including** `!no_answer!`. Must be the last branch — everything after it is never checked. | ||
| + | |||
| + | Composite codes (a final code that is auto-submitted once several codes/bonuses are solved) are built by nesting one template per part and calling `enter()` in the innermost one: | ||
| + | ``` | ||
| + | {% match code_1 }:{ {%= !any_answer!}:{ | ||
| + | {% match gbonus_5 }:{ {%= !any_answer!}:{ | ||
| + | <script>enter('FINAL_CODE')</script> | ||
| + | %} %} | ||
| + | %} %} | ||
| + | ``` | ||
| + | Every level opens two markers, so the tail needs two `%}` per part. `FINAL_CODE` must exist on the level as a real code or bonus, otherwise the page reloads in a loop submitting a non-existent answer. | ||
| + | |||
| Supported match parameters: | Supported match parameters: | ||
| - **Global info**: | - **Global info**: | ||
| Строка 105: | Строка 120: | ||
| ``` | ``` | ||
| - Purchase buttons: `%pay_button PRODUCT_KEY%` | - Purchase buttons: `%pay_button PRODUCT_KEY%` | ||
| + | - Templates inside JavaScript (the "script" field or a `<script>` block): put every template service line on its own line and prefix it with `//`, so the result stays valid JavaScript. The engine strips a `//` only when the next non-space characters on that line are `{%` or `%}`; the code between the markers stays live. A `//` followed by anything else remains an ordinary comment. | ||
| + | ``` | ||
| + | show_money(); | ||
| + | // {% match gbonus_1}:{ | ||
| + | // {%= some_code}:{ | ||
| + | enterSilent('the whole game is done'); | ||
| + | // %} | ||
| + | // {%= ?}:{ | ||
| + | play_sound('limit'); | ||
| + | // %} | ||
| + | // %} | ||
| + | ``` | ||
| + | Inside the JSON "script" string every one of those lines must be separated by a real `\n` — otherwise the leading `//` comments out the rest of the script. | ||
| + | Closing markers may share a line (`// %} %}`), and a short template may be written on a single line: | ||
| + | `// {% match team}:{ {%= 172}:{ var boss = true; %} {%= ?}:{ var boss = false; %} %}` | ||
| ### Custom JavaScript Functions & HTML Layout Elements: | ### Custom JavaScript Functions & HTML Layout Elements: | ||
| Строка 141: | Строка 171: | ||
| Как только чат-бот сгенерирует вам JSON-структуру игры: | Как только чат-бот сгенерирует вам JSON-структуру игры: | ||
| - | 1. Скопируйте полученный JSON в буфер обмена. | + | - Скопируйте полученный JSON в буфер обмена. |
| - | 2. Перейдите на страницу импорта (подробнее см. в разделе [[authors_main:admin_api:admin_api_import_game|Импорт из JSON]]). | + | - Перейдите на страницу импорта (подробнее см. в разделе [[authors_main:admin_api:admin_api_import_game|Импорт из JSON]]). |
| - | 3. Вставьте JSON в текстовое поле и примените изменения. Уровни мгновенно появятся в сценарии вашей игры. | + | - Вставьте JSON в текстовое поле и примените изменения. Уровни мгновенно появятся в сценарии вашей игры. |
| + | |||
| + | <note tip>Перевод готовой игры на другой язык — отдельная задача с отдельным промптом и отдельным форматом файла: [[authors_main:game_management:localization_ai|Перевод игры с помощью AI]]. Промпт отсюда для этого не годится — он генерирует задания, а не переводит их.</note> | ||