Home › Dev CE (experimental) › UnitReligion
Experimental: needs Dev CE (
fork of the Community Extension, release zip and source). A GameCore that adds these Lua methods by calling engine functions directly. Not part of the upstream Community Extension, single-player testing only. Descriptions on these pages were written by an AI assistant from decompiled code and are marked inferred unless a test result confirms them.
UnitReligion
2 methods (Dev CE test build). this is found with the game's own IUnitReligion instance resolver (plain).
| Method |
Signature |
Purpose (AI-written, inferred) |
Tested |
Engine function |
Current |
| ChangeInitiationYieldPopulation |
UnitReligion:ChangeInitiationYieldPopulation(eYield: integer, iPopulationAmount: integer) |
Adds or removes an entry (yield type, population amount) in the unit's list of initiation yield populations. Positive amounts append an entry, negative amounts remove one matching entry. |
plumbing ✓ ran ±1, reversible ✓, no visible effect |
Unit::Religion::ChangeInitiationYieldPopulation |
0x3b2890 |
| GetInitiationYieldPopulation |
UnitReligion:GetInitiationYieldPopulation(eYield: integer) → number |
Sums the second value of all (yield, amount) pairs in a vector at +0x40 whose yield matches the argument. |
plumbing ✓ |
— |
0x3b2a60 |
Details
ChangeInitiationYieldPopulation
Arguments: eYield — yield type; iPopulationAmount — amount; positive appends, negative removes the same positive entry
Writes
- vector of (yield, amount) pairs at this+0x40..0x50
Side effects
- allocates temporary copy for removal
Input checks: Zero amount does nothing.
Preconditions
- gameplay state
Multiplayer: may-desync: direct state change. Risk: low (simple vector edit). Confidence of the reading: medium.
Verified from the code
- positive: push_back (yield, amount)
- negative: rebuilds vector omitting entries with same yield and amount equal to the negated value (all matching ones, not just one)
- zero: no change
Inferred
- entries are consumed when the unit initiates a religious action (from name)
Open questions
- what consumes the list
GetInitiationYieldPopulation
Arguments: eYield — Yield type to sum for
Input checks: No range check; linear scan.
Multiplayer: read-only; getter. Risk: low (pure getter). Confidence of the reading: medium.