Skip to content
Made in Poland
Global Shipping
Tutorials & Guides

Motion Scripts in VS Code

Edit motion scripts in Visual Studio Code with IntelliSense and syntax highlighting.

1 Introduction

This tutorial shows how to use Visual Studio Code to edit motion scripts associated with profiles in platform manager. 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.

2 Prerequisites

1. Make sure that Visual Studio Code is installed.

2. Start the Visual Studio Code, go to File, Preferences, Extensions.

3. Search for C/C++ extension. Click install and wait until the extension and all dependencies are installed.

4. Close the program.

Information
You can use other coding software, according to your preferences. We recommend using Visual Studio Code or Notepad++. The rest of this tutorial still applies, regardless of the software used.

3 Steps to open the script

Warning

Keep in mind that ONLY a cloned (not a built-in profile) and a full copy (non-shallow) profile's script can be edited.

Creating a full copy of a profile means, that it will not be updated in the future with software updates. In order to, for example, implement support for new devices, user will have to update his profiles by creating a full copy of new built-in profile and transfer his changes manually.

1. Go to ForceSeatPM, open the game in Games, open its profile list and click the Clone icon next to the profile that you want to modify.

2. In the cloning window:

  • Type in a new profile name
  • disable Shallow copy
  • enable Activate new profile

and click Clone.

To reach the scripts, open the new profile, open the menu next to Activate (1) and choose Motion scripts (2).

3. The Motion scripts window lists the profile's scripts, one per platform family. The one marked In use (1) is the script for your motion platform.

4. Press Verify next to the script to check that it builds and runs without errors. The result opens in a window of its own; for an invalid script it shows the error.

5. Click Open in VS Code (2) to open the script in Visual Studio Code.

4 Coding the script

At this point there are two scenarios:

  1. If you are editing the script with the game running in the background and you plan to switch (Alt+Tab) between the VSC and game windows (e.g. changed filter parameters), you can close the Motion scripts window. Platform manager will detect any changes made to the script and reload it automatically. If there are any syntax errors in the script, details will be displayed in Action Center.
  2. If you are editing the script without the game running in the background or you want to check the script manually, keep the Motion scripts window open. You will be checking it by pressing Verify later.

Code completion and content help can be used normally during script development

All headers (with embedded comments/documentation) that define scripts API are located in:
ForceSeatPM directory\ScriptsAPI

You can browse them from Visual Studio Code.

When you are finished making changes to the script, save them and press Verify in the Motion scripts window (or launch the game). If there are any errors, they are shown in Action Center and in the Verify result.