Interact with OpenRCT2 from python!
Project description
pyrct2
Python client for OpenRCT2. Launches the game in headless mode, connects to the openrct2-bridge plugin over TCP, and sends game actions.
Setup
pip install pyrct2
pyrct2 setup
setup finds your OpenRCT2 installation and installs the bridge plugin. Requires OpenRCT2 to be installed.
Usage
from pyrct2.client import RCT2
# Launch a headless game and send commands
with RCT2.launch("path/to/scenario.SC6") as game:
game.get_status()
game.execute("ridecreate", {"rideType": 1, "rideObject": 0, "colour1": 5, "colour2": 10})
game.advance_ticks(100)
# Or connect to an already-running instance
with RCT2.connect() as game:
game.get_status()
Known Limitations
Windows: Headless launch crashes on rapid succession
OpenRCT2's headless mode on Windows crashes approximately about 1 out of 3 times when launching and terminating instances in quick succession. Probably an issue with cleaning up and allocating space for the next game instance. This might automatically resolve itself when port discovery/assignment is added.
Exit codes seen over a few trials:
3221356611(0xC0020043) —RPC_S_NO_INTERFACES, COM/RPC resource cleanup failure3221225620(0xC0000374) —STATUS_HEAP_CORRUPTION, heap corruption during startup3221226505(0xC0000409) —STATUS_STACK_BUFFER_OVERRUN, stack buffer overrun
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyrct2-0.2.1.tar.gz.
File metadata
- Download URL: pyrct2-0.2.1.tar.gz
- Upload date:
- Size: 30.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76ea4a46f2f1812e7415fc2bb2200231c46b882db3f4b63cc44fad0fa630c954
|
|
| MD5 |
bf8ecc1762552ebcf6c7ec4f623b3e37
|
|
| BLAKE2b-256 |
4a8766a8024f0b26105b1419c0f08c02435b848cc08dd081e1c04931c3789619
|
Provenance
The following attestation bundles were made for pyrct2-0.2.1.tar.gz:
Publisher:
publish.yml on MaukWM/pyrct2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrct2-0.2.1.tar.gz -
Subject digest:
76ea4a46f2f1812e7415fc2bb2200231c46b882db3f4b63cc44fad0fa630c954 - Sigstore transparency entry: 1107822910
- Sigstore integration time:
-
Permalink:
MaukWM/pyrct2@8037e975e06a2bbbfc8680eff3a732f2b10a6bd6 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/MaukWM
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8037e975e06a2bbbfc8680eff3a732f2b10a6bd6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyrct2-0.2.1-py3-none-any.whl.
File metadata
- Download URL: pyrct2-0.2.1-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
baeb87b14f6f11d2238790121f80667c3c9ec8b061e5f19d0666d4ba6c65a0e1
|
|
| MD5 |
3bfd2e46221701b18fa2dcba07ae5bde
|
|
| BLAKE2b-256 |
4a75e8cb2d50467fe51c1b414fcf0e01b037c6330e35e95d14e66ef398b6029d
|
Provenance
The following attestation bundles were made for pyrct2-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on MaukWM/pyrct2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrct2-0.2.1-py3-none-any.whl -
Subject digest:
baeb87b14f6f11d2238790121f80667c3c9ec8b061e5f19d0666d4ba6c65a0e1 - Sigstore transparency entry: 1107822911
- Sigstore integration time:
-
Permalink:
MaukWM/pyrct2@8037e975e06a2bbbfc8680eff3a732f2b10a6bd6 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/MaukWM
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8037e975e06a2bbbfc8680eff3a732f2b10a6bd6 -
Trigger Event:
release
-
Statement type: