IDE Setup ======================= To get started with programming in RoboCo all you you really need is a basic text editor and a little bit of Python knowledge. But we can make our lives a little easier by using a nice IDE like VS Code. VS Code is a very powerful and versitile editor. This guide will help you install VS Code, install the official Python extension, and configure it to acknowledge the RoboCo API. If you've already done either of the first two steps, you can feel free to skip to the configuration step. Download and Install VS Code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Go to https://code.visualstudio.com/download and follow the instructions there to download and install VS Code. For more detailed instructions on getting started with VS Code, check out their page here: https://code.visualstudio.com/docs. Get the Python extension ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In order to get Python specific features like auto-complete, smart renaming, and type hints you will need to get the official Python extension. You can find it in VS Code in the extensions tab as "Python" or by going to this link_ and clicking install. .. _link: https://marketplace.visualstudio.com/items?itemName=ms-python.python Configure the Python extension ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If you haven't downloaded and run the RoboCo game yet, now would be a good time to do so. We'll need to reference the Python interpreter that gets installed during the first time you play the game. Also before configuring the extension, you will want to open your scripts folder in VS Code so that we can configure settings separately for your RoboCo scripting. To do that, enter VS Code and select in the top left corner "File -> Open Folder" and navigate to ``%userprofile%\\Documents\\My Games\\Roboco\\Scripts``. If you haven't started scripting in RoboCo, you'll need to make this directory yourself. Once you've done that, you'll want to edit the file ``.vscode\\settings.json``. To do so, press ``ctrl-shift-P`` to open the "command palette", then type and select ``Preferences: open workspace settings (JSON)``. Our next goal is to add the RoboCo library to the extra paths of both auto-complete and analysis. The library is located inside of your copy of RoboCo followed by ``RoboCo_Data\\StreamingAssets\\Robocode\\python\\Lib``. Inside ``.vscode\\settings.json``, you can add the following entries replacing ``*installation*`` with the path to your RoboCo installation. .. code-block:: json "python.autoComplete.extraPaths": [ "*installation*\\RoboCo_Data\\StreamingAssets\\Robocode\\python\\Lib" ], "python.analysis.extraPaths": [ "*installation*\\RoboCo_Data\\StreamingAssets\\Robocode\\python\\Lib" ], The last setting that you ought to configure is the default interpreter path. By setting this to the embedded interpreter that comes with RoboCo, you will ensure that VS Code uses the same interpreter as the game even if you have other interpreters on your machine. You can find this interpreter in ``%userprofile%\\AppData\\LocalLow\\Filament Games\\RoboCo\\python\\interpreter-ModifyWithCare\\python-3.9.6-embed-amd64`` If that directory doesn't exist, remember that you need to run the game once to create it. Then you can add the following entry to the settings file replacing ``%userprofile%`` with your userprofile. To find that, you can just type ``%userprofile%`` into the start menu. .. code-block:: json "python.defaultInterpreterPath": "%userprofile%\\AppData\\LocalLow\\Filament Games\\RoboCo\\python\\interpreter-ModifyWithCare\\python-3.9.6-embed-amd64", Once you save the changes to your settings, you should be ready to start coding! When you're ready to code in RoboCo, make sure to open the scripting folder with VS Code. Then you can create and edit scripts from there and load them onto your microcontrollers in game.