Uprising Empire

Uprising Empire 1.0.0

EDIT: I don't like the idea of deactivating the firaxis code. It means that there are a lot of systems and policy choices that become irrelevant

that's why it would be optional, or increase max loyalty
 
I could add an option button to deactivate the loyalty may be

that's why it would be optional, or increase max loyalty

I'd hold off on making any of those changes. The way your mod runs independently of Firaxis now could be a benefit. I noticed in the last few months that there are less CTD crash with city flipping (not your code). I think it is because Firaxis have been working on that code because it might be part of their next "game mode" release. You probably could wait to see what they do.

EDIT: a few months ago I wasn't using your mod but was adjusting Firaxis values to increase revolt chances but it would CTD a lot. Now it doesn't.
 
Here is what I decided to do about Firaxis loyalty. I take the Firaxis loyalty per turn value and multiply it by 50 (to scale it to 5000) and if it is negative subtract it from this mods happiness value.
Here is the result:
upload_2020-8-2_18-19-51.png

The picture shows that Firaxis code wants to rebel in 23 turns and because Firaxis loyalty is dropping this mods happiness is in the red and chance of rebellion is rising.

I kind a like it because it is a simple way of connecting the Firaxis code to this mod and still have this mod handle almost all the rebellions yet still have to think about controlling Firaxis loyalty too.
 
Had my first hand played partisan revolt this game session. It was great. Well balanced, challenging, fun and when the citizens switched governments on me that was cool! :goodjob::thumbsup: and no errors in the log.
 
Hi, thx for the feed back, but I think I forgot to enable Separatism in last version, so you may have played without it :/ here the last version + new civ can't get city if the city is too far from there capital and if cities win their revolt at the same time they can join the same new civ.
 

Attachments

  • Uprising Empire.rar
    57.3 KB · Views: 241
Hi! First off, want to say I love the idea of this mod. Love love love it - it's a must have and I can't play without it, and I think overall it's executed really well and adds a lot to the game to make it more fun.

But there a few things about it that I think should be changed a bit based on my experiences playing with it. Please don't take this as a criticism, it's a great mod! Just some personal feedback I had.

- Revolt penalties from being at war are far, far too high and far too simple. I think the maximum of 300 should be lowered (maybe to 150-200), and it should be based on you losing units more than simply being at war. This is because the AI will often declare war at you from across the entire map but refuse to make peace, or will just be in an awkward position to attack them from but will not accept a peace deal. This makes being at war extremely punishing and not always in your control.

- Revolts should be based on factors you can control more. Having governors should reduce revolts, having high or low amenities should have more of an effect, the penalty for being far away from the capital should be increased, and civics/spies/leader abilities should play a role just like they do for normal loyalty. There should also be other ways to mitigate revolts or cause them in other civilizations - in particular, I think Tourism and different governments should be a major factor like in Civ V.

- The penalty for having suffered a revolt is just nuts. Barbarians spawned by revolts will destroy all your improvements and districts, which is very punishing, but on top of that you're looking at 20 turns or so of losing massive amounts of yields per turn. I think this element should be removed, personally, or the recovery period should be drastically shortened.

- Because revolts are technically barbarians, they will attack your trade routes. It's nearly impossible to protect them on very large maps, especially with mods that increase trade route distance. This makes policies (with mods) or golden age bonuses that protect your trade routes more valuable, but it's also a huge pain. Is there any way to prevent revolt barbarians from attacking third-party trade routes? It might even be worth reserving a civilization slot specifically for partizans that is only at war with people suffering a revolt (which also prevents the AI from attacking partizans of another nation) but I don't know if this is feasible.

- It's a little silly that partizans can be units that you haven't invented yet. I feel like partizans should be only the strongest types of units you have available or weaker, rather than based on the technology level of the rest of the world.

- I have no idea what the "your leader died" part of your government stability means. Is it just RNG?

- Oh, one more suggestion: would it be possible to have revolts get more severe/more likely depending on the era? Like in the Renaissance era or the Modern era, to simulate the French Revolution, American Revolution, Russian Revolution, etc.

