Mr. Spiffy
Chieftain
My situation is this: I have a custom civilization that throws the player into rebellion if they are not in a golden age. Since staying in a golden age can be difficult or impossible in the early game, I made a custom unit that grants a golden age. While this unit might eat up a lot of production early game, by the end or middle of the game, the cost would be trivial. This would make it simple to stay in a golden age without devoting much to it.
With this problem, the obvious solution is to make the unit's cost go up or golden age turns go down based on the era or turns passed. I can use GetCurrentEra() for the era check, but I'm not sure how to alter the production of a certain unit.
This led me to try changing the golden age modifier based on the number of golden ages a player has had. I ran into a wall, however, when I figured out that GetNumGoldenAges() only increased every time a golden age started and ended. It doesn't count golden ages that are triggered in the middle of a golden age. Could I perhaps use ChangeNumUnitGoldenAges()? I'm sure what that method even does.
I've just started using lua days ago, so I'm sure there's a solution here that I'm not able to see in my inexperience. I would greatly appreciate it if someone were to point me in the right direction with solving this problem. Anything that would make this unit harder to obtain based on the era will work for me.
With this problem, the obvious solution is to make the unit's cost go up or golden age turns go down based on the era or turns passed. I can use GetCurrentEra() for the era check, but I'm not sure how to alter the production of a certain unit.
This led me to try changing the golden age modifier based on the number of golden ages a player has had. I ran into a wall, however, when I figured out that GetNumGoldenAges() only increased every time a golden age started and ended. It doesn't count golden ages that are triggered in the middle of a golden age. Could I perhaps use ChangeNumUnitGoldenAges()? I'm sure what that method even does.
I've just started using lua days ago, so I'm sure there's a solution here that I'm not able to see in my inexperience. I would greatly appreciate it if someone were to point me in the right direction with solving this problem. Anything that would make this unit harder to obtain based on the era will work for me.