Resource icon

Dom Pedro II's Mod Helper 2016-10-05

Dom Pedro II's Mod Helper v0.3
or How I learned to stop worrying and love Python

WHAT IT DOES: This mod component does not change gameplay. It is specifically to make the lives of modders who can use python easier, and give them greater power over the code.

This code takes the system used for calling python methods for Events and expands it to other areas of the game. Modders can attach new python methods to units, promotions, specialists, buildings, civics, civilizations, leaders, religions and more in the XML that will be read from python. This allows players to create small, self-contained python methods that are executed at the appropriate time without complicated checks in python.

With this mod component, you will be able to have specialists give the same benefits as buildings, allow Wonders all the effects of Civics, and virtually any other possible combination. You can have buildings that automatically spawn units in regular intervals, and much much more. Many of the SDK functions that were previously not exposed to python have now been exposed so modders can use the new system to its full potential.

Enclosed is also a tutorial that will help modders get an idea of how to properly use this mod component and explain exactly what has been added.

Changes v 0.3:

Added new code to allow for easy scripting of new Action Buttons

Added CIV4ActionButtonInfos.xml

Updated Tutorial

Changes v 0.2:

Added <PythonAIWeight> tag to UnitInfos, PromotionInfos, BuildingInfos, CivicInfos, ReligionInfos, SpecialistInfos.

Added <iAIWeight> to PromotionInfos, ReligionInfos, and SpecialistInfos

Added new tags to CIV4EventTriggerInfos.xml:

<TriggerImages> - Allows for random, era-specific images be displayed with the event popup
<TriggerSounds> - Allows for random, era-specific sounds to play with the event popup

<PrereqOrEvents> - Prerequisite OR Events allows either/or event prerequisites

<PythonProbability> - Allows modders to have the probability of
<PythonCityTriggerValue> - Gives modders control over what criteria makes a city better or worse for a trigger... allows more fine tuning beyond the existing PythonCanDoCity tag
<PythonPickBuilding> - Select a building based on any criteria rather than letting the computer randomly pick one.
<PythonPickCivic> - Select a civic
<PythonPickBonus> - Select a bonus based on any critiera
<PythonPickReligion> - Select a religion based on any criteria
<PythonPickCorporation> - Select a corporation based on any criteria
<PythonPickCulture> - Select a particular culture (i.e. Player) in a particular city
<PythonPickOtherPlayer> - Select other player based on any criteria rather than being randomly selected by the computer
<PythonPickTech> - Select a tech
<PythonText> - Can create display text dynamically.

Added new tags to CIV4EventInfos.xml

<PythonText> - Dynamic display text for the event popup buttons
<PythonGold> - Dynamically set gold cost/reward
<PythonBestTech> - Choose a tech to be awarded
<PythonBestCivic> - Choose a civic to switch to
Dom Pedro II
First release
Last update
4.00 star(s) 3 ratings

More resources from Dom Pedro II

Top Bottom