Anyway, that's my feedback! I love this mod and will definitely continue using it, it's excellent. I hope to see it improved more and more!
 
Last edited:
- Revolt penalties from being at war are far, far too high and far too simple. I think the maximum of 300 should be lowered (maybe to 150-200), and it should be based on you losing units more than simply being at war. This is because the AI will often declare war at you from across the entire map but refuse to make peace, or will just be in an awkward position to attack them from but will not accept a peace deal. This makes being at war extremely punishing and not always in your control.

- Revolts should be based on factors you can control more. Having governors should reduce revolts, having high or low amenities should have more of an effect, the penalty for being far away from the capital should be increased, and civics/spies/leader abilities should play a role just like they do for normal loyalty. There should also be other ways to mitigate revolts or cause them in other civilizations - in particular, I think Tourism and different governments should be a major factor like in Civ V.
I completely agree, the first part is what I was reporting before. It's bad for the player because it's out of his hands and it's bad for the AI because at constant -300 they cannot keep their cities together.

- Oh, one more suggestion: would it be possible to have revolts get more severe/more likely depending on the era? Like in the Renaissance era or the Modern era, to simulate the French Revolution, American Revolution, Russian Revolution, etc.
Before going on vacation I was trying to make some changes to Gueux's code to test an era modifier for distance from the capital so that in renaissance and industrial era you could colonize as much as youy wish, but in earlier and later eras it would be more difficult, modeling for example decolonization.
But I don't know LUA and my test results were janky at best XD
 
@DrNooooo what version of the mod were you playing for your review?

The most recent version linked on this page! It's not uploaded to the main post, which is kind of confusing, but that's the one I used.

ETA: So, to put my money where my mouth is, I want to list out every suggestion I would recommend this mod make in a convenient list. I'm working on editing these in myself when possible but until then, hopefully this will be useful:

- Decrease the maximum at war penalty to 150, and slightly increase the penalty for units taking damage and dying to simulate the effects of a war actually being fought instead of just declared.
- Increase happiness from amenities to 50 per amenity.
- Increase malus from distance to the capital by -5.
- Add an additional bonus/detriment based on loyalty. If a city is gaining or losing loyalty, have it also gain revolt score times five that amount, with a maximum of 50 and a minimum of -50. So if a city is gaining eight loyalty per turn, it would gain 40 points towards its positive revolt score, and if it was losing that amount, it would lose 40 points. This ensures that all civics, leader abilities, and any other mechanic that affects loyalty also affects revolts.
- Have each level of loyalty in 10-point increments give a 5 bonus towards the positive revolt score. So maximum loyalty gives a flat 50 bonus points towards its positive revolt score. This allows spies to slightly increase a chance of revolt by increasing unrest.
- Each point of visiting tourists that all other civilizations have against an opponent should equal a point or two of negative revolt score, up to a maximum of 200. Differing governments with the civilization accepting the tourists doubles the effect of each tourist.
- Decrease the amount of turns spent in recovery after a revolt to between 1 and 5, or remove this mechanic altogether.
- Unlocking the Enlightenment civic, unlocking the Ideology civic, and being in the Modern era should all increase overall revolt chance by 2% each. This helps simulate real-world periods of revolution.
- If possible, make trade routes immune to barbarians spawned by revolts.

The goals of this are all to put control of revolts more in the hands of the player and player decisions, allow loyalty mechanics to still be useful in the new system, simulate real-world revolts for additional flavor, increase the importance of tourism and culture and different governments along the lines of Civ V, and - most importantly - discourage wide play and make playing taller strategies more viable. I think these changes will help a lot in that direction!
 
Last edited:
Hi,

thx for all these suggestion I will try to give an answer for each one :


Revolt penalties from being at war are far, far too high and far too simple. I think the maximum of 300 should be lowered (maybe to 150-200), and it should be based on you losing units more than simply being at war. This is because the AI will often declare war at you from across the entire map but refuse to make peace, or will just be in an awkward position to attack them from but will not accept a peace deal. This makes being at war extremely punishing and not always in your control.

