The game console: Difference between revisions

From Turing Complete
No edit summary
(→‎Available commands: Added MegaIng's summary from Discord used with permission https://discord.com/channels/828292123936948244/1319657832789966982/1320094469478940785)
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Breadcrumbs|Alpha Branch}}
{{Early-access-version|0|1346}}
The game console allows you to modify the game experience in various ways.  It is primarily useful for (and intended for) development and debugging purposes.
The game console allows you to modify the game experience in various ways.  It is primarily useful for (and intended for) development and debugging purposes.


Line 11: Line 13:
** Of particular interest is the "Level component" component under the DEV menu.  This allows you to link [[Custom level creation|custom levels]] to the main map.
** Of particular interest is the "Level component" component under the DEV menu.  This allows you to link [[Custom level creation|custom levels]] to the main map.
* All components are available on all levels:
* All components are available on all levels:
** Indelible (red) components, such as {{Component|Four-bit input||alpha}}.
** Indelible (red) components, such as {{Component|4-bit input (dev)|4-bit input|alpha}}.
** Sandbox-only components, such as {{Component|File loader||alpha}}.
** Sandbox-only components, such as {{Component|File loader||alpha}}.
** Normal components that are unlocked further into the campaign, for example placing a {{Component|Byte adder||alpha}} in the ''Half Adder' level.
** Normal components that are unlocked further into the campaign, for example placing a {{Component|ADD (word)|word adder|alpha}} in the ''Half Adder' level.
* Indelible (red) components can also be deleted from levels.
* Indelible (red) components can also be deleted from levels.
===set_component_string===
<code>set_component_string &lt;text&gt;</code>: Sets the "component string" of the first select component to the value provided. What exactly this means depends on the component.
* Level component: Set to the folder name of the level.
* Registers and Delay lines: Sets the comment/name string.
===complete_level===
<code>complete_level</code>: Completes the current level
===complete_all_levels===
<code>complete_all_levels</code>: Marks all levels as complete with score 10k/10k/10k
===save_update===
<code>save_update</code>: Does some work to update all files in the save folder. I am not sure how up-to-date this command is, I wouldn't use it unless Stuffe tells you to.
===language===
<code>language <name></code>: Use the file translations/<name>.txt as the source of translations - allows you to use debug and WIP languages. No name resets to normal.
===set_permanent_id===
<code>set_permanent_id &lt;id&gt;</code> sets the "permanent_id" of a component. Note that having duplicate permant ids can have very messy side effects.
===load===
<code>load &lt;level_name&gt;</code> load a level by name (the folder name).
===clear===
<code>clear</code>: Slears the console.
===toggle_cache_maps===
<code>toggle_cache_maps</code>: Enables cache map display - useful to figure out the exact hitbox of components and sometimes to debug rare crashes.
===set_score===
<code>set_score &lt;component&gt; &lt;gate&gt; &lt;delay&gt;</code>: Sets the baseline score for the component by their internal ID to the corresponding gate/delay values.
===save_level===
<code>save_level</code>: Saves the schematic as part of the campaign.
===load_level===
<code>load_level</code>: Duplicate of load

Latest revision as of 01:03, 20 January 2025

wip
wip

This page descibes the early access verion 0.1346 Beta. It may not be completely correct for the the current stable version, nor the latest unstable version. Help us update it, and you get a cookie.

The game console allows you to modify the game experience in various ways. It is primarily useful for (and intended for) development and debugging purposes.

Accessing the console[edit | edit source]

To access the console, open the main menu by clicking the "hamburger" icon () in the upper left corner of the game window or by pressing Escape, and then press q.

Some commands operate on a selected component. In these cases you will have to click the "hamburger" icon () as Escape will deselect the selected component and prevent the command from functioning correctly.

Available commands[edit | edit source]

dev_mode[edit | edit source]

dev_mode has two states: dev_mode on or dev_mode off. When enabled, several changes to the game's interface occur:

  • The component selection menu is available on the main map.
    • Of particular interest is the "Level component" component under the DEV menu. This allows you to link custom levels to the main map.
  • All components are available on all levels:
    • Indelible (red) components, such as 4-bit input.
    • Sandbox-only components, such as File loader.
    • Normal components that are unlocked further into the campaign, for example placing a word adder in the Half Adder' level.
  • Indelible (red) components can also be deleted from levels.

set_component_string[edit | edit source]

set_component_string <text>: Sets the "component string" of the first select component to the value provided. What exactly this means depends on the component.

  • Level component: Set to the folder name of the level.
  • Registers and Delay lines: Sets the comment/name string.

complete_level[edit | edit source]

complete_level: Completes the current level

complete_all_levels[edit | edit source]

complete_all_levels: Marks all levels as complete with score 10k/10k/10k

save_update[edit | edit source]

save_update: Does some work to update all files in the save folder. I am not sure how up-to-date this command is, I wouldn't use it unless Stuffe tells you to.

language[edit | edit source]

language <name>: Use the file translations/<name>.txt as the source of translations - allows you to use debug and WIP languages. No name resets to normal.

set_permanent_id[edit | edit source]

set_permanent_id <id> sets the "permanent_id" of a component. Note that having duplicate permant ids can have very messy side effects.

load[edit | edit source]

load <level_name> load a level by name (the folder name).

clear[edit | edit source]

clear: Slears the console.

toggle_cache_maps[edit | edit source]

toggle_cache_maps: Enables cache map display - useful to figure out the exact hitbox of components and sometimes to debug rare crashes.

set_score[edit | edit source]

set_score <component> <gate> <delay>: Sets the baseline score for the component by their internal ID to the corresponding gate/delay values.

save_level[edit | edit source]

save_level: Saves the schematic as part of the campaign.

load_level[edit | edit source]

load_level: Duplicate of load