All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Support for the new civilizations -- Credits: mardaravicius
Civilization.ACHAEMENIDS = 46
Civilization.ATHENIANS = 47
Civilization.SPARTANS = 48
- Support for the new blank technologies -- Credits: mardaravicius
TechInfo.BLANK_TECHNOLOGY_0
toTechInfo.BLANK_TECHNOLOGY_19
- Support for the new action types -- Credits: mardaravicius
ActionType.LINE_FORMATION
= 18ActionType.BOX_FORMATION
= 19ActionType.STAGGERED_FORMATION
= 20ActionType.FLANK_FORMATION
= 21
- Type hinting for triggers and some other object lists
- Fixed the same bug corrupting scenarios - missed even more edge cases...
- Fixed the same bug corrupting scenarios - missed other edge cases
- Fixed a bug corrupting scenarios
- Issues with reading older scenarios
- Issue with creating a new effect with specific combination of attributes
- Support for 10 new effects:
trigger.new_effect.set_object_cost(...)
trigger.new_effect.load_key_value(...)
trigger.new_effect.store_key_value(...)
trigger.new_effect.delete_key(...)
- Note that the "load", "store" and "delete" key effects are campaign only.
trigger.new_effect.change_technology_icon(...)
trigger.new_effect.change_technology_hotkey(...)
trigger.new_effect.modify_variable_by_resource(...)
trigger.new_effect.modify_variable_by_attribute(...)
trigger.new_effect.change_object_caption(...)
trigger.new_effect.change_player_color(...)
- Support for setting Player starting views:
moved.player_manager.players[PlayerId.ONE].initial_player_view_x = ...
moved.player_manager.players[PlayerId.ONE].initial_player_view_y = ...
- A new function to the
Tile
object:tile.to_dict()
(Similar toarea.to_dict()
)Tile(4, 6).to_dict()
would result in:{'location_x': 4, 'location_y': 6}
- The
OptionManager
for global options in the scenario:OptionManager.victory_condition
OptionManager.victory_score
OptionManager.victory_years
OptionManager.victory_custom_conditions_required
OptionManager.secondary_game_modes
OptionManager.lock_teams
OptionManager.random_start_points
OptionManager.allow_players_choose_teams
OptionManager.collide_and_correct
OptionManager.villager_force_drop
OptionManager.lock_coop_alliances
- Incorrect IDs for
BuildingInfo
:YURT_I
,YURT_J
,YURT_K
,YURT_L
- Deprecated two attributes in the MapManager
MapManager.collide_and_correct
moved toOptionManager.collide_and_correct
MapManager.villager_force_drop
moved toOptionManager.villager_force_drop
- Incorrect default for
caption_string_id
inUnitManager.add_unit(...)
causing crash on scenario load in the editor
- Error when calling
UnitManager.add_unit(...)
(missing thecaption_string_id
param)
- Issue while reading older scenarios (pre 1.54)
- Support for the new
Unit.caption_string_id
attribute - Support for the 6 new
Effect
attributes:resource_1
&resource_1_quantity
resource_2
&resource_2_quantity
resource_3
&resource_3_quantity
- Support for the new
Effect
attributes in the following effects:change_object_cost
change_technology_cost
- This is reflected in the
trigger.new_effect.<effect>
functions and theEffectId
documentation. - Example:
from AoE2ScenarioParser.datasets.trigger_lists import Attribute ... trigger.new_effect.change_object_cost( resource_1=Attribute.WOOD_STORAGE, resource_1_quantity=20, resource_2=Attribute.GOLD_STORAGE, resource_2_quantity=80, )
⚠️ BREAKING CHANGE
- Support for the
wood
,food
,gold
andstone
attributes in the following effects:change_object_cost
change_technology_cost
- Switch to the new
resource_X
andresource_X_value
properties - This is reflected in the
trigger.new_effect.<effect>
functions and theEffectId
documentation.
Due to earlier version release testing
0.2.0
and0.2.1
were pushed totest.pypi.org
blocking those versions forever... F
- Ability to read the new 1.54 scenarios
- This version is available since Update Preview 125283 (October 14, 2024)
⚠️ Very limited implementation - No new features from the update have been implemented yet⚠️
r3c5
to theButtonLocation
dataset (value = 15
) -- Credits: mardaraviciusdock_page2
to theButtonLocation
dataset (value += 20
) -- Credits: mardaravicius- Example:
ButtonLocation.r1c5.dock_page2 # Result: (5 + 20) = 25
- Example:
- Placeholder Technologies to the
TechInfo
dataset -- Credits: mardaraviciusTechInfo.TECHNOLOGY_PLACEHOLDER_01
(Until 10 (incl))
- The effect
CHANGE_RESEARCH_LOCATION
toCHANGE_TECHNOLOGY_LOCATION
- Fixes an inconsistency with the in-game name (renamed a while ago)
- Kept an alias of the old function
change_research_location
with deprecation warning
PlayerAttribute.<X>.editor_name
not working- Updated the
json
file used by theeditor_name
property to reflect the new in-game names
- Updated the
- The
remove_triggers
function to theTriggerManager
- This function doesn't break display order or changes execution order and also keeps all activation effects properly linked
scenario.actions.load_data_triggers()
function overwriting the trigger display order
- A new property to the
Area
object:Area.maximum_coordinate
- Mimics the previous behaviour of
Area.map_size
(read fix below)
- Mimics the previous behaviour of
- The
Area
object returning the wrongmap_size
value (returnedmap_size - 1
)- This also impacts multiple related functions which used it internally
Many thanks to Alian713
for all his dataset work! ❤️
- Outdated datasets (Updated to match UGC Guide) (Thanks Alian)
- Internal scenario name not matching new filename on writing
- Affected the names of data files created by XS
- Ability to register functions to run on scenario write for easier 3rd party support
- Can be used as a
@scenario.on_write
decorator or called directly
- Can be used as a
- Effect
change_object_civilization_name
missing thesource_player
attribute
- 3 new functions to the
Area
objectmove()
move the selection relatively by an x/y offsetmove_to()
move the selection to a coordinate from on any corner of the selectionis_within_bounds()
see if the selection is currently within the bounds of a map size
- 1 function to the
UnitManager
clone_unit()
clone an existing unit and only edit attributes you like to edit
- Missing
TechInfo.SAVAR
entry - XS code being duplicated if it was added through the
XsManagerDE.add_script(...)
and it was called in between twoXsManagerDE.initialise_xs_trigger()
calls
- Issue with reading scenarios with AI files
- Default cliffs missing from
OtherInfo
dataset- Unit IDs: 264 to 272
- Error on reading non-pup scenarios (since
v0.1.62
)
- Ability to read the new 1.53 scenarios
- This version is available since the pup (March 1st)
- The new
lock_personality
boolean to aPlayer
object
Dataset update!
Many thanks to Alian713
for all his dataset work! ❤️
- All missing units to the
UnitInfo
dataset (Centurion, Savar, Dromon etc.) - All missing technologies to the
TechInfo
dataset (Elite monaspa, Devotion etc.) - All missing buildings to the
BuildingInfo
dataset (Fortified Church, Mule cart, yurts, bridges etc.) - All missing heroes to the
HeroInfo
dataset - All missing miscellaneous objects to the
OtherInfo
dataset (Cliffs, Hunnic Horse etc.) - All missing projectiles to the
ProjectileInfo
dataset (See changes to this dataset below) - All missing resources to the
Attribute
dataset - All missing attributes to the
ObjectAttribute
dataset
- The
UnitInfo.CENTURION
(275
) was renamed to:UnitInfo.IMPERIAL_CENTURION
- The
UnitInfo.LEGIONARY
(1
) was renamed to:UnitInfo.IMPERIAL_LEGIONARY
- The
Attribute.EXTRA_ELEPHANT_CONVERT_RESIST
(262
) was renamed to:Attribute.CIVILIZATION_NAME_OVERRIDE
- The
Attribute.UNUSED_RESOURCE_268
(268
) was renamed to:Attribute.HUNTER_PRODUCTIVITY
- The
Attribute.UNUSED_RESOURCE_269
(269
) was renamed to:Attribute.TECHNOLOGY_REWARD_EFFECT
- Updated a couple
ProjectileInfo
values to reflect changes in the game [See changes]
MapManager.set_elevation(...)
When inner area is not level to the edge will result in illegal terrain elevation #44
- Support for the five new effects added in update 99311 (11-Dec):
(75) Train Unit
(76) Initiate Research
(77) Create Object Attack
(78) Create Object Armor
(79) Modify Attibute By Variable
MapManager
removing entire map when setting the map size to the same value more than once #43
- Ability to read the new 1.51 scenarios (Since update on Oct 31st)
Armenians
andGeorgians
to theCivilization
dataset
- Proper support for
RoR
scenarios.- Scenarios can now easily be converted back and forth by doing:
scenario.variant = ScenarioVariant.AOE2
scenario.variant = ScenarioVariant.ROR
- Note: 'Support' does not include any
RoR
datasets.
- Scenarios can now easily be converted back and forth by doing:
- Warnings for writing scenarios with an incorrect variant (like legacy variants)
- A setting to disable said warnings:
settings.SHOW_VARIANT_WARNINGS = False
version
attribute to the core of AoE2ScenarioParser- Can be used like:
from AoE2ScenarioParser import version
- Can be used like:
- Issue with indices not being reset when overwriting maps #42
- This issue also occurred when changing map size
- Development logging information
- Ability to read the new 1.49 scenarios
Romans
to theCivilization
dataset
- Ability to read the new 1.48 scenarios (No functional changes found (yet))
- This version is available since the pup released today (March 25th)
- Issue when updating
TerrainTile
list in the map manager - Not all player resource names being present in the resource name file
Attribute.FORAGING_WOOD_PRODUCTIVITY
-- #40 (Alian)
- Warning showing more bytes were found in scenarios
- Present since 31st of January console update with 'no functional changes'.
- Minor docstring copypasta mistake (
VictoryTimerType
)
- New error message for certain type of errors which might help find the cause of the issue faster.
- New unit to the
UnitInfo
dataset, named:Sogdian Cataphract
. - Deprecation warning to
scenario.remove_store_reference()
, see the docstring for more info.
- Scenario store now uses
WeakValueDictionary
instead of normal dictionary.
- Multiple issues when printing an effect with
selected_object_ids
that had invalid references. - Issue when trying to write a scenario with an effect containing an invalid effect ID.
- API Docs (Beta)!
corner1
andcorner2
attributes to theArea
object.- The ability to use
Area
objects without linking them to a scenario.- Example:
area = Area(x1=0, y1=0, x2=5, y2=5)
. - Example:
area = Area(corner1=Tile(0, 0), corner2=Tile(5, 5))
.
- Example:
- Warnings now use the Python built-in warning system.
- Issue when copying the entire terrain list to another scenario (
mm2.terrain = mm.terrain
). - Issue when using UTF-8 characters in fixed length strings.
- The
create_hill
function in the map manager. Useset_elevation
instead.
- More ways to get access to scenario object and its managers without having to drag them everywhere.
scenario <object>.get_scenario()
i.e.scenario = trigger.get_scenario()
scenario = AoE2DEScenario.get_scenario(obj=trigger)
scenario = AoE2DEScenario.get_scenario(name="coolname")
- You can set the names like this:
- Defaults to filename:
AoE2DEScenario.from_file('path/coolname.aoe2scenario')
(name: coolname) - Explicitely setting the name:
AoE2DEScenario.from_file('path/othername.aoe2scenario', name="myname")
(name: myname)
- Defaults to filename:
- You can set the names like this:
- Time indicators for status messages and execution time per scenario
- The
EnableTechnologyStacking
effect missing thequantity
attribute. - The
item_id
attribute not updating properly for all use cases. - The
ChangeView
effect missing the recently added (to this effect)quantity
field. - An issue that occurred when reading scenarios which had the
civ
field set to0
. - An issue with copying
Variable
objects from one scenario to another. - The ordering of units returned from
object
data triggers not being consistent with the condition/effect input order
- Issues with reading new 1.47 scenario
- Development logging information
Support for the new 66692 update! (Scenario version 1.47)
- String Table ID alternatives to
MessageManager
attributes.message_manager.instructions_string_table_id = 123
Retriever.commit_callback
wasn't called on commit causing text fields on Effects to corrupt (sometimes)UnitInfo.THIRISADAI
showing as castle unit inUnitInfo.unique_units()
- The
MessageManager
(scenario.message_manager
)- The ability to change the 6 text fields in the message tab (instructions, hints, victory etc.)
MessageManager
documentation: link
- The
is_dirty
attribute to retrievers to see if they were manually changed (from outside managers) - A setting that stops managers from overwriting dirty retrievers (on by default)
settings.ALLOW_DIRTY_RETRIEVER_OVERWRITE
- BackEnd: Partially rewritten construct & commit logic (slight performance improvement)
- BackEnd: Renamed all references to
UUID
named:host_uuid
to justuuid
- Issue with
Effect.armour_attack_class
attribute not being displayed (correctly) when printing triggers/effects - Incorrect ID for
EffectId.DISABLE_OBJECT_DELETION
DifficultyLevel.EXTREME
is now properly available. Representing-1
:yFE:
- The
quantity
field not being shown when printing theDifficulty level
Condition when the difficulty was set toEXTREME (-1)
TechInfo.INDIANS
not being renamed toTechInfo.HINDUSTANIS
- Docstrings and for the PlayerAttribute (
Attribute
) dataset (Thanks Alian)
TechInfo.unique_techs()
having a typo inTechInfo.FABRIC_SHIELDS
techUnitInfo.unique_units()
returning the (ELITE_
)SHRIVAMSHA_RIDER
as castle units
- Update 61321:
- Techs in
TechInfo
- Techs in
- Docstrings for all
ObjectAttribute
entries (Directly from the UGC Guide. Credits: Alian) - These new datasets for the
Modify Attribute
effect: (Thanks to Alian, our dataset wizard)- Import like:
from AoE2ScenarioParser.datasets.trigger_lists import <NAME HERE>
ChargeType
ChargeEvent
CombatAbility
FogVisibility
GarrisonType
OcclusionMode
ProjectileHitMode
ProjectileVanishMode
UnitTrait
- Import like:
- Update 61321:
TechInfo.SULTANS
to:TechInfo.GRAND_TRUNK_ROAD
TechInfo.INDIANS
to:TechInfo.HINDUSTANIS
- Renamed dataset
SmartProjectile
to:ProjectileSmartMode
- Dataset documentation: link
- Issue reading some older scenarios
- Typo in
TechInfo
dataset:TechInfo.FABRIC_SHIEDS
to:TechInfo.FABRIC_SHIELDS
TechInfo.STONE_SHADT_MINING_GOLD_GENERATION_INCREASE
to:TechInfo.STONE_SHAFT_MINING_GOLD_GENERATION_INCREASE
- Typo in
BlastLevel
dataset:BlastLevel.TWNETY_FIVE_PERCENT
to:BlastLevel.TWENTY_FIVE_PERCENT
- Renamed
SmartProjectile.ENABLED
to:ProjectileSmartMode.TARGET_FUTURE_LOCATION
- Renamed a couple techs for consistency (Thanks Alian)
HEAVY_CAV_ARCHER
to:HEAVY_CAVALRY_ARCHER
RESOURCES_LAST_LONGER_15
to:RESOURCES_LAST_15_PERCENT_LONGER
RESOURCES_LAST_LONGER_30
to:RESOURCES_LAST_30_PERCENT_LONGER
RESOURCES_LAST_LONGER_40
to:RESOURCES_LAST_40_PERCENT_LONGER
RESOURCES_LAST_LONGER_50
to:RESOURCES_LAST_50_PERCENT_LONGER
RESOURCES_LAST_LONGER_75
to:RESOURCES_LAST_75_PERCENT_LONGER
RESOURCES_LAST_LONGER_100
to:RESOURCES_LAST_100_PERCENT_LONGER
RESOURCES_LAST_LONGER_125
to:RESOURCES_LAST_125_PERCENT_LONGER
RESOURCES_LAST_LONGER_150
to:RESOURCES_LAST_150_PERCENT_LONGER
RESOURCES_LAST_LONGER_175
to:RESOURCES_LAST_175_PERCENT_LONGER
RESOURCES_LAST_LONGER_200
to:RESOURCES_LAST_200_PERCENT_LONGER
RESOURCES_LAST_LONGER_300
to:RESOURCES_LAST_300_PERCENT_LONGER
FOLWARK_HORSE_COLLAR_EXTRA
to:HORSE_COLLAR_FOLWARK_BONUS_INCREASE
- Issue with reading scenario files when script name field was populated
Support for the new 61321 update! (Scenario version 1.46)
- Update 61321:
- Support for the new Conditions
BUILDING_IS_TRADING
DISPLAY_TIMER_TRIGGERED
VICTORY_TIMER
AND
- Support for the new Effects
ENABLE_OBJECT_DELETION
DISABLE_OBJECT_DELETION
- 19 new entries in
ObjectAttribute
- 24 new entries in
Attribute
(aka: 'Player Attribute' or 'Resource') - 15 new units to
UnitInfo
- 2 new buildings to
BuildingInfo
- 8 new heroes to
HeroInfo
- 7 new others to
OtherInfo
(Partially from new update) - New dataset:
VictoryTimerType
- Support for the new Conditions
- Community documentation page (WIP)
UnitManager.change_ownership
now accepts a list of units as well as a single unit- Also improved function performance
- BackEnd: UnitManager read & writing logic (by a lot)
- Player Count shown in in-game scenario overview now updates to the amount of active players
- instead of not updating at all
- Typo in
Attribute
entries:CONVERT_RESIST_MIO_ADJUSTMENT (Typo)
=>CONVERT_RESIST_MIN_ADJUSTMENT
(ID: 178)VILLAGERS_KILLED_BY_AL_PLAYER
=>VILLAGERS_KILLED_BY_AI_PLAYER
(ID: 228)
- Update 61321:
- Renamed some
ObjectAttribute
entries:ENABLE_SMART_PROJECTILES
=>PROJECTILE_SMART_MODE
(ID: 19)AMOUNT_OF_1ST_RESOURCES
=>AMOUNT_OF_1ST_RESOURCE_STORAGE
(ID: 21)BONUS_DAMAGE_RESIST
=>BONUS_DAMAGE_RESISTANCE
(ID: 24)
- Renamed some
Attribute
entries:UNUSED_RESOURCE_096
=>NO_DROPSITE_FARMERS
(ID: 96)FEUDAL_TOWN_CENTER_LIMIT
=>EARLY_TOWN_CENTER_LIMIT
(ID: 218)
- Renamed some
DamageClass
entries:RAMS
=>RAMS_TREBUCHETS_SIEGE_TOWERS
(ID: 17)CASTLE
=>CASTLES
(ID: 26)LEITIS
=>UNUSED_ID31
(ID: 31) -- behaviour moved to a combat abilityCONDOTTIERO
=>CONDOTTIERI
(ID: 32)ORGAN_GUN_BULLET
=>PROJECTILE_GUNPOWDER_SECONDARY
(ID: 33) -- no longer used by only the organ gunFISHING_SHIP
=>FISHING_SHIPS
(ID: 34)HEROES_AND_KING
=>HEROES_AND_KINGS
(ID: 36)UNUSED_ID37
=>HUSSITE_WAGONS
(ID: 37)
- Renamed some
- Elephant Archer from the
UnitInfo.unique_units()
function
Attribute.X.editor_name
attribute to get the editor name as string -- #36 (Alian)scenario.remove_store_reference()
to remove the scenario reference from the store- Useful for when you want the scenario to be cleared by garbage collection (You also need to delete all other references to the scenario yourself)
- Issue with printing trigger values that are not in a dataset
Attribute
dataset names & docstrings updated -- #36 (Alian).
- Issue introduced after the
0.1.33
fix.XS Manager
was trying to create ascript call
effect regardless if the scenario supported it or not.
- Issue with deepcopying
UuidList
s. (Causing issues with trigger importing).
- Issue with
XS Manager
not copying the script content to the right trigger object.
- Issue with type hinting
trigger.new_effect
andtrigger.new_condition
Support for the new 58259 update!
- The new
Data Triggers
functionality! A powerful tool to communicate information from in-game to the parser!- You can find the
Data Triggers
cheatsheet here!
- You can find the
message
field to themodify_attribute
effect.
Area.to_chunks()
function is now A LOT faster in certain situations (sometimes 40x faster!)
- Issue with reading the new scenario files (since update 58259, 31-Jan-22)
- Issue with imported triggers not being deep-copied and causing reference problems
- Issue with copied triggers not being able to use
new_effect
andnew_condition
- Issue where
get_unit_in_area
paramsx2
andy2
were considered exclusive- Locations:
(0, 0), (3, 3)
would be considered like:(0, 0), (2, 2)
- Locations:
- Issue with reading older scenarios (older than 1.40)
Happy new year!
- The
Area
object! A powerful object for area management!- You can find the
Area
cheatsheet here!
- You can find the
tile
parameter to add_unit (Overwrites given x & y values)SectionName
enum for easier access to scenario sections
- Issue with reading armor/attack values in some effects.
- (Possibly) Worked around issue caused by a bug in Python from 3.8.6 to 3.9.1 (Fixed in 3.9.2)
- Renamed
TerrainTile
attributeindex
to_index
(Index value should be retrieved through the attribute:i
) - Issue where
typing_extensions
wasn't downloaded automatically through pypi (pip) - Final print statement not ending with a newline
i_to_xy
function returns named tuple. Can now also access the coords using.x
and.y
Tile
object to be (simple) (x, y)NamedTuple
instead of an entire object- Note: This is not about
TerrainTile
objects from the Map Manager.
- Note: This is not about
- Missing
MINUTES_AND_SECONDS
toTimeUnit
- Module
typing_extensions
not in requirements.txt
Support for the new 56005 update!
- Support for the 1.45 scenario files!
- The Player Manager!
- Allows access to many player related attributes like resources, civ, disables, diplomacy and more!
- Check the player manager cheatsheet for more info!
- Error when overwriting the source scenario (with a setting to disable this behaviour)
settings.DISABLE_ERROR_ON_OVERWRITING_SOURCE
(False
by default)
map_manager.set_elevation()
- A new function which superseeds the
create_hill
function as it can create hills and holes - Note:
elevation
is now the first argument, instead of the last - Deprecation warning to the
create_hill
function
- A new function which superseeds the
map_manager.terrain_2d
- A property which returns the map in a 2D list.
- Note: This is calculated for each request so it's recommended to call it once and store it
map_manager.get_tile_safe()
- Same as
get_tile
except it won't throw anIndexError
when the tile cannot be found.
Instead, it returnsNone
- Same as
- Datasets from the nitpicked pull: #18 (newtonerdai).
StartingAge
Civilization
ColorId
dataset for setting the player color in the player manager- The palisade gate to the building dataset (
BuildingInfo.PALISADE_GATE
) for disabling the palisade gate
- Datasets printed through a trigger content string can be individually customized
- Swapped incorrect
object_visible_multiplayer
andobject_selected_multiplayer
effect IDs - Issue with reading legacy scenarios that had units selected in effects
TechInfo.unique_techs
returning an empty list by default
- Renamed the
TerrainId.CORRUPTION
toTerrainId.VERY_EVIL_FOG
to resemble the actual in-game name. - BackEnd: Renamed the retriever:
player_names
totribe_names
to resemble the in-game input field label. - BackEnd: UUID functions have been moved to getters and actions modules
- Many structures in the structure files for future use. Nitpicked from pull: #18 (newtonerdai)
per_player_lock_civilization
lock_teams
allow_players_choose_teams
random_start_points
max_number_of_teams
per_player_base_priority
editor_camera_x & y
initial_camera_x & y
- Properly added a new structure from the 1.44 version update
per_player_population_cap
effect.selected_object_ids
got reset when usingtrigger_manager.get_content_as_string()
- Issue with reading certain scenarios which contained legacy bitmap images
- Issue where requesting TriggerManager content string would crash due to an unknown unit
Updated the minimum requirements to python 3.8 & Support for the new PUP September Scenarios!!
- Support for the new
1.44
scenario version in the current September PUP beta on steam. (Work in Progress) - A cheatsheet for the Map Manager link!
- Scenarios now have a
UUID
. This is used for easy access to information through the entire library.
This allowed the following:variable: 0
now shows as:variable: "NumberOfAttempts" (0)
trigger_id: 1
now shows as:trigger_id: "Move units" (1)
location_object_reference: 222
now shows as:location_object_reference: 1 unit: 0: Camel Rider [P1, X50.5, Y67.5] (222)
selected_object_ids: [21, 22]
now shows as:selected_object_ids: 2 units: 0: Berserk [P1, X65.5, Y74.5] (21) 1: Berserk [P1, X66.5, Y75.5] (22)
- New properties to the
TerrainTile
objectx
: Get it's X coordinatey
: Get it's Y coordinatexy
: Get a tuple of it's XY coordinatesi
: Get it's index
- New functions to the map manager:
get_tile(x=.., y=..)
orget_tile(i=..)
get_square_1d(x1, y1, x2, y2)
andget_square_2d(x1, y1, x2, y2)
Get a square of tiles in a 1D or 2D list.
unit_manager.get_new_reference_id()
will now pull from a number generator instead of searching the entire unit list.
- Functions
xy_to_i
andi_to_xy
having the x and y coordinate reversed. bidict
still being imported while not being a dependency anymore- Changing the map size linked all new terrain tiles to the same object
- Error being raised when importing
ProjectileInfo
TimeUnit
dataset valuesYears
andSeconds
being the wrong way around.
object_location_reference
attribute from thepatrol
effect as it doesn't work in game.
- Warning about python minimum requirement being moved from
3.6
to3.8
. - Setting to disable the python minimum requirement warning.
- Issue caused by referencing unit IDs not included in the datasets
- The XS Manager.
- Can be used to add XS to a script call effect. This way XS can be transfered between lobbies.
- Check out the XS cheatsheet here!
- A Hello World example for the parser. You can find it here.
__str__
functions toTriggerManaer
,Trigger
,Effect
andCondition
- You can now do:
print(trigger_manager)
instead ofprint(trigger_manager.get_content_as_string())
- You can now do:
- Value representations in
get_content_as_string()
. Shows dataset numerical values as dataset names.object_list_unit_id: 4
now shows as:object_list_unit_id: Archer (4)
technology: 12
now shows as:technology: Crop Rotation (12)
operation: 3
now shows as:operation: Subtract (3)
- Swapping coords when adding effects/conditions with
x1
>x2
ory1
>y2
+ warning about it. - 5 New functions to
TechInfo
(all with filter params). -- #31 (Alian713)blacksmith_techs()
university_techs()
monastery_techs()
town_center_techs()
eco_techs()
Age
dataset totrigger_lists
. -- #31 (Alian713)MAIN_CHARSET
andFALLBACK_CHARSET
to the settings.- Can be used to read scenario text in other charsets than the default
utf-8
andlatin-1
fallback.
- Can be used to read scenario text in other charsets than the default
- Typo -
SmartPorjectile
toSmartProjectile
- Missing several parameters for specific effects and conditions in
new_effect
andnew_condition
- Missing several attributes for specific effects and conditions when using
get_content_as_string()
effect.player_color
resulting in the wrong color when assigned usingPlayerId
orPlayerColorId
- Functions in
unit_manager
requiringPlayerId
. Just anint
is also possible now. - Issue with resizing the map.
- Issue with importing triggers that had activation effects referencing triggers that were not imported.
- The
script_name
(for XS scripts) attribute from theMapManager
to theXsManager
- The
BiDict
dependency from the entire project
Special thanks to Alian for his contribution to the datasets! <3
- Units, Buildings and Techs to the datasets. -- #30 (Alian713)
- Three new functions (Which all keep
(de)activate trigger
effects synced!)move_triggers(trigger_ids, insert_index)
function to theTrigger Manager
.reorder_triggers(new_id_order)
function to theTrigger Manager
.import_triggers(triggers, index)
function to theTrigger Manager
.
- Desync issues with
(de)activate trigger
effects when using any of the following functions:group_triggers_by
parameter incopy_trigger_tree_per_player
,append_after_source
parameter incopy_trigger
,remove_trigger
function.
GroupBy
mechanics when usingcopy_trigger_tree_per_player
function.
- The
append_after_source
parameter to thecopy_trigger
function. - The
add_suffix
parameter to thecopy_trigger
function. Decides if" (copy)"
is added to the name. - QOL feature for the creation of
Effects
andConditions
.- When not using
area_x2
andarea_y2
, they are set to the values ofarea_x1
andarea_y1
respectively. This makes selecting a single tile a little easier.
- When not using
- A list functions to the
TerrainId
dataset.water_terrains()
for all water terrains.beach_terrains()
for all beach terrains.tree_terrains()
for all tree terrains.
- A list function to the
OtherInfo
dataset.OtherInfo.trees()
for all tree objects.
- Projectiles dataset with
houfnice
andhussite wagon
projectiles.
- Multiple new issues with the famous
\x00
(end of line) character. - The
copy_trigger_per_player
andcopy_trigger_tree_per_player
functions. - Units and Techs in
UnitInfo
andTechInfo
dataset.
- Type checks from
UnitInfo
andTechInfo
filter functions. - The parameter
item_id
from thenew_effect
functions as it's unused in the editor.
Support for the new 51737 update!
Special thanks to Alian for his contribution with the datasets! <3
- Support for the new
1.43
scenario file version. - New Units, Buildings, Heroes etc. from the
51737
patch! -- #28 (Alian713) - Added
append_after_source
parameter tocopy_trigger
function.
filter_units_by_const()
function to the unit_manager. (check the docs for examples)PlayerId.all()
function. (check these docs for examples)
- All
TriggerManager
functions now accept anint
as well asTriggerSelect
.get_trigger(TS.index(i))
is now equal to:get_trigger(i)
.
- Docs with a link to the newly created Discord server!
- Fixed issue with
remove_effect
andremove_condition
in display order arrays. - Fixed issue with specific
modify_attribute
effect combination.
- Type validation in dataset functions. -- #25 (Alian713)
- Issue with creating modify_attribute effect.
- Alian713 as an author! The dataset wizard!
- Filters to dataset functions. -- #22 (Alian713)
CORRUPTION
and manyMODDABLE...
to theTerrainId
dataset. -- #24 (Alian713)
- Doc strings, error messages and type annotations for datasets. -- #24 (Alian713)
- Issue with order lists updating when directly removing items from the list (using
.pop()
or.remove()
) - Issue with reading
1.40
maps.
- Issue with converting
armour_attack_quantity
andarmour_attack_class
inside the parser. - Some missing attributes for the newly added effect and condition attribute.
- Issue with displaying
armour_attack_quantity
andarmour_attack_class
asNone
inget_content_as_string()
. - Issue with writing scenarios where
quality
was non truthy but notNone
.
- Support for the old
1.36
scenario file version. (Used for many campaign scenarios) - Colourful print statements!
- Warnings for certain situations.
- Issue with the
quantity
field with the effectModify Attribute
when choosing attributeAttack
orArmor
. - Issue in manager construction phase while loading older scenarios.
- Issue with when committing
RetrieverObjectLink
withsupport
attribute.
Only useful if you're working with the 'sections' parts of the parser:
- The
armour_attack_quantity
andarmour_attack_class
fields have been removed from the sections (structure file). They are still available in the effect object, and are split using bitwise operations in theEffect
object itself.
- Issue with adding effects to any trigger Issue #21.
Support for the new 50292 update!
- Support for the new
1.42
scenario file version. - The new attribute for conditions:
object_state
(Used inobjects_in_area
) - The new
ChangeColorMood
effect (trigger.new_effect.change_color_mood(...)
). - The
ColorMood
andObjectState
dataset.
More datasets! Including some from the newest 47820 update!
- The
HOTKEY_ID
property to theUnitInfo
,BuildingInfo
,HeroInfo
andTechInfo
.
Example:UnitInfo.ARCHER.HOTKEY_ID
. Or:UnitInfo.from_hotkey_id(...)
- The
Hotkey
dataset. These values can be used for static key assignments. - The
HeroStatusFlag
dataset. UseHeroStatusFlag.combine(...)
for combinations in the dataset. - The
BlastLevel
dataset. - The
DamageClass
dataset. (Credits: Alian713) - The
ProjectileInfo
dataset. Thanks Alian713!
- Removed
location_object_reference
from theChange View
effect. - Trigger docs not updated with the new
UnitInfo
dataset. Unit.name()
when a unit wasn't present in the datasets. Thanks newtonerdai!- The ID for
FARMING_GOLD_TRICKLE
from 235 to 236. - A typo
TechInfo.FELMISH_REVOLUTION
toTechInfo.FLEMISH_REVOLUTION
- Renamed ObjectAttribute
ICON_GRAPHICS_ANGLE
toGRAPHICS_ANGLE
. - Renamed all
area_1_x
attributes toarea_x1
. Same goes for:area_1_y
,area_2_x
,area_2_y
. - BACKEND - retrievers attribute on sections has been swapped out for retriever_map.
It's now adict
instead of alist
with the retriever name as keys. Reason: Improve performance.
- Several speed improvements
- Hint in exception message when it was clearly not the cause of the error.
- A typo in the condition dataset
OBJECT_IN_AREA
toOBJECTS_IN_AREA
. - Unit docs not updated with the new
UnitInfo
dataset - Issue #12.
- Functions to the
UnitInfo
andTechInfo
dataset.UnitInfo.vils()
for all villagers (Male/Female and all their professions).UnitInfo.unique_units()
for all unique units (Both castle and non castle unique units).TechInfo.unique_techs()
for all unique technologies.
- Error messages when accidently setting a value to
UnitInfo.ARCHER
instead ofUnitInfo.ARCHER.ID
(as an example).
- A recursion issue with the
copy_trigger
related functions - Issue #10
- An issue which renamed all variables to: "VariableStruct" - Issue #9
- The datasets
UnitInfo
,BuildingInfo
,HeroInfo
,TechInfo
andOtherInfo
replace the following datasets:- UnitId, GaiaUnitId, UnitIcon and GaiaUnitIcon
- BuildingId, GaiaBuildingId and BuildingIcon
- HeroId, HeroIcon
- TechId
- UnitOtherId, GaiaUnitOtherId
- The
ButtonLocation
dataset has changed it's properties.- From:
LOCATION_<C>_<R>
(<C>
= Column number,<R>
= Row number) - To:
r<R>c<C>
- Example (Row 1, col 4):
- Old:
LOCATION_3_0
. Old numbering started from 0. - New:
r1c4
. New numbering starts from 1.
- Old:
- From:
Please check the datasets cheatsheet page or the readthedocs dataset page on how to use the new datasets.
- An issue with
\x00
suffixes
- An issue looking up the
.json
files on non-windows machines.
- An issue with relative directories when accessing
.json
structure files.
- An issue with pip not uploading non
*.py
files.
- Issue with pip not finding the packages due to removing
__init__.py
in0.1.0
- Renamed
amount_or_quantity
toquantity
in conditions for consistentcy with effects. - Renamed
resource_type_or_tribute_list
toattribute
in conditions. - Renamed
variable_or_timer
totimer
in effects because it wasn't used for variables. - Renamed
from_variable
tovariable
in effects for consistentcy with conditions. - Renamed
enabled_or_victory
toenabled
in effects.
IMPORTANT NOTICE: A lot about the library has changed internally. Switching from 0.0.20
to 0.1.0
should only require you to implement a couple of important changes.
Click the link on the line above to find said changes. If you find any bugs please report them on github.
SPEED: This release should improve average reading and writing speed. Some tested scenarios had a read speed improvement of over 15x when using large AI or other text files. Average reading time will be around 20 to 40 percent faster. Writing time has increased significantly too. Maps with large amount of data have around 700% (7x faster) increase in writing time!
These changes were in the works for 0.0.21
but got merged into the 0.1.0
relesase.
- All villagers to the
Unit
dataset as:VILLAGER_<SEX>[_<PROFESSION>]
- A handful of other units to the
Unit
dataset
- Renamed
FLEMISH_MILITIA_M
andFLEMISH_MILITIA_F
toFLEMISH_MILITIA_MALE
andFLEMISH_MILITIA_FEMALE
- The old names used for villagers (e.g.
BUILDER
orHUNTER
). (These were male only) - The BiDict variable
unit_names
, because the same effect can be achieved using the.name
attributes in the dataset. - The
scenario.create_default()
function.
- Issue with reading a very rare scenario file header. Usage of the difference is unknown.
- Issue with reading the xs script content that was saved to the scenario.
- Some small effect fields to no longer be set in a list when they were single ints.
- Flemish Militia ID in dataset
Unit
andUnitIcon
- IDE autocomplete finding variables with similar names to the Enums
- Icon datasets for
Units
,Heroes
andBuildings
(Credis: Alian713) TerrainRestrictions
dataset (Used forObjectAttribute.TERRAIN_RESTRICTON_ID
, it defines where units can be placed/walk on) (Credis: Alian713)- The new
Techs
,Units
andBuildings
added in the new 44725 update.
Support for the new update!
- Support for the new version
1.41
(Version1.40
is still supported)
Please note that work on reading and versions is still being worked on.
- Issue with reading bitmap image with certain sizes
- Support for bitmap images (Can't be seen, used (or removed) in DE but crashed the parser if present)
- Support for legacy codec
latin-1
(Voobly converted maps). Please note that all text will be written back intoutf-8
when writing a new file. - Units to the units dataset (Credis: Alian713)
- Many Attribute ID names and their description and usages. (Credits: Alian713)
- Error while trying to debug a map with non ASCII characters
- Reading errors with specific uncommon attributes
- Changed parameter
unit_id
tounit_const
in theadd_unit
function
- Support for AI files. Since the latest update (42848) AI files are (sometimes) stored differently
- HTML file with byte structure (Download to view file. Does not contain JS. Just HTML & CSS)
- Issue with rotation on objects. Mostly affecting cliffs, certain tree types and other rotatable objects
- Issue introduced in
0.0.12
Support for the new update!
Important notice: This version does not support older versions of the scenario files. This is temporary due to the amount of changes from the newest version (Update: 42848), sorry for the inconvience.
When loading a map from an older version, instructions will be provided for downgrading this library or updating the scenario to the newest version.
create_hill
function to the map_manager (Credits: pvallet)- [Update 42848]
script_name
(xs file) to the MapManager - [Update 42848] The new effects!!
Set Building Gather Point
Script Call
Change Object Player Color
Change Object Civilization Name
Change Object Player Name
Disable Unit Targeting
Enable Unit Targeting
Change Technology Cost
Change Technology Research Time
Change Technology Name
Change Technology Description
Enable Technology Stacking
Disable Technology Stacking
Acknowledge Multiplayer AI Signal
Disable Object Selection
Enable Object Selection
- [Update 42848] The new conditions!!
Script Call
Object Visible (Multiplayer)
Object Selected (Multiplayer)
Object has Action
OR
Multiplayer AI Signal
- [Update 42848]
UnitAIAction
dataset AttackStance
dataset
- [Update 42848] The new architecture set feature
- [Update 42848] script (xs) file path at the end of the file
- Defaults for the
create_default()
function when dealing with inconsistent structs
- Adding a trigger with extra arguments will now work properly (Example:
.add_trigger("name", description="desc")
) - Adding a condition with extra arguments will now work properly (Example:
.add_condition(Cond.TIMER, timer=20)
) - The 'Fix' in version
0.0.11
for the lazy loading of effect and condition display orders wasn't working properly. Now it is.
number_of_units_selected
as an attribute for effects. This is now dealt with internally.
- Optional arguments for
create_trigger
function (all trigger parameters except for it's internal ID) - Optional arguments for
add_condition
function (all condition parameters) - Optional arguments for
add_effect
function (all effect parameters)
- Performance:
- Writing the file, combining strings using
str.join(list)
instead ofstr += str
- Reusing structs when reconstructing where possible, instead of overwriting all of them.
- Not initialising RetrieverDependencies for every retriever. Using references instead.
- Reworked the eval functions to direct code, huge performance boost
- Removed unnecessary DependencyAction objects creation (From ~500.000 to ~100)
- Changed trigger display order, condition display order, effect display order attribute to lazy load
- Writing the file, combining strings using
- The
AoE2Scenario.create_default()
function. (Incorrect defaults caused the file to corrupt)
- The effect attribute
selected_object_id
toselected_object_ids
to indicate the use of a list.
- The
location_object_reference
property for effects. Used for targeting an object as location. For example in theTaskObject
effect.
- The
AoE2Scenario.create_default()
function. (Defaults from structs weren't actually used in the parent Pieces)
- All
copy_trigger
related functions take very long to copy per player.
Important notice: The way you read your main file changed. It is now:
AoE2Scenario.from_file(filename) # Just add ".from_file". Nothing else changed :)
Also, there has been a massive change to the 'back' portion of the project. If you used this directly, you might need to change quite some code. Sorry :(. If you've got any questions, feel free to reach out. Also, if you encounter any bugs, especially in the new system, please report them! Thanks in advance! <3
remove_condition()
andremove_effect()
to TriggerObjectget_condition()
andget_effect()
to TriggerObject- The index and display index to the
trigger.get_content_as_string()
- Four very powerful trigger features! Please check the readthedocs Documentation API, or the function docstrings for the how-to.
copy_trigger
copy_trigger_per_player
copy_trigger_tree
copy_trigger_tree_per_player
replace_player
commit()
function to objects. This will commit the changes to the piece structure. This is also done for all objects automatically when writing the file.- Every object now has
RetrieverObjectLink
objects to represent how to retrieve and commit their data. (These objects also have a commit function, which are called using the objects commit function) - The possibility to create a scenario from SCRATCH due to all pieces having default values now! No need for a 'base' scenario file from the game itself! You can achieve this like so:
AoE2Scenario.create_default()
! - A
TriggerSelect
object. Used to identify a trigger in the trigger_manager functions. Alias:TS
. Use Alias + class methods (factory methods) for ease of access:TS.index(3)
,TS.display(1)
andTS.trigger(trigger)
. - A
TriggerCELock
object. Used to define which (or all) conditions and effects should be locked while copying/changing players. - A
GroupBy
Enum. For selecting the way triggers are grouped after creating them viacopy_trigger_tree_per_player
. You can choose fromNONE
(default),TRIGGERS
andPLAYERS
. - A Very much WIP Documentation API
- the
layer
property for terrain tiles. Used for layering terrain types.
- The way a file is read is now done using:
AoE2Scenario.from_file(filename)
. Nothing changed - just add ".from_file" between the class and the brackets :) - Within the library the use of
\x00
character for line endings is no longer a necessity.- This mainly affects checking names: (eg.
trigger.name == "name\x00"
) (Credits: Alian713)
- This mainly affects checking names: (eg.
- The parameter
trigger_id
has been renamed totrigger_index
in all functions in TriggersObject (trigger_manager) - Renamend
Operator
toOperation
. - Managers can now be accessed directly from the scenario. Eg:
scenario.trigger_manager
. - Renamed
player
attribute in theCondition
object tosource_player
- Renamed
player_source
attribute in theEffect
object tosource_player
- Renamed
player_target
attribute in theEffect
object totarget_player
- Renamed
find_retriever
function toget_retriever_by_name
- Renamed all retriever names to be lowercase underscored (Credits: pvallet)
- Progress print statements now replace their current line. So instead of using 2 lines per piece it's now 1.
- Most trigger_manager functions now require the new
TriggerSelect
object instead of 3 parameters for trigger selection. Read the docstring for more detail.
- Bug causing the local
trigger_id
attributes to be out of sync when removing triggers. - Bug causing the
ValueError
to not get raised when trying to construct a piece with invalid data length. - Bug causing
Conditions
andEffects
not to show in 'get_as_string' functions when set directly using:trigger.effects = [...]
- Bug causing a crash when
selected_object_id
inEffects
held a single ID. - Bug causing a crash when setting
selected_object_id
to an uniterable object. (Like an int instead of List[int]) - Bug causing Variables to not show up when no triggers were present when using the
get_summary_as_string
in the trigger_manager. - Bug making it impossible to set unit IDs negative. (Supported by the game)
- Typo in Condition dataset "OWH" to "OWN" in
OWH_FEWER_OBJECTS
. - Typo in Terrain dataset "MAGROVE" to "MANGROVE" in
FOREST_MAGROVE
.
- Outdated examples
- The
ai_script_goal
effect. - The
difficulty_level
condition. - The
new_unit_id_to_place
field in theDataHeader
is updated in the reconstructing phase. - VariableObject:
{id: ..., name: ...}
. - Variable info to
get_content_as_string
andget_summary_as_string
functions from the trigger_manager. get_variable(id or name)
function to the trigger_manager.- Defaults to all
effects
&conditions
. (In-Game Editor defaults) - PlayerColor Enum.
PlayerColor.PURPLE
. - The ability to remove units using
unit_mamager.remove_unit(unit=... or reference_id=...)
. - The abiltiy to remove a trigger using an object reference:
trigger_manager.remove_trigger(trigger=...)
. Hero
dataset (Credits to T-West for the hero name list)get_enum_from_unit_const
functionGaiaBuilding
andGaiaUnit
dataset (Like normal Building and Unit dataset but also includes Gaia only buildings & units)- Datasets for (All?) dropdown lists in conditions and effects.
DiplomacyState
Operator
ButtonLocation
PanelLocation
TimeUnit
VisibilityState
DifficultyLevel
TechnologyState
Comparison
ObjectAttribute
Attribute
- Code Block - Added code block for adding KOTH + Regicide to any map with (exactly) one monument - Using triggers. This code block adds close to 600 triggers for displaying all years, displaying players holding the monument and victory & defeat conditions.
ChangedVariableStruct
toVariableStruct
.- UnitObject attribute
unit_id
renamed tounit_const
. (Credit: T-West) - Effects and Condition constants are now
IntEnum
s. (ie.Effect.CREATE_OBJECT
) - Units, Buildings, Techs and Terrains are now
IntEnum
s. (ie.Unit.MAN_AT_ARMS
) - Renamed
delete_trigger
function toremove_trigger
. - Renamed
trigger_data
attribute totriggers
- Reading and Writing UTF-8 instead of ASCII characters. (The game might not support all characters everywhere)
Snow
,Ice, Navigable
,Beach, Ice
in Terrain dataset. (Fixed in game)
get_new_reference_id()
returnshighest_id + 1
instead ofhighest_id
.- Bug removing all
Trigger
names. - Bug causing
Trigger display order
to be incorrect. Wasn't breaking scenarios as the in-game editor was able to handle it properly and fixed it when saving from there. Only caused the Parser from being able to read the file.
- The default attributes in
Condition
andEffect
constructors. - The
get_triggers
function. It was redundant as it's equal to the following:- 0.0.6:
trigger_manager.trigger_data
- 0.0.7:
trigger_manager.triggers
- 0.0.6:
- UnitsObject and UnitObject reconstruct support (AKA: Made Usable).
- Check the cheatsheets on Github edit Scenario.
- Player Enum.
- Tile object.
- Logging options for Reading, Parsing, Reconstructing and writing.
- Bidict for units, buildings and techs dataset.
pretty_print_name
to the Helper (Credits: T-West).
VariableChangeStruct
toVariableStruct
.- The object_manager function
get_x_object
tox_manager
. - Some
__repr__
and__str__
are now more readable