I have not uploaded it yet but in my last version war duration only have effect if there is at least 1 war event in the last 5 turns else it reduce war exhaustion by 1 per turn until end of war or an event, if you want to disable it just set "--" or erase it on line 1292 in UprisingEmpireUI.lua

SetWarExhaustion(playerID, WarDurationMultiplier); -- war exhaustion per turn from war

Revolts should be based on factors you can control more. Having governors should reduce revolts, having high or low amenities should have more of an effect, the penalty for being far away from the capital should be increased, and civics/spies/leader abilities should play a role just like they do for normal loyalty. There should also be other ways to mitigate revolts or cause them in other civilizations - in particular, I think Tourism and different governments should be a major factor like in Civ V.

for now I want to concentrate the mod on vanilla version, I will see after to integrate loyalty in it, if you want to integrate it you could add it in other effect like this at line 1074:

Code:
    local cityLoyalty = pCity:GetCulturalIdentity():GetLoyalty() * 4; -- city loyalty multiplied by 4 , to get the per turn value pCity:GetCulturalIdentity():GetUprisingLvlPerTurn()
    if cityLoyalty < 0 then
        otherEffectToolTip              = otherEffectToolTip .. "[NEWLINE][ICON_PressureDown]-"..cityLoyalty.." due to the loyalty of the city";
    else
        otherEffectToolTip              = otherEffectToolTip .. "[NEWLINE][ICON_PressureUp]-"..cityLoyalty.." due to the loyalty of the city";
    end
 
    local otherEffect                   = cityFoodSurplusMod + cityNumberOfWonderMod + cityNumberOfBuildings + numberOfDistrictMod + peaceEffect + cityCountMod + cityLoyalty;

The penalty for having suffered a revolt is just nuts. Barbarians spawned by revolts will destroy all your improvements and districts, which is very punishing, but on top of that you're looking at 20 turns or so of losing massive amounts of yields per turn. I think this element should be removed, personally, or the recovery period should be drastically shortened.

- Because revolts are technically barbarians, they will attack your trade routes. It's nearly impossible to protect them on very large maps, especially with mods that increase trade route distance. This makes policies (with mods) or golden age bonuses that protect your trade routes more valuable, but it's also a huge pain. Is there any way to prevent revolt barbarians from attacking third-party trade routes? It might even be worth reserving a civilization slot specifically for partizans that is only at war with people suffering a revolt (which also prevents the AI from attacking partizans of another nation) but I don't know if this is feasible.

I can't control barbarians unfortunately exept to move them back to the city, THe yield amount is 100% at just after the revolt but each turn is reduced by 3% so after 15 turn you lose only 50% of the yields, I may reduce it I ll see.
I can't really help you to do it yourself it's at line 1950 if you want to try.

- It's a little silly that partizans can be units that you haven't invented yet. I feel like partizans should be only the strongest types of units you have available or weaker, rather than based on the technology level of the rest of the world.
the units are based on your era, so if you are at start of an era it can be weird, even more if your are more advandced in culture, I will modify that

- I have no idea what the "your leader died" part of your government stability means. Is it just RNG?
it's random, actualy I wanted to do something more complex but never did it, may be one day.

- Oh, one more suggestion: would it be possible to have revolts get more severe/more likely depending on the era? Like in the Renaissance era or the Modern era, to simulate the French Revolution, American Revolution, Russian Revolution, etc.
I could do it, I would like to find a realistic way to add it, I ll see.

- Decrease the maximum at war penalty to 150, and slightly increase the penalty for units taking damage and dying to simulate the effects of a war actually being fought instead of just declared.
I won't do it but you can modify max war exhaustion in "SetWarExhaustion()" at line 1189

if uprisingEmpireData[playerID].WarExhaustion.Amount <= -300 then -- war exhaustion level can't be less than -300
uprisingEmpireData[playerID].WarExhaustion.Amount = -300;

change the -300 to whatever you want

if you want to modify certain event effect just search "SetWarExhaustion" in the file and change the number after the playerID argument

- Increase happiness from amenities to 50 per amenity.
search and modify all line where you find "* 30" to "* 50"
you should find 3 of them.

