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

Uploaded Source

Built Distribution

rimworld-0.1.1-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rimworld-0.1.1.tar.gz
  • Upload date:
  • Size: 15.1 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.1.tar.gz
Algorithm Hash digest
SHA256 6e077ce235efba48bd23a253a426ab62be85ecd6d78b0c5a4b382259cea3690b
MD5 c8586354bc198b3784cc14f0d7b7eba2
BLAKE2b-256 a2213ba455d3506896d7a15817e2723523528e0739a6bcbe5e7b6667bb090f75

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rimworld-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 26.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 88f58e58dc752ad396e9e3b9753169ca26f17f90ce3a4c54b0986f380484ac28
MD5 613b2de92ec7022cbe2c33a9552e3aa0
BLAKE2b-256 d67b1627faf753f76cccf9595357eb96c55d5124fc1683cbfd569ea6291bea5d

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