Home › Lua API › MapResourceBuilder
Available out of the box. Usable from Lua in the unmodified game.
MapResourceBuilder
5 methods. Symbol/current columns are function addresses (RVA) of the native wrapper.
Signatures are recovered from the game code. ⚠ = partly understood (arguments may be missing or approximate). ? after a name = optional argument. Types: integer/number are Lua numbers, enum-typed arguments show the C++ type in brackets. Two signatures mean the method is registered separately for the UI and the gameplay state and each wrapper was decoded on its own. "same code as" in the Symbol column means the compiler merged identical functions: those methods share one wrapper and cannot be told apart by address.
| Method |
Signature |
Where |
Reference |
Symbol |
Current |
| CanHaveResource |
MapResourceBuilder:CanHaveResource(arg1: integer) → boolean args: arg1 — A Plot object (the scripts pass a variable named pPlot). |
gameplay |
— |
0x1f8e0 |
0x1fdd0 |
| ChangeResourceCount |
MapResourceBuilder:ChangeResourceCount(iChange: integer) (or nothing) |
gameplay |
— |
0x1f980 |
0x1fe70 |
| GetAdjacentResourceCount |
MapResourceBuilder.GetAdjacentResourceCount() → number |
gameplay |
— |
0x1f9e0 |
0x1fed0 |
| SetResourceCount |
MapResourceBuilder:SetResourceCount(iAmount: integer) (or nothing) |
gameplay |
— |
0x1faf0 |
0x1ffe0 |
| SetResourceType ★ |
MapResourceBuilder:SetResourceType(eNewType: integer[ResourceTypes], iAmount: integer) (or nothing) args: eNewType — Index of a row of the Resources table (the value of GameInfo.Resources[...].Index). |
gameplay |
— |
0x1fb60 |
0x20050 |
Notes (★)
SetResourceType
Places a resource of a given type on a plot, with an amount.
- Civ6-GCO calls it as ResourceBuilder.SetResourceType(plot, resourceID, count) with a randomised count on turn one. That matches the recovered iAmount parameter: the last argument is the number of resource units on the plot, not a flag.
[inferred; evidence: community-reference — Civ6-GCO Scripts/GCO_GameScript.lua:130; third-party mod Civ6-GCO (Gedemon, 2021), not a Firaxis script]