The most recent version linked on this page! It's not uploaded to the main post, which is kind of confusing, but that's the one I used.
I will update it, I just need to test the mod to be sure, but every time I add things and I need to retest ...

- Increase malus from distance to the capital by -5.
in SetColonialRiot() at line 3289 add at the first line of the function
DistancewithCapital = DistancewithCapital * 5;


- Each point of visiting tourists that all other civilizations have against an opponent should equal a point or two of negative revolt score, up to a maximum of 200. Differing governments with the civilization accepting the tourists doubles the effect of each tourist.
it's interesting but I don't know if it's possible

Before going on vacation I was trying to make some changes to Gueux's code to test an era modifier for distance from the capital so that in renaissance and industrial era you could colonize as much as youy wish, but in earlier and later eras it would be more difficult, modeling for example decolonization.
But I don't know LUA and my test results were janky at best XD
that's not even your fault, my code is very bad and there near no comment, I learned lua and wasn't knowing what I was doing at start, even I have trouble understanding some parts.
 
Last edited:
Thank you so much for all the help! I don't know much about Civ VI modding so that's hugely helpful, I'll add those changes to my own version :) Looking forward to seeing what you do with future versions!

ETA: Also, about the tourism thing... I actually had some other ideas, although feel free to ignore me if none of this is possible or what you want to do. I'm just passionate about this mod, I really love it!

What if, instead of individual tourists (which might not be feasible to use, I don't know anything about LUA in Civ VI), it was based on overall tourism and decreased based on distance from the capital of the neighboring empire? That way, neighboring civs with high tourism output will affect cities that are close to their capital, making them more likely to revolt, and *this* could be multiplied by differing governments. This also has the side effect of making revolts more likely from this scenario as the game progresses.

I think it'd be interesting if differing governments also caused a unique kind of revolt, a Government Revolt, something like this:

- If a city successfully revolts as a result of differing governments, it "changes governments" from the official government of the empire. So it will be marked in the UI as being Communist even if the empire is Capitalist, for example.

- Every city you have that has mismatched governments applies negative revolt score in all cities that are still your original government type (Capitalist, to use the last example) towards another government revolt.

- If 50% or more of your cities successfully have a government revolt and are marked as a different government from the official one, the player's government immediately changes to the "new" government, all cities are reset, and there is no instability from having changed governments (or it's countered by an equal positive score).

Again, don't know if this is possible or if there's hiccups with the game mechanics! But I think this could be useful for simulating the concepts behind the ideology mechanics in Civ V.
 
Last edited:
Hi,

What if, instead of individual tourists (which might not be feasible to use, I don't know anything about LUA in Civ VI), it was based on overall tourism and decreased based on distance from the capital of the neighboring empire? That way, neighboring civs with high tourism output will affect cities that are close to their capital, making them more likely to revolt, and *this* could be multiplied by differing governments. This also has the side effect of making revolts more likely from this scenario as the game progresses.
My mod already have a migration system, it doesn't create any uprising yet, so I don't know if I add tourism too, actually the migration system is partly responsible of the memory problem of my mod.

I think it'd be interesting if differing governments also caused a unique kind of revolt, a Government Revolt, something like this:

- If a city successfully revolts as a result of differing governments, it "changes governments" from the official government of the empire. So it will be marked in the UI as being Communist even if the empire is Capitalist, for example.

- Every city you have that has mismatched governments applies negative revolt score in all cities that are still your original government type (Capitalist, to use the last example) towards another government revolt.

- If 50% or more of your cities successfully have a government revolt and are marked as a different government from the official one, the player's government immediately changes to the "new" government, all cities are reset, and there is no instability from having changed governments (or it's countered by an equal positive score).
the problem is how do you change the government back.
the revolt could, if is won, start a revolt in the capital (if not already done) and only if it win in capital change the government. or unit move to the capital but it would be complicated cause barbarian can't go through water and my mod doesn't count unit that are too far from the city to be sure they are all arround, so if there is too much units they wouldn't be all counted.
 
Last edited:
I'm not sure what you mean about the migration system? But I don't understand how the migration system in the mod works currently.

Anyway, I think starting a revolt in the capital would work I think, and be simpler to understand and manage. As for how you change the government back... hmm. If I'm understanding this right, why not just use the regular government change mechanics? As in vanilla, you'd be able to change governments if you gain new policies or pay the gold fee to unlock it. If you're manually going back to your previous government (i.e. Capitalism from Communism), it causes several turns of anarchy as in vanilla, which is a suitable punishment for "going against the will of the people" by returning to a form of government they dislike.

I guess the question then is what prevents you from having another government revolt immediately from enemy tourism and differing governments. And I think the answer is nothing - the onus would be on the player to prevent another revolt by building up their army and increasing their revolt score. My opinion is that making it more complicated than that would clutter up the mechanics.

Also, a thought: culture could serve as a counter to tourism, like in Civ V, to further put control in the player's hands by letting them build up culture. So, for example, every two points in culture that you have globally would counteract one point of the tourism affecting your cities. So let's do some possible math:

A civilization is exporting 150 tourism per turn and has Communism. It's capital is 15 tiles away from your nearest city and let's say each tile of distance decreases the effect by 5 points. You follow capitalism and produce 250 culture per turn. Pressure from tourism on that city would be (150 * 2) - ( 5 * 15 ) - ( 250 / 2) = 100 revolt score per turn. Not insignificant, and since this stacks with other civilizations neighboring the player's city, this could easily add up.

Or, a civilization is exporting 200 tourism per turn and has Capitalism. It's capital is 8 tiles away from your nearest city. You also follow Capitalism and produce 250 culture per turn. Pressure from tourism on that city would be 200 - ( 5 * 8) - ( 250 / 2) = 35. So, because you follow the same government, even though the enemy's tourism is higher and the capital is almost 50% closer, it has much less of an overall effect.

Or, a civilization is exporting 100 tourism per turn and has Communism. Its capital is a mere 4 tiles from your nearest city. You follow Capitalism and produce 250 culture per turn. Pressure from tourism on that city would be (100 * 2) - ( 5 * 4) - ( 250 / 2 ) = 55. So in comparison to the first example, even though the city is much closer to the capital, the civilization's decreased tourism from 150 to 100 means it only has about half the effect.

What this overall means is that the greatest effect would be from different governments and increased tourism, while the lowest effect would be from distance to the capital.
 
I'm not sure what you mean about the migration system? But I don't understand how the migration system in the mod works currently.

you can look at the mod description for details, for more information ingame you need to expand the panel and then click on the bar on the right,

Anyway, I think starting a revolt in the capital would work I think, and be simpler to understand and manage. As for how you change the government back... hmm. If I'm understanding this right, why not just use the regular government change mechanics? As in vanilla, you'd be able to change governments if you gain new policies or pay the gold fee to unlock it. If you're manually going back to your previous government (i.e. Capitalism from Communism), it causes several turns of anarchy as in vanilla, which is a suitable punishment for "going against the will of the people" by returning to a form of government they dislike.

I mean how to change a city government back, from your suggestion every city would have its government and could change it after a revolt.

I guess the question then is what prevents you from having another government revolt immediately from enemy tourism and differing governments. And I think the answer is nothing - the onus would be on the player to prevent another revolt by building up their army and increasing their revolt score. My opinion is that making it more complicated than that would clutter up the mechanics.

Also, a thought: culture could serve as a counter to tourism, like in Civ V, to further put control in the player's hands by letting them build up culture. So, for example, every two points in culture that you have globally would counteract one point of the tourism affecting your cities. So let's do some possible math:

A civilization is exporting 150 tourism per turn and has Communism. It's capital is 15 tiles away from your nearest city and let's say each tile of distance decreases the effect by 5 points. You follow capitalism and produce 250 culture per turn. Pressure from tourism on that city would be (150 * 2) - ( 5 * 15 ) - ( 250 / 2) = 100 revolt score per turn. Not insignificant, and since this stacks with other civilizations neighboring the player's city, this could easily add up.

