Skip to content

Harmony patches

algernon-A edited this page Jul 18, 2022 · 11 revisions

Realistic Population Revisited currently uses Harmony 2.1 to deploy the following patches:

BuildingAI

BuildingAI.EnsureCitizenUnits

ushort buildingID, ref Building data, int homeCount, int workCount, int visitCount, int studentCount

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and aligns building capacities with the mod's settings. The biggest single difference from the base method is that this patch also provides for reducing household counts.

CityServiceWorldInfoPanel

CityServiceWorldInfoPanel.OnSetTarget

ushort buildingID, ref Building data, int crimeAccumulation, int citizenCount

This is a Postfix patch with standard priority.

It is always applied when the mod is running and toggles the Realistic Population building info panel button visibility (showing it when schools are selected and hiding it otherwise).

CommercialBuildingAI

CommercialBuildingAI.CalculateProductionCapacity

ItemClass.Level level, Randomizer r, int width, int length

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's production capacity settings.

CommercialBuildingAI.CalculateVisitplaceCount

ItemClass.Level level, Randomizer r, int width, int length

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's visitplace settings.

CommercialBuildingAI.CalculateWorkplaceCount

ItemClass.Level level, Randomizer r, int width, int length, out int level0, out int level1, out int level2, out int level3

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's workplace settings.

CommercialBuildingAI.GetConsumptionRates

ItemClass.Level level, Randomizer r, int productionRate, out int electricityConsumption, out int waterConsumption, out int sewageAccumulation, out int garbageAccumulation, out int incomeAccumulation, out int mailAccumulation

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's consumption settings.

CommercialBuildingAI.GetPollutionRates

ItemClass.Level level, int productionRate, DistrictPolicies.CityPlanning cityPlanningPolicies, out int groundPollution, out int noisePollution

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's pollution settings.

CommercialBuildingAI.ModifyMaterialBuffer

This is a Transpiler.

It is always applied when the mod is running and implements a fix to a base-game bug whereby incoming goods amounts can overflow and wrap-around to zero.

CommercialBuildingAI.SimulationStepActive

This is a Transpiler.

It is always applied when the mod is running and implements the mod's inventory re-order maximum.

CommonBuildingAI

CommonBuildingAI.HandleCrime

ushort buildingID, ref Building data, int crimeAccumulation, int citizenCount

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's crime accumultion settings.

IndustrialBuildingAI

IndustrialBuildingAI.CalculateProductionCapacity

ItemClass.Level level, Randomizer r, int width, int length

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's production capacity settings.

IndustrialBuildingAI.CalculateWorkplaceCount

ItemClass.Level level, Randomizer r, int width, int length, out int level0, out int level1, out int level2, out int level3

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's workplace settings.

IndustrialBuildingAI.GetConsumptionRates

ItemClass.Level level, Randomizer r, int productionRate, out int electricityConsumption, out int waterConsumption, out int sewageAccumulation, out int garbageAccumulation, out int incomeAccumulation, out int mailAccumulation

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's consumption settings.

IndustrialBuildingAI.GetPollutionRates

ItemClass.Level level, int productionRate, DistrictPolicies.CityPlanning cityPlanningPolicies, out int groundPollution, out int noisePollution

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's pollution settings.

IndustrialExtractorAI

IndustrialExtractorAI.CalculateProductionCapacity

ItemClass.Level level, Randomizer r, int width, int length

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's production capacity settings.

IndustrialExtractorAI.CalculateWorkplaceCount

ItemClass.Level level, Randomizer r, int width, int length, out int level0, out int level1, out int level2, out int level3

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's workplace settings.

IndustrialExtractorAI.GetConsumptionRates

ItemClass.Level level, Randomizer r, int productionRate, out int electricityConsumption, out int waterConsumption, out int sewageAccumulation, out int garbageAccumulation, out int incomeAccumulation, out int mailAccumulation

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's consumption settings.

IndustrialExtractorAI.GetPollutionRates

ItemClass.Level level, int productionRate, DistrictPolicies.CityPlanning cityPlanningPolicies, out int groundPollution, out int noisePollution

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's pollution settings.

OfficeBuildingAI

OfficeBuildingAI.CalculateProductionCapacity

ItemClass.Level level, Randomizer r, int width, int length

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's production capacity settings.

OfficeBuildingAI.CalculateWorkplaceCount

ItemClass.Level level, Randomizer r, int width, int length, out int level0, out int level1, out int level2, out int level3

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's workplace settings.

OfficeBuildingAI.GetConsumptionRates

ItemClass.Level level, Randomizer r, int productionRate, out int electricityConsumption, out int waterConsumption, out int sewageAccumulation, out int garbageAccumulation, out int incomeAccumulation, out int mailAccumulation

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's consumption settings.

OfficeBuildingAI.GetPollutionRates

ItemClass.Level level, int productionRate, DistrictPolicies.CityPlanning cityPlanningPolicies, out int groundPollution, out int noisePollution

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's pollution settings.

PrivateBuildingAI

PrivateBuildingAI.BuildingUpgraded

This is a Postfix patch with standard priority.

It is always applied when the mod is running to implement any reductions in homecounts when a building upgrades.

ResidentialBuildingAI

ResidentialBuildingAI.CalculateHomeCount

ItemClass.Level level, Randomizer r, int width, int length

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's household count settings.

ResidentialBuildingAI.GetConsumptionRates

ItemClass.Level level, Randomizer r, int productionRate, out int electricityConsumption, out int waterConsumption, out int sewageAccumulation, out int garbageAccumulation, out int incomeAccumulation, out int mailAccumulation

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's consumption settings.

ResidentialBuildingAI.GetPollutionRates

ItemClass.Level level, int productionRate, DistrictPolicies.CityPlanning cityPlanningPolicies, out int groundPollution, out int noisePollution

This is a Prefix patch with standard priority that preempts the original method (returns false from the Prefix method).

It is always applied when the mod is running and implements the mod's pollution settings.

#SchoolAI ###SchoolAI.StudentCount getter This is a Prefix patch with standard priority that may or may not preempt the original method (can return either true or false from the Prefix method).

It is always applied when the mod is running and implements the mod's custom school student population settings if enabled (in which case the patch returns false, pre-empting the original method). If the mod's custom school settings are not applied to this school prefab, the patch will do nothing and return true, handling control over to the original method.

ZonedBuildingWorldInfoPanel

ZonedBuildingWorldInfoPanel.UpdateBindings

This is a Postfix patch with standard priority.

It is always applied when the mod is running and adds display of visitor count numbers and capacities to commercial building info panels.

Clone this wiki locally