TheOneHitPupper
Chieftain
- Joined
- Jun 15, 2017
- Messages
- 98
There is no column or table under Resolutions that would grant the player a building once a resolution is passed/repealed. I've tried to make a workaround through lua but can't get it to work. This is what I have so far:
I see that the script is being loaded in-game, but the GameEvent isn't firing correctly.
My goal is to have a dummy building given to players once the Nuclear Non-Proliferation Treaty resolution is passed. This dummy building will bar the player and AI to build Enrichment Facilities in the future.
Code:
local NukeResolution = GameInfoTypes.RESOLUTION_NUCLEAR_NON_PROLIFERATION
local iEnrichmentFacility = GameInfoTypes.BUILDING_ENRICHMENT_FACILITY_DUMMY
print("GrantBuilding Function")
function ResolutionPassed(iResolution, iChoice, bEnact, bPassed)
if NukeResolution then
if bEnact and bPassed then
pCity:SetNumRealBuilding(iEnrichmentFacility, 1)
print("Adding in the Non-Proliferation Building function.")
end
if not bEnact and bPassed then
pCity:SetNumRealBuilding(iEnrichmentFacility, 0)
print("Removing the Non-Proliferation Building function.")
end
end
end
GameEvents.ResolutionResult.Add(ResolutionPassed)
I see that the script is being loaded in-game, but the GameEvent isn't firing correctly.
My goal is to have a dummy building given to players once the Nuclear Non-Proliferation Treaty resolution is passed. This dummy building will bar the player and AI to build Enrichment Facilities in the future.