Skip to main content

No project description provided

Project description

RimWorld XML library

This library is designed to assist with writing mods and mod patches for RimWorld. It provides functionality to load game data into an xml file and apply patches to it.

Basic Usage

from rimworld.world import World

World.from_settings()

print(xml.xpath('/Defs/ThingDef[defName="mything"]'))

Settings

rimworld.settings module provide basic settings needed to load mod data. By default they are loaded from config.toml file in current folder, which has the following format:

rimworld_appdata_folder="<user folder>/AppData/LocalLow/Ludeon Studios/RimWorld by Ludeon Studios/"
rimworld_folder="<steam folder>/steamapps/common/RimWorld"
rimworld_workshop_folder="<steam folder>/steamapps/workshop/content/294100"
rimworld_local_mods_folder="<steam folder>/steamapps/common/RimWorld/Mods"

Advanced Usage

You can customize your world by specifying different versions, modlists, etc

import logging
logging.basicConfig(level=logging.DEBUG)

from pathlib import Path
from rimworld.settings import create_settings
from rimworld.worldsettings import WorldSettings, load_mod_infos
from rimworld.gameversion import GameVersion
from rimworld.world import World

# load config.toml
settings = create_settings()

# set game version
version = GameVersion.from_string('1.5')

# get Path with rimworld Core module and expansions
core_path = settings.expansions
my_mod_path = Path('C:\\Projects\\MyMod')

# load About.xml information about expansions and the mods
mods = load_mod_infos([core_path, my_mod_path])


# Load world
world_settings = WorldSettings(mods, version)
world = World.new(world_settings)

# now just wait for loading to complete

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rimworld-0.1.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

rimworld-0.1.0-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file rimworld-0.1.0.tar.gz.

File metadata

  • Download URL: rimworld-0.1.0.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for rimworld-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b4462a6537dec696e1695fb6c9347abea7ecced6f02bef957aa66e04e4e02096
MD5 9c25dcacca98d49292486df33b41569e
BLAKE2b-256 4d5579bebed124e8bdc27a5bbfab21e33c99c72b2fca86ab57ae76b7defb2fa3

See more details on using hashes here.

File details

Details for the file rimworld-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rimworld-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for rimworld-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3bdd19e847f465c59e6b02ca4622df8cbc86c7ba06f041005b8228b43ad1c7ba
MD5 e0154f00d9582c5febe8ccd0d256c2c6
BLAKE2b-256 73f7e10da7f39f01170e99711a69646b585ca4a1bb00102eabd367805c77908f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page