This short tutorial shows how to use Visual Studio Code to edit motion scripts associated with profiles in ForceSeatPM. Using Visual Studio Code enables code completion (IntelliSense), syntax highlighting and contextual help. It allows also to browse API classes and functions directly from the editor.
- Make sure that ForceSeatPM 2.109 or newer version is installed. Older versions will not work with Visual Studio Code.
- Make sure that Visual Studio Code is installed.
- Start the program, go to File, Preferences, Extensions and install C/C++ extension.
- Wait until the extension and all dependencies are installed and then close the program.
- Go to ForceSeatPM
- Clone the selected profile, e.g. SDK – Vehicle Telemetry:
- disable Shallow copy
- enable Activate new profile
- enable Open editor for new profile
- enable Clone scripts
- In Profile Editor go to Motion Scripts tab and find a script that matches your motion platform.
- Press Run button next to the script to verify that the script works correctly and there are no errors in the the output console.
- At this point there are two scenarios:
- If you are editing the script when the game is running in the background and you plan switch (Alt+Tab) to the game to check your changes (e.g. changed filter parameters), you can close the Profile Editor. ForceSeatPM will detect any changes made to the script and reload it. If there is any syntax error in the script, details will be displayed in Action Center.
- If you are editing the script without the game running in the background or you want to check the script manually and see results in the output console, then don’t close the Profile Editor. You will be clicking Run button later.
- Start Visual Studio Code
- Click File and Open Folder
- Open following directory: C:\Program Files (x86)\MotionSystems\ForceSeatPM\ScriptsDev
This directory contains template project for scripts editing.
- Click File and Open File
- Go to Documents\MotionSystems\ForceSeatPM\Scripts and open the script (e.g. SDK_-_Vehicle_Telemetry_Work-Any.cpp)
- Code completion and content help will work now.
- All headers (with embedded comments/documentation) that define scripts API are located in: C:\Program Files (x86)\MotionSystems\ForceSeatPM\ScriptsAPI
You can browse them from Visual Studio Code.
- When you finish making changes to the script, save it and then go to Profile Editor to press Run (or switch to the game).
- If there is any error, it will be displayed in Action Center or in output console (if you press Run button).