Home › Dev CE (experimental) › GameReligion
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.
GameReligion
3 methods (Dev CE test build). this is found with the game's own IGameReligion instance resolver (virtual).
| Method |
Signature |
Purpose (AI-written, inferred) |
Tested |
Engine function |
Current |
| AddUnit |
GameReligion:AddUnit(eReligion: integer, eUnit: integer) |
Appends a unit type to the religion's data vector at offset 0x60 (a list of units tied to that religion). |
plumbing ✓ |
— |
0x242530 |
| DoTurn |
GameReligion:DoTurn() |
Per-turn religion update: among players that have not yet created a pantheon, picks the one with the highest value at offset 0xb0 of their religion object and stores it in the field at +0xf0. |
plumbing ✓ |
— |
0x2429f0 |
| UpdateNextReligionForCities |
GameReligion:UpdateNextReligionForCities() |
Iterates every player's cities and calls RecomputeNextReligion on each city's religion component. |
plumbing ✓ |
— |
0x243ce0 |
Details
AddUnit
Arguments: eReligion — religion to edit; eUnit — unit type appended to the religion's list
Writes
- ReligionData vector at +0x60 (push_back of the unit type)
Input checks: Null check on the ReligionData from EditReligion; no range check on unit type and no duplicate check.
Multiplayer: may-desync, modifies shared religion data. Risk: medium (Writes game-state vector; vector element type shown as TechTypes in decompile but argument is UnitTypes). Confidence of the reading: medium.
DoTurn
Writes
- Religion field at +0xf0 (selected player id, reset to -1 first)
Input checks: Skips players that already created a pantheon and the player held in +0x100; no external input.
Multiplayer: may-desync, writes synchronised religion state each turn. Risk: medium (Writes tracked variable derived from all players). Confidence of the reading: low.
UpdateNextReligionForCities
Writes
- Each city's religion data (next religion recomputed)
Side effects
- Edits city variant maps via edit()
Input checks: None; iterates all players in the manager list.
Multiplayer: may-desync, rewrites city religion state. Risk: medium (Touches every city). Confidence of the reading: medium.