By: Joao C.
| Unavailable: 1-Click Install | |
| Related Videos |
| » Profile |
| Screenshots |
| Comments! |
| HOF Nominations |
Screenshots unavailable
Changes:
- 20110927 (experimental)
- new: Python threading is now possible (finally...but needs further testing)
- 20110606 (experimental)
- new: Multiple plugins support! Place Python plugins inside rf2py_plugins/.
- new: Plugins are classes now! See rfactor.py.
- update: small updates here and there...
- 20110523
- new: CheckHWControl implemented.
- update: examples updated with CheckHWControl.
- 20110521
- 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: test-score.py script. Very useful to simulate score updates and test
rFactor2Python scripts.
- new: rfactor-frames.py example. The output of this script can be used by
test-score.py. Example output: rfactor2python.frames.txt.tar.gz
- 20110516
- update: mLapDist field was missing. Added.
- 20110510
- Examples directory added
- Two examples added: log and serial
- rfactor.py functions are empty now. A brief description, from original headers, was
added at the top of every function.
- 20110509
- Telemetry updates! New function available: UpdateTelemetry. (check rfactor.py)
- Python exceptions tracebacks are now printed to log file. This helps debugging rfactor.py.
- 20110508
- Initial release
Description:
Use the power of Python programming language as a rFactor internals plugin!
* Advantages:
- 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
Requirements:
- Python (correct version) is the only requirement
Documentation:
- rfactor.py 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)
Installation:
1. Extract plugin zip file into rfactor root directory.
2. Read rfactor.py.
3. Place plugins inside rf2py_plugins/.
Problems:
- If you have any problems with the plugin, check rfactor2python.log file.
Python exceptions are logged to this file.
Message to users:
- If you're using this plugin on a public project, I'd be happy to know.
|
You must be logged in to download files. Login if you have already have a account or register as a new user. Access to downloads is immediate. |
Hi vincebc.
rFactor2Python plugins are not threaded, at least for now.
tourettes on Aug-01-2011
Hi ialiende.
Some plugin functions, like UpdateTelemetry() are called at a fast rate and also contain lots of information. Depending on what you're doing, you can be writing tons of data (either to database or file) too fast. Try controlling the frequency at which you save rFactor's data.
You might want to read the comments at http://b.joaoubaldo.com/?p=688&cpage=1#comment-2671.
Cheers
tourettes on Aug-01-2011
Hi again,
I did a fresh rfactor install and now I don't have those debug files. Then I installed your plugin with mysql script enabled but I still have fps issues.
I wish to know how debug is triggered and how to disable it in case I'll have that problem again (now it's clear for me that it is not caused by your plugin but maybe you know how to do it).
On the other hand, my intention was to do a web page with live and hotlaps info together and, based on your web example, I think it's possible but the live part seems difficult to me. You say that it's simple, am I missing something? Obviously, I have to solve fps issues first, do you have any idea? (I took your script and I changed mysql server ip to 127.0.0.1 only. Btw, I fixed a typo in the UpdateScoring call that was starting with downcase
Anyway, I like python and rfactor so this plugin is very useful.
ialiende on Jul-15-2011
Hi,
I've found a problem but I'm not sure if it's related with your plugin.
I tried a couple of your examples and I like your plugin very much, but now rfactor freeze several times in a lap and I realized that a lot of debug info is being written in files like MAP_DEBUG.txt and ExampleInternals*Output.txt.
I saw that this version of the plugin indicates 'experimental', is possible that it enables debug? Or, do you know how to disable it?
Thx.
ialiende on Jul-15-2011
Hi,
I've some trouble to send mouse control in rf. It's more a question about Python.
I tried different method found in internet, but without success.
It's for clicking on a driver in the monitor view. I move the cursor but the click don't work.
Do you have some tips?
Thanks
vincebc on Jul-09-2011
rFactor2Python was updated (20110606).
What's new:
- Support for multiple Python plugins:
For example, if one needs to save session data to a DB and send telemetry data through a serial port at the same time, just place rfactor-serial.py and rfactor-mysqldb.py files inside rf2py_plugins/.
- Plugin class:
By using RF2PyPlugin class, the code gets cleaner (no need for globals, etc.).
All the examples were updated to use this class.
- CheckHWControl() support:
It is possible to manipulate game controls from Python plugins.
Read rfactor.py.
Read more at http://emcheio.com/1k
tourettes on Jun-06-2011
Yes, like that.
CheckHWControl() is called for every controlName.
tourettes on May-27-2011
Hi
If I want use more input in the main, I must put all the input in the CheckHWControl function like this?
def CheckHWControl(controlName, fRetVal):
----global ViewMyVehicle
----global CycleDriving
...
...
...
----if controlName in ("ViewMyVehicle") and ViewMyVehicle:
--------ViewMyVehicle = False
--------fRetVal[0] = 1
--------return True
----if controlName in ("CycleDriving") and CycleDriving:
--------CycleDriving = False
--------fRetVal[0] = 1
--------return True
...
...
...
----return False
Another question, how send more than one input at the update hwcontrol?
vincebc on May-27-2011