Or, a civilization is exporting 200 tourism per turn and has Capitalism. It's capital is 8 tiles away from your nearest city. You also follow Capitalism and produce 250 culture per turn. Pressure from tourism on that city would be 200 - ( 5 * 8) - ( 250 / 2) = 35. So, because you follow the same government, even though the enemy's tourism is higher and the capital is almost 50% closer, it has much less of an overall effect.

Or, a civilization is exporting 100 tourism per turn and has Communism. Its capital is a mere 4 tiles from your nearest city. You follow Capitalism and produce 250 culture per turn. Pressure from tourism on that city would be (100 * 2) - ( 5 * 4) - ( 250 / 2 ) = 55. So in comparison to the first example, even though the city is much closer to the capital, the civilization's decreased tourism from 150 to 100 means it only has about half the effect.

What this overall means is that the greatest effect would be from different governments and increased tourism, while the lowest effect would be from distance to the capital.

may be I could make tourism modify cultural identity but idk for gouvernment, may be if government stability is lower than neighbour empire then tourism could have a little effect but not that much.
 
Last edited:
you can look at the mod description for details, for more information ingame you need to expand the panel and then click on the bar on the right,

Alright, I think I understand it now. I think adding instability and tourism to the existing migration system (where it doesn't overlap or cause a feedback loop) is a good idea. Even if it only had a small effect, I think it makes intuitive sense and makes tourism *do something* which it barely does at present. Just my opinion though!

I mean how to change a city government back, from your suggestion every city would have its government and could change it after a revolt.

Hmm. Good point, hadn't considered that. How about, to go with my previous suggestion, changing governments resets all cities. So if you manually change your government to the old one, all cities return to the same government.

As for how you could change a city's government back before this, there could be a "Suppress Dissent" city project (doable once a city can revolt again?) that has a negative effect (increased revolt chance, lower revolt score, or loss of yields/amenities) while active but resets the government back and temporarily prevents revolts in the city when complete.

That might be getting too complex though - just a thought.

may be I could make tourism modify cultural identity but idk for gouvernment, may be if government stability is lower than neighbour empire then tourism could have a little effect but not that much.

Those could also work! Really, I just want Tourism to have SOME kind of impact.
 
Last edited:
this version changes :
add an help for AI (works for player too), no event for 5 turn = no war duration penalty and +3 War exhaustion per turn.
government revolt only change the government if it's the capital
revolt unit can't be units that you didn't unlocked.

and tried to optimise it, but failed.
 
Hello! I'm trying to make a mod leader to go with this mod, and I need the LUA code for this mod to detect if another player has a trait, and then, if that player has the trait, to check if that second player's government doesn't match the first player's government. I have no experience in LUA coding though, so I honestly have no idea how to do this. Do you think you could help?

Also, I'd like permission to upload the (slightly modified, in order to bring in Loyalty as a factor using your code earlier) Uprising Empire mod to the workshop so that people can easily access it. Is that alright with you?
 
Hi,

you can do what you want of my code, upload it wherever you wish, but if you upload with loyalty you should add


Code:
<Dependencies>
        <Mod id="1B28771A-C749-434B-9053-D1380C553DE9" title="Extension : Rise and Fall" />
  </Dependencies>
in the modinfo after </Properties> cause it won't work without the DLC exept if you verify it in the lua files before using any RiseFall object with :

Code:
local bIsRiseFall                       :boolean = Modding.IsModActive("1B28771A-C749-434B-9053-D1380C553DE9");


I am noot sure what you mean by "trait" but you can search in https://docs.google.com/spreadsheets/d/1HQSUOmw_pI8dNSr1kmun4qAHj6SsOVfa1vGTbk5mVvs/edit#gid=0 (made by Gedemon)
to find any lua object, if you want to know what the function return search throught the game base UI, if it is used in you should have some example or ask me may be I know. (base UI folder should be Game folder/base/assets/UI)

there is 2 context, be sure to use the right one. UI context is better to get information while script context is better to modify them.

to get :
player leader Type: PlayerConfigurations[playerID]:GetCivilizationTypeName();
player civilization Type: PlayerConfigurations[playerID]:GetCivilizationTypeName();

leader type data : GameInfo.Leaders[leaderType] (you can get everything in the Leaders table of the sql data base)
civilization type data : GameInfo.Civilizations[civTypeName]

player government type: Players[playerID]:GetCulture():GetCurrentGovernment(); (only in UI context I think)


and I found this in the game UI

Code:
function HasTrait( traitName:string, playerId:number )
    if playerId == nil then playerId = Game.GetLocalPlayer(); end
    if playerId == -1 then return false; end    -- Autoplay.
   
    local config :table = PlayerConfigurations[playerId];
    if(config ~= nil) then
        local leaderType:string = config:GetLeaderTypeName();
        local civType    :string = config:GetCivilizationTypeName();
        if leaderType then
            for row in GameInfo.LeaderTraits() do
                if row.LeaderType==leaderType and row.TraitType == traitName then
                    return true;
                end
            end
        end
        if civType then
            for row in GameInfo.CivilizationTraits() do
                if row.CivilizationType== civType then
                    if row.TraitType == traitName then
                        return true;
                    end
                end
            end
        end
    end
    return false;
end
 
Last edited:
Well, I've got the additional modifier to partially trigger in that the Print command returns something, but I haven't got it to actually do anything in-game. No matter what I set the numbers to, it doesn't seem to have any effect on other cities. Here's the relevant parts of the code:

Code:
function GetCulturePresure(playerID, cityID, cityKey, pCity, divisor)
    culturePresure = emptyTable(culturePresure);
    if not divisor then
        divisor = 3
    end
    local kPlayers    :table = PlayerManager.GetWasEverAlive();
    for _, pPlayer in ipairs (kPlayers) do
        local pCapitalCity = pPlayer:GetCities():GetCapitalCity();
        local CityOwnerID = pCity:GetOwner()
        if playerID == pPlayer:GetID() then
            playerdivisor = 1
        else
            playerdivisor = 3 - pPlayer:GetDiplomacy():GetVisibilityOn(playerID)/2 ;
        end
        for _,pCity2 in pPlayer:GetCities():Members() do
            local City2OwnerID = pCity2:GetOwner()
            if cityID ~= pCity2:GetID() or playerID ~= pPlayer:GetID()  then
                local capitalMultiplier = 1;
                local DiffGovMultiplier = 1;
                if pCapitalCity == pCity2 then
                    capitalMultiplier = 1.5;
                end
                if PlayerConfigurations[City2OwnerID]:GetLeaderTypeName() == "LEADER_SNACK_JFK" and (Players[CityOwnerID]:GetCulture():GetCurrentGovernment() ~= Players[City2OwnerID]:GetCulture():GetCurrentGovernment()) then
                    local DiffGovMultiplier = 100;
                    print("John F. Kennedy multiplier is "..DiffGovMultiplier);
                end
                local cityKey2             = pCity2:GetX().."."..pCity2:GetY()
                local DistancebtweenCities = Map.GetPlotDistance(pCity:GetX(), pCity:GetY(), pCity2:GetX(), pCity2:GetY());
                if DistancebtweenCities <= 10 then
                    local Valuemodifier = Round( (11 - DistancebtweenCities) * GetCityData(pCity2).CulturePerTurn * pCity2:GetPopulation() / divisor / playerdivisor * capitalMultiplier * DiffGovMultiplier, 1 );
                    local city2Culture = uprisingEmpireData[cityKey2].Culture;
                    if not culturePresure[city2Culture] then
                        culturePresure[city2Culture]                = {}
                        culturePresure[city2Culture].TotalPresure   = 0;
                    elseif not culturePresure[city2Culture].TotalPresure then
                        culturePresure[city2Culture].TotalPresure = 0;
                    end
                   
                    culturePresure[city2Culture][cityKey2]                          = Valuemodifier
                    culturePresure[city2Culture].TotalPresure                       = culturePresure[city2Culture].TotalPresure + Valuemodifier;
                end
            end
        end
    end

Don't worry, the 100 multiplier is just for testing haha
 
Last edited:
Top Bottom