Building rFactor plugins with Python using rFactor2Python

Thu 22 November 2012 // posts

rFactor2Python is a plugin for rFactor that forwards plugin calls to Python scripts, passing game data as well, making the task of programming rFactor plugins much easier, specially useful for prototyping, since Python is loaded with tons of useful modules ready to use.

Some of the features and possibilities are:

  • You don't have to know C++
  • You don't have to compile anything
  • Most of the rFactor Internals Plugin methods are exposed to Python!
  • Python provides huge functionality with little work and has high quality documentation
  • Multiple python plugins supported.

For example, you can easily:

  • Save players timings to a database
  • Create a webpage with live server status
  • Send an email with results, timings, etc, when a race ends
  • Interact with an Arduino


20110927 (experimental)

  • new: Python threading is now possible (finally...but needs further testing) download

20110606 (experimental)

  • new: Multiple plugins support! Place Python plugins inside rf2py_plugins/.
  • new: Plugins are classes now! See
  • update: small updates here and there...


  • new: CheckHWControl implemented.
  • update: examples updated with CheckHWControl.


  • update: fixed a crash when calling xdecref on loaded module
  • update: print python version to log file
  • new: mysqldb example. rfactor-mysqldb.sql contains the database structure
  • new: script. Very useful to simulate score updates and test
    rFactor2Python scripts.
  • new: example. The output of this script can be used by Example output: rfactor2python.frames.txt.tar.gz


  • update: mLapDist field was missing. Added.


  • Examples directory added
  • Two examples added: log and serial
  • functions are empty now. A brief description, from original headers, was
    added at the top of every function.


  • Telemetry updates! New function available: UpdateTelemetry. (check
  • Python exceptions tracebacks are now printed to log file. This helps debugging


  • Initial release


  • Python (correct version) is the only requirement


  • is self explanatory.
  • rfactor2python_examples/ directory contains multiple plugin examples
  • All attributes and functions have the same name as in Internals Plugin SDK (download from official rFactor site)


  1. Extract plugin zip file into rfactor root directory.
  2. Read
  3. Place plugins inside rf2py_plugins/.


  • If you have any issues, check rfactor2python.log file. Python exceptions are logged to this file.