I've been working on a large-scale project but I've been stumbling across alot of hurdles.
One that has me stumped is that I'm trying to add a behind-the-scenes check to determine how many of the player's Cities are adjacent to Rivers (this is specifically for a display to show how much Happiness the player is receiving from the Sacred Waters pantheon (or any of a similar effect).
Here's what I've got right now:
The code in the "..." doesn't really matter (it doesn't affect what I've got one way or the other). While what's here technically works, it also increments for cities not adjacent to Rivers, and I need it to only increment for cities adjacent to Rivers. Thoughts?
I've got this code is embeded in the Happiness section of the TopPanel code, in case you needed that clarification.
One that has me stumped is that I'm trying to add a behind-the-scenes check to determine how many of the player's Cities are adjacent to Rivers (this is specifically for a display to show how much Happiness the player is receiving from the Sacred Waters pantheon (or any of a similar effect).
Here's what I've got right now:
Code:
local pCityPlot = pPlayer:GetCityByID():Plot();
local iCountRiverPlots = 0;
...
for pCity in pPlayer:Cities() do
...
if (pCityPlot:IsRiver()) then
iCountRiverPlots = iCountRiverPlots + 1;
end
...
end
I've got this code is embeded in the Happiness section of the TopPanel code, in case you needed that clarification.
Last edited: