Skip to main content

aoe2de_rms_gen_obj_parser is a python package to parser Age of Empires2: Definitive Edition RMS

Project description

Parser to extract, from AoE2 DE GeneratingObjects.inc file, the code that would be produced when ran with the constants contained in the RandomMapScript files

Installation

pip install aoe2de_rms_gen_obj_parser

Basic usage

from aoe2de_rms_gen_obj_parser import GeneratingObjectsParser
# We instantiate the GeneratingObjectsParser
parser = GeneratingObjectsParser("Path/to/GeneratingObjects.inc", "Path/to/SomeRandomMapScript.rms")

# We must run the parsers each time an attribute is set, in order to update them
parser.run_parsers()

# We can now get the result for the parsing (done on the fly, that's why we must use run_parsers() first
parsed_content = parser.get_result()

Advanced Usage

The class GeneratingObjectsParser can be instantiate with up to 5 arguments.

Two are <<mandatory>> (they won’t have default values):

  • path_gen_obj, the path of the GeneratingObjects.inc file

  • path_rms_file, the path of the .rms file (like Arabia.rms, Arena.rms …)

The three others are <<optional>> (they have default values) but must respect defined values:

  • map_size, must be a key of aoe2de_rms_gen_obj_parser.const.MAP_SIZE_DICT

  • map_resources, must be a key of aoe2de_rms_gen_obj_parser.const.MAP_RESOURCES_DICT

  • game_type, must be a key of aoe2de_rms_gen_obj_parser.const.GAME_TYPE_DICT

By default, these are set to TINY_MAP, OTHER_RESOURCES and OTHER_GAME

Because the attributes can be changed at will (setters exposed), the files must be parsed first with run_parsers() before asking for a result with get_result()

from aoe2de_rms_gen_obj_parser import GeneratingObjectsParser
# We instantiate the GeneratingObjectsParser
parser = GeneratingObjectsParser()
... <some code>
parser.set_path_gen_obj("Path/to/GeneratingObjects.inc")
parser.set_path_rms_file("Path/to/SomeRandomMapScript.rms")
... <some code>
parser.set_map_size("LARGE_MAP")
parser.run_parsers()
parsed_content = parser.get_result()

Information about GeneratingObjects.inc

  • Contains the code for the map objects generation, from buildings, to resources, with units and some terrains, such as Town Centers, Villagers, Scouts, Stones, Golds, Huntables, Lurables …

  • The previous code is encapsulated in various if, elseif, else statements. Omitting else, they will have their corresponding constraint on a constant defined elsewhere (the .rms files)

Information about RandomMapScript.rms

  • Define base Land and Terrain

  • Define seasons if needed/wanted

  • Define the constants used by the GeneratingObjects.inc file

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

aoe2de_rms_gen_obj_parser-2.1.1.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file aoe2de_rms_gen_obj_parser-2.1.1.tar.gz.

File metadata

  • Download URL: aoe2de_rms_gen_obj_parser-2.1.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.1

File hashes

Hashes for aoe2de_rms_gen_obj_parser-2.1.1.tar.gz
Algorithm Hash digest
SHA256 4db22abccdfb3b24fa06c99d173dfefa9faa9cfe78837d254be327876eda0a72
MD5 e7bd94e7ef7d3f953ed1ce1b4b96f3a6
BLAKE2b-256 45a9f2f03494f63df8ff523c53d6816bd68c4a9d9b38ac161219855d8c584bb5

See more details on using hashes here.

File details

Details for the file aoe2de_rms_gen_obj_parser-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: aoe2de_rms_gen_obj_parser-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.1

File hashes

Hashes for aoe2de_rms_gen_obj_parser-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 778b0d655eb975c2a900491abe3df75b759b4fb526ec24202c7213a90421d327
MD5 bb3256927e710da2203cba748c4891be
BLAKE2b-256 cb4f339aa8d4ba5f30b346d50520abc8ea9a502a85be61af8ff98b3e7817887c

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