Free Culture

Moriboe

King
Joined
Nov 30, 2010
Messages
662
Location
Belgium
I wrote a little lua script that allows for buildings to receive a sum of culture upon completion, based on certain conditions. I applied the concept to 2 wonders; the first by Pouakai and sukritact, the second my own:

  • Terracotta Army: grants 30 culture per military unit in your service.
  • Mass Games: grants 400 culture for every citizen past size 20 in the city where the wonder was built.

Download it here.

For the changes to the Terracotta Army to apply:
1. Download and install the Terracotta Army mod by Pouakai and sukritact, if not done so already.
2. Exit. Clear the game cache. Move all mods out of the Mods folder.
3. Move the Terracotta Army mod back in and activate it ingame.
4. Move the FreeCulture mod back in and activate it ingame.​

By the way the secondary effects of the wonders are inspired by Pouakai & sukritact's work :)
 

Attachments

  • terracotta.jpg
    terracotta.jpg
    192.2 KB · Views: 194
  • mass_games.jpg
    mass_games.jpg
    176.6 KB · Views: 182
  • mass_splash.jpg
    mass_splash.jpg
    239.8 KB · Views: 307
I haven't checked it yet, but if you save and reload on the turn said wonder completes, won't it add culture twice?
 
@Sneaks: Just checked; it doesn't add culture twice. You gave me a little scare there ;)

@Pouakai: Go ahead!
 
Thanks :)

I suspect it was bugged though. After some trail, error and reading I found out that Events.ActivePlayerTurnStart (and others) only apply to the human player or stuff known by the human, so the wonders might not work for the AI. So I now trigger the code by GameEvents.PlayerDoTurn. Didn't test for the AI (guess I could) but it should work exactly the same way now for human and AI alike.

New version up.
 
Hello Moriboe:

I think the culture is added base on game YEAR instead of oneshot. I mean, I made a scenario which has 12 turns per year, and the culture is added every turn in the whole year (12 turns).
 
That's unfortunate. I use the function GetBuildingOriginalTime in my code; I don't see an alternative in the API that would return a more specific value like the game turn.

Maybe a oneshot solution like a "building completed" triggering event is available somewhere, but it wasn't when I created this, nor do I find one in my game files with a quick search. A good solution would be a variable that is persistent throughout saves, but I have not the best experience with several mods storing data, so I prefer not to add that. Sorry.
 
That's unfortunate. I use the function GetBuildingOriginalTime in my code; I don't see an alternative in the API that would return a more specific value like the game turn.

Maybe a oneshot solution like a "building completed" triggering event is available somewhere, but it wasn't when I created this, nor do I find one in my game files with a quick search. A good solution would be a variable that is persistent throughout saves, but I have not the best experience with several mods storing data, so I prefer not to add that. Sorry.

I also did a search for the alternative of GetBuildingOriginalTime yesterday, and I found nothing. Anyway thank you for making this great mod component:goodjob:
 
Back
Top Bottom