Uprising Empire

Uprising Empire 1.0.0

from what I see it should multiply by 100 the cultural presure received from cities of LEADER_SNACK_JFK if you have a different government than him? is that right?

I am not sure but I think the problem is just that you set the var "DiffGovMultiplier" to local twice just set it on the first it should work, that's the only thing I see.

should look like this :

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
                    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
 
That worked! Thank you so much!

I need to add some more to Kennedy's leader ability and add the rest of his Civlopedia page but he should be ready to roll soon :)
 
Hi, bumping this thread because JFK is almost finished and I noticed a bug while testing him. I don't think it's related since JFK doesn't modify any of this code, but I thought it was worth pointing out.

It seems like (possibly as a result of saving and loading) you will always receive the negative revolt score from having changed governments recently and it will never go away. The tooltip also doesn't display that the government has been changed recently.

For example, here is the government tooltip after switching to Autocracy ten turns ago:


Here is the government tooltip ten tens earlier, in a save where the government was switched to Oligarchy at least twenty turns ago:

And finally, here is the government tooltip after switching to a different government and autoplaying for 15 turns, which should have eliminated the malus according to the code.

Based on my testing using Print commands, this happens because SetGovernmentModTooltip does not read the values of uprisingEmpireData[playerID].GovernmentStability.Governmentchangedturn or uprisingEmpireData[playerID].GovernmentStability.GovernmentchangedAmount and returns nil values. Switching governments will print the data successfully if a Print command is inserted, but trying to open the Revolt lens will always return "Runtime Error ...UprisingEmpireUI.lua:2326: operator .. is not supported for string .. nil" for the same Print code.

Hopefully that helps. Let me know if you have any questions.
 
Hi, I am not sure to understand but here how it should work :

if you change government you lose -30 government stability per city, then you regain it little by little (depending on the government)

if you reload the game the government stability is saved but I don't save your government change historic so it won't appear in UI but the stability should stay the same as before save load

so I am not sure where is the problem on your pics?
 
Oh, did I not understand it correctly? I was looking at the code and not reading the description so I thought what the code meant was that governments would return to being stable after 10 turns. My mistake! :blush:

I think this could be clearer in the tooltip? Like, I feel the way that government stability works is not very well explained in the game itself. If you said "government stability increases by [whatever] average per turn for [whatever] government" in the tooltip, that would be less flavorful but also easier to understand what's going on.
 
Hi, me again. I was messing around with the idea of making Tourism part of cultural pressure, but I can't get it to work - at least not properly. What I want is so that Tourism plays a larger role than Culture in the offensive cultural pressure of a Civ. In other words, Civs with higher tourism output a greater amount of culture pressure on neighboring Civs than Civs with higher raw cultural output, making Great Works, Wonders, and forming a religion more important than just building a lot of Amphitheaters. At the same time, raw Culture would allow for defense against the enemy player's tourism, again reflecting the Tourism vs. Culture gameplay of Civ V.

I was able to get this to work, technically, but it causes odd results because I don't really understand the code or how to program in lua. If I wanted Tourism to add a bonus to, or be the primary source of, the culture pressure outputted on another city, how would I make this change? And, is there any way to make the Tourism value dynamic, i.e. based on the same factors that modify Tourism in the base game such as trade routes and open borders?

Oh, and while I'm here. Say I wanted JFK's ability to work entirely differently than it does currently - say I wanted an ability based on JFK causing governments to change. For instance, is it possible to program it so that JFK, and JFK alone, adds a cultural pressure modifier, to a neighboring civ with a different government's government instability, as if that player has changed governments? And, if the instability caused by JFK's ability triggers a successful rebellion, to force a change to JFK's current government? I think that'd be much more flavorful and interesting than just giving him a passive modifier to cultural pressure.
 
Last edited:
Hi,

if you want to change how the cultural presure works you should look at "GetCulturePresure()" at line 2831

it watch every cities arround one city and calcul the presure it should receive from it

