// Management · RimWorld Mod
PyRimTestNET
PyRim - Python Scripting Framework for RimWorld Build events.
PyRim - Python Scripting Framework for RimWorld
Build events. Create stories. Control RimWorld with Python. PyRim is a powerful scripting framework that brings Python into RimWorld. Instead of creating a complete C# mod for every idea, you can write Python scripts that interact with the game through the PyRim API. Whether you want to create dynamic events, AI-controlled gameplay, custom quests, story generators or automation systems, PyRim provides the tools to do it.Features
- Embedded Python runtime
- Large official PyRim API
- Custom event system (PyDef)
- Python ↔ C# bridge
- Dynamic game commands
- Reflection API (advanced)
- AI-friendly architecture
- Visual Event Editor
- Execution Queue & Debug tools
- Designed for modders and AI-assisted development
What can you do?
- Spawn pawns and items
- Control weather
- Trigger incidents
- Modify colonists
- Read colony state
- Create custom events
- Generate random encounters
- Build quest systems
- Create AI-driven gameplay
- Prototype mechanics without writing C#
PyDef Event System
PyRim includes its own JSON event format. Features include:- Conditions
- AND / OR logic
- ELSE branches
- Letters
- Actions
- Delay execution
- Visual Event Editor
Python Example
import rw
def command():
rw.clear()
rw.letter(
"PyRim",
"Hello RimWorld!"
)
rw.spawn_item("Steel",100)
return rw.flush()
Reflection API
Advanced users can access public C# members through the Reflection Bridge. This allows interaction with many RimWorld systems while still using Python.Execution Queue
PyRim includes an execution queue capable of displaying:- Running scripts
- Waiting scripts
- Completed scripts
- Failed scripts
- Execution history
- Execution time
- Debug information
Documentation
The workshop package contains official documentation including:- Human API
- AI API
- Bridge Commands
- State Schema
- PyDef JSON
- Examples
Security Notice
PyRim embeds a full Python runtime. Unknown or malicious Python scripts may:- damage save files
- modify colonies
- crash the game
- perform unexpected actions