This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorials:guide_to_the_orx_console [2017/11/08 18:41 (6 years ago)] – sausage | en:tutorials:config:guide_to_the_orx_console [2023/07/12 19:02 (9 months ago)] (current) – [Getting Help on a Command] iarwain | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | <WRAP center round box 60%> | ||
- | This guide is in progress | ||
- | </ | ||
- | |||
- | |||
===== Guide to the Orx Console and Commands ===== | ===== Guide to the Orx Console and Commands ===== | ||
Beginners and seasoned Orx developers may not have tapped into the power that the Orx Console gives you. Or may not even have realised it exists. This tool can give you access to your game objects and config values during live execution in realtime. | Beginners and seasoned Orx developers may not have tapped into the power that the Orx Console gives you. Or may not even have realised it exists. This tool can give you access to your game objects and config values during live execution in realtime. | ||
- | It will let you alter any of these elements and values. You can experiment with commands which can be used in your own Tracks within your game. | + | It will let you alter any of these elements and values. You can experiment with commands which can then be used in Tracks within your game. |
All Orx applications and games have an Orx Console compiled directly in. | All Orx applications and games have an Orx Console compiled directly in. | ||
- | This guide will take you on a tour of some of the power of the Console to help you get comfortable | + | This guide will take you on a tour of some of the power of the Console to help you get comfortable |
The Orx Console will save you many hours of fiddly experimentation. | The Orx Console will save you many hours of fiddly experimentation. | ||
- | {{ :tutorials: | + | {{ tutorials:command: |
==== Starting with a Common Project ==== | ==== Starting with a Common Project ==== | ||
- | It will be helpful to use a common project that is available to everyone so that you can work with commands and configuration | + | It will be helpful to use a common project that is available to everyone so that you can work with commands and configuration |
- | + | If you are using the [[https:// | |
- | If you are using the git repo version of orx, you can use the Bounce Demo. Start it by executing: '' | + | |
The Bounce Demo is not available in the downloadable release versions of Orx. Otherwise just use a project of your own. | The Bounce Demo is not available in the downloadable release versions of Orx. Otherwise just use a project of your own. | ||
- | {{ :tutorials: | + | {{ tutorials:command: |
==== Starting the Orx Console ==== | ==== Starting the Orx Console ==== | ||
- | When running | + | When running |
'' | '' | ||
- | The backquote key is below the '' | + | The backquote key is below the '' |
- | {{ :tutorials: | + | {{ tutorials:command: |
==== Finding Commands and Navigating ==== | ==== Finding Commands and Navigating ==== | ||
Line 47: | Line 41: | ||
'' | '' | ||
- | All commands will be printed to the screen. The list can be scrolled with the mouse wheel or the '' | + | All commands will be printed to the screen. The list can be scrolled with the mouse wheel or the '' |
- | Partial commands can be typed using the '' | + | Partial commands can be typed and then use the '' |
'' | '' | ||
Line 61: | Line 55: | ||
'' | '' | ||
- | You could type: '' | + | You could type: '' |
Both '' | Both '' | ||
Line 73: | Line 67: | ||
Different executables (debug/ | Different executables (debug/ | ||
- | Command histories are saved in the same folder as your executable, with a '' | + | Command histories are saved in the same folder as your executable, with a '' |
The '' | The '' | ||
Line 87: | Line 81: | ||
The info in between the '' | The info in between the '' | ||
+ | Commands utilize the following types: | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | ==== Copy/Paste Commands ==== | ||
+ | |||
+ | Rather than typing all your commands, you have the choice to copy commands from this tutorial directly into the console using the clipboard. Select the following command and copy it into your clipboard: | ||
+ | |||
+ | '' | ||
+ | |||
+ | Now paste with Control-V into the command bar of the Orx Console. Your command will be pasted in, and you can press enter to execute it. | ||
==== Basic Commands ==== | ==== Basic Commands ==== | ||
Line 130: | Line 143: | ||
==== More Getting and Setting: turning things on ==== | ==== More Getting and Setting: turning things on ==== | ||
- | Two very handy settings in your game, are turning on physics debugging and showing the FPS. These settings can be changed from the Console | + | Two very handy settings |
If you wanted to check if the ShowFPS property is on or off you can use: | If you wanted to check if the ShowFPS property is on or off you can use: | ||
Line 162: | Line 175: | ||
These are good examples, and you can also do exactly the same thing with all properties in your configuration files. | These are good examples, and you can also do exactly the same thing with all properties in your configuration files. | ||
- | So far you might be thinking that the commands are little long. Soon we will address this by introducing aliases, for commonly used commands. For now we'll stick to common longhand commands. | + | So far you might be thinking that the commands are little long. Soon we will address this by introducing aliases for commonly used commands. For now we'll stick to common longhand commands. |
Line 184: | Line 197: | ||
</ | </ | ||
- | Notice that the objects being spawned are instantly | + | Notice that the objects being spawned are now balls. |
Line 203: | Line 217: | ||
</ | </ | ||
- | You can specify which item in the list via an index value: | + | You can retrieve a specific |
'' | '' | ||
Line 240: | Line 254: | ||
</ | </ | ||
- | When you press tab, it inserts the last object ID in place. | + | When you press tab, it inserts |
Now that there are two Wall1 objects, we can cycle between. | Now that there are two Wall1 objects, we can cycle between. | ||
Line 265: | Line 279: | ||
==== Objects and the stack ==== | ==== Objects and the stack ==== | ||
- | Not only can we get object IDs, and effect | + | Not only can we get object IDs, and affect |
- | Values can also be pushed onto the stack. They can then be popped and used on other commands. | + | Values can be pushed onto the stack as well. They can then be popped and used with other commands. |
''> | ''> | ||
Line 281: | Line 295: | ||
The ''<'' | The ''<'' | ||
- | The result of any command can be popped | + | The result of any command can be pushed |
Line 297: | Line 312: | ||
</ | </ | ||
- | If you are not familiar with the @ syntax, this is a merging of another section. Specifically: | + | If you are not familiar with the @ syntax, this is a merging of another section. Specifically: |
Next, we can set the Texture property: | Next, we can set the Texture property: | ||
Line 321: | Line 336: | ||
You should see a large ball in the middle of the screen. | You should see a large ball in the middle of the screen. | ||
+ | |||
Line 326: | Line 342: | ||
You can also perform math on values in the stack. | You can also perform math on values in the stack. | ||
+ | |||
+ | |||
**Addition on a value in the stack** | **Addition on a value in the stack** | ||
Line 346: | Line 364: | ||
</ | </ | ||
- | The above means: store the result of this calculation | + | The above means: store the result of this calculation |
Line 361: | Line 380: | ||
</ | </ | ||
- | In same way as the addition example: store the result of this calculation on the stack. Use division with the ''/'' | + | In the same way as the addition example: store the result of this calculation on the stack. Use division with the ''/'' |
Line 385: | Line 405: | ||
In the above, the result is to be saved back to the stack. Addition is the mode selected with '' | In the above, the result is to be saved back to the stack. Addition is the mode selected with '' | ||
- | As indicated in the output above, the resulting vector is (-301, -250, 1). | + | As indicated in the output above, the resulting vector |
- | And of course | + | Pressing tab will just give us the vector. Without losing our vector |
+ | |||
+ | ''> | ||
+ | <code ini> | ||
+ | : 0x00000007000000EF | ||
+ | </ | ||
+ | |||
+ | Set the wall's new position: | ||
'' | '' | ||
Line 395: | Line 422: | ||
**NOT Operator** | **NOT Operator** | ||
- | You can also perform operations on values, for example, a not operator. | + | You can perform operations on values, for example, a **not** operator. |
In '' | In '' | ||
Line 409: | Line 436: | ||
</ | </ | ||
- | '' | + | '' |
''> | ''> | ||
Line 441: | Line 468: | ||
''? | ''? | ||
- | We've used Config.GetValue and Config.SetValue throughout this guide quite a lot. It's a little mean to not mention | + | We've used Config.GetValue and Config.SetValue throughout this guide quite a lot. It's a little mean to wait until now to mention |
'' | '' | ||
Line 461: | Line 488: | ||
'' | '' | ||
- | ... in order to turn on and off Physics debugging. | + | ... in order to turn off Physics debugging. |
- | We'd use the '' | + | We'd use the '' |
''? | ''? | ||
Line 478: | Line 505: | ||
This command is only temporary. If you exit your game or application, | This command is only temporary. If you exit your game or application, | ||
- | However, you can store alias in your config to persist them. You can do this by adding a '' | + | However, you can store aliases |
+ | <code ini> | ||
[Console] | [Console] | ||
d = Config.SetValue Physics ShowDebug | d = Config.SetValue Physics ShowDebug | ||
+ | </ | ||
- | The above means, when using the '' | + | The above means: when using the '' |
- | You can even go further and have a tricky little toggle command to the same thing without passing a value. | + | You can even go further and have a tricky little toggle command to do the same thing without passing a value. |
+ | ''> | ||
- | ??? HOW TO DO AS A CONFIG??? | + | However, we can't add this to the '' |
- | 21. Create | + | |
- | > Config.GetValue | + | <code ini> |
- | ????? | + | [ComplexCommandSets] |
+ | TogglePhysicsDebug = % > get Physics ShowDebug, > not <, set Physics ShowDebug < | ||
+ | </ | ||
+ | I'm not covering lazy execution in this guide, as that is another subject. However, do note that the '' | ||
+ | |||
+ | Next, add the getting of the value (and execute it) as the '' | ||
+ | |||
+ | <code ini> | ||
+ | [Console] | ||
+ | d = get " | ||
+ | </ | ||
+ | Restart your application, | ||
+ | '' | ||
Line 515: | Line 556: | ||
==== Disabling the Orx Console or changing the key that activates it ==== | ==== Disabling the Orx Console or changing the key that activates it ==== | ||
- | Sometimes you might want want to choose a different key to toggle the Orx Console. You may not want to use the default backquote '' | + | Sometimes you might want to choose a different key to toggle the Orx Console. You may not want to use the default backquote '' |
You can do this by changing the '' | You can do this by changing the '' | ||
Line 521: | Line 562: | ||
<code ini> | <code ini> | ||
[Console] | [Console] | ||
- | ToggleKey = \ | + | ToggleKey = KEY_SPACE |
</ | </ | ||
Line 534: | Line 575: | ||
==== Dynamic Values versus Static Values ==== | ==== Dynamic Values versus Static Values ==== | ||
- | Some values in the config are static, and some are dynamic. It is not always clear which is which. Some values such as the '' | + | Some values in the config are static, and some are dynamic. It is not always clear which is which. Some values such as the '' |
<code ini> | <code ini> | ||
Line 552: | Line 593: | ||
</ | </ | ||
- | By converting this property into a list, the value with become dynamic: | + | By converting this property into a list, the value will become dynamic: |
<code ini> | <code ini> | ||
Line 564: | Line 605: | ||
Hopefully this guide was helpful and is giving you some great ideas of what is possible. Anything you do here in the Console can be used in tracks giving you the same power in-game. | Hopefully this guide was helpful and is giving you some great ideas of what is possible. Anything you do here in the Console can be used in tracks giving you the same power in-game. | ||
- | Check out some of the track tutorials and examples to see how you can apply this. | + | Check out some of the [[en: |