you could check the tourism from the city or the player and add it in the "Valuemodifier" var. (it's the cultural presure from the city)

local Valuemodifier = Round( (11 - DistancebtweenCities) * GetCityData(pCity2).CulturePerTurn * pCity2:GetPopulation() / divisor / playerdivisor * capitalMultiplier * tourismModifier, 1 );

divisor is for differentiate cultural presure from separatism (both use this function)
player divisor depends on the player visibility
capital have 1.5 more presure than other cities

the second Valuemodifier is the presure from the city on itself

for the government change it's in "RevoltType()" at line 2111 where "changeGovernment()" is called, just change the newGovernmentID to whatever you want.

if you want to change the government stability from a player you need to call "SetGovernmentMod(playerID, value)" (it should be called ChangeGovernmentMod cause it's doesn't set but add the value)
 
Hello! I wanted to try your mod with the new game mode (Dramatic Ages) but there seems to be a problem. After the first world congress I become unable to click the "Next turn" button and the game is stuck forever (even after reloading).
I don't know if it's a problem only with the new mode or if it extends to the normal games too. I'll try as soon as I can.
 
Just to say this is for me probably best mod for Civ6 right now. It enables more dynamic mid-late game, which is biggest problem for Civ6 since launch.

Just one suggestion, to make Civil-war revolt. Almost copy-paste of Colonial revolt, but to make it not dependent of city distance from capital --- but other factors (maybe all of them combined).
I usually start the game with "killing" half of the players in order for them to spawn in certain moment in time (usually I leave old-historic civs like Egypt, Gauls --- and kill modern like Germany, USA) ... but civs appearing because of Colonial riot is not very often, and on other hand civs splitting in two because civil war would be awesome -- and maybe not so hard to implement because you already have Colonial riot mechanic.
 
Hi,

Thx, I really appreciate.

the Civilization can split in 2 in certain case, if revolt win once the city become separatist, so if it revolt again and keep being separatist it can split a civilization in 2, but it's really rare cause I don't want the game to be to hard,

But if you want you can try to modify the mod so it happen more often, here some idea and how you could modify in UprisingEmpireUI.lua :

1 Increase number of cities penalty at line 1069 :

(Players[playerID]:GetCities():GetCount() - 1) * -5;

change the -5 by anything you want just keep it negative "Players[playerID]:GetCities():GetCount()" is the number of city -1 so it doesn't count the capital.

2 Increase separatism from revolt at line 2157

SetSeparatism(playerID, CityId, (UprisingLvlPerTurn + Separatismlvl)*0.6);

change the 0.6 by anything you want.
 
Hi, anything in the lua.log?
Sorry for the delay, I found no errors in the lua log.
Here the last entries:

Code:
NotificationPanel: NOTIFICATION_COMMEMORATION_WITHOUT_CHOICE
NotificationPanel: Notififcation Done
UprisingEmpireUI: Phase has Begun
EraCompletePopup: PopupManager.LOCK   'EraCompletePopupXP2', id: 221128, priority:1000
EraCompletePopup: START EraPopupAnimation
EraCompletePopup: START EraPopupAnimation
EraCompletePopup: PopupManager.Unlock 'EraCompletePopupXP2', id: 221128, priority:1000
UprisingEmpireUI: SoundToPlay   
NotificationPanel: NOTIFICATION_PRIDE_MOMENT_RECORDED
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_DISCOVER_RESOURCE
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_TECH_DISCOVERED
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_CHOOSE_TECH
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_COMMAND_UNITS
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_COMMAND_UNITS
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_COMMAND_UNITS
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_COMMAND_UNITS
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_COMMAND_UNITS
NotificationPanel: Notififcation Done
UprisingEmpireUI: SoundToPlay   
UprisingEmpireUI: SoundToPlay   
UprisingEmpireUI: SoundToPlay   
UprisingEmpireUI: SoundToPlay   
UprisingEmpireUI: SoundToPlay   
UprisingEmpireUI: SoundToPlay   
UprisingEmpireUI: SoundToPlay   
UprisingEmpireUI: SoundToPlay   
UprisingEmpireUI: SoundToPlay   
UprisingEmpireUI: SoundToPlay   
UprisingEmpireUI: SoundToPlay   
UprisingEmpireUI: SoundToPlay   
UprisingEmpireUI: SoundToPlay   
UprisingEmpireUI: SoundToPlay   
UprisingEmpireUI: Phase has Begun
NotificationPanel: NOTIFICATION_WORLD_CONGRESS_BLOCKING
NotificationPanel: Notififcation Done
UprisingEmpireUI: Phase has Begun
NotificationPanel: NOTIFICATION_WORLD_CONGRESS_RESULTS
NotificationPanel: Notififcation Done
UprisingEmpireUI: SoundToPlay   
NotificationPanel: NOTIFICATION_TECH_DISCOVERED
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_COMMAND_UNITS
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_CUSTOM_POPULATION_CHANGED
NotificationPanel: Notififcation Done
 
Hi,
np for the delay,

I don't know what could cause this but may be I can understand if you give me more information :

1. does it work in vanilla?
2. Do you use the last version of my mod?
3. You copy past the lua log but did you press the next turn button the last time you launched the game?
4. It's surely related to notification, is there any file in the DLC named notificationPanel.lua ?
 
Seems to have an issue with a better religion window or better unit report screen. If I use any of those mods together with it I can't upgrade my units. Great Mod though.
 
Hi

thx, can I have a screen shot? the problem is the button placement?

if you want to move the button you can modify UprisingEmpireUI.xml at line 7

you should find ' Offset="0,0" ' change the first 0 to move left or right (negative = left, positive = right)
 
Awesome mod. This mod is not up on Steam Workshop fyi, perhaps it should be.

Questions
1) Do civs recycle? So lets say in the beginning we have India removed to be placed in the reserved pile. During the game India comes in via a revolt. Another civ destroys India. Does India go back into the reserve pile? Can the reserve pile be depleted?

2) Anyone experience weird things when loading a saved game? I am not sure, but I think my civ was fairly safe from revolts, when I loaded a save game all my cities revolted. Could be a bug or perhaps bad luck.
 
Last edited:
Hi

1) I can't revive a dead civ, if a civilization lost its last city then the game pass its turn even if I give a city back

2) I don't know, did this happenned multiple times?
 
Top Bottom