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.2.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

rimworld-0.1.2-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rimworld-0.1.2.tar.gz
  • Upload date:
  • Size: 15.6 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.2.tar.gz
Algorithm Hash digest
SHA256 3b5e55f7d4386c4f813e369fa6e46c2e62bd6a48b56dfb6f82af1de75adfdb3a
MD5 ed8d1e8ec67d1d0050ff8413cae860d1
BLAKE2b-256 8c554955630cf0ef1ac40acd221ab4157526ab1d9671f14b97b4460b4706fb91

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rimworld-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 27.3 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a36ea2e2acb37eb0985853b99017bf738c2e588c689d3be582daaf0908762750
MD5 e21698c96bc707554168e968f9ed3c9c
BLAKE2b-256 e2e0bfa94959c35a6a6779b99583d7b47826b9de714cd68d316cdcdb89419190

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