1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

[BNW] After the Revolution!

Discussion in 'Civ5 - Mod Components' started by sman1975, Aug 10, 2018.

Tags:
  1. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    603
    Location:
    Dallas, TX
    upload_2018-8-10_13-4-10.jpeg


    "The most radical revolutionary will become a conservative the day after the revolution…"

    -- Hannah Arendt



    "After the Revolution" (AtR) adds a new level of capability to the game – allowing for a more tailored gaming experience, based on player's given playstyle. The mod introduces 12 new National Governments that major civs can use to help them better meet geopolitical objectives. These governments provide various benefits, both throughout the Empire and inside the Capital as well. When you select a government, a new National Wonder corresponding to that government will be built in your capital. When you change governments, the old National Wonder is removed, and the correct new one takes its place.


    The twelve types of Government added in the AtR mod are:
    1. Anarchy: a lack of formalized or effective government. This is the default government all major players start the game with.
    2. Despotism: a single entity rules with absolute power, focusing on Military success.
    3. Oligarchy: power rests with a small number of people, focusing on Gold production.
    4. Democracy: requires direct participation of the people, focusing on Happiness and social cohesion.
    5. Theocracy: a deity is the source from which all authority derives.
    6. Monarchy: a group, generally a family representing a dynasty (aristocracy), embodies the country's national identity and its head, the monarch, exercises the role of sovereignty.
    7. Republic: the country is considered a "public matter", not the private concern or property of the rulers. The primary positions of power are not inherited.
    8. Constitutional Monarchy: the sovereign exercises authority in accordance with a written or unwritten constitution.
    9. Communism: a socioeconomic order structured upon the common ownership of the means of production and the absence of social classes, money and the state.
    10. Fascism: a government of radical authoritarian ultranationalism, characterized by dictatorial power, forcible suppression of opposition and control of industry and commerce.
    11. Corporate Republic: a government in which is run primarily like a business, in which all aspects of society are privatized by a single, or small groups of companies.
    12. Technocracy: the decision-makers are selected on the basis of their expertise in their areas of responsibility, particularly scientific knowledge.



    Direct Download: https://forums.civfanatics.com/resources/after-the-revolution.27006/

    Steam Download: https://steamcommunity.com/sharedfiles/filedetails/?id=1473449974
     
    Last edited: Aug 10, 2018
    MariusMagnus and JNZS13 like this.
  2. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    603
    Location:
    Dallas, TX
    Mod Basics - Types of Governments:

    upload_2018-8-10_11-50-18.jpeg upload_2018-8-10_11-50-28.jpeg upload_2018-8-10_11-50-44.jpeg upload_2018-8-10_11-50-56.jpeg upload_2018-8-10_11-51-8.jpeg upload_2018-8-10_11-51-21.jpeg upload_2018-8-10_11-51-35.jpeg upload_2018-8-10_11-51-46.jpeg
     
    Last edited: Aug 10, 2018
  3. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    603
    Location:
    Dallas, TX
    The 'Global Government Overview' (GGO) UI:

    upload_2018-8-10_11-52-46.jpeg upload_2018-8-10_11-53-3.jpeg upload_2018-8-10_11-53-18.jpeg upload_2018-8-10_11-53-35.jpeg upload_2018-8-10_11-53-46.jpeg upload_2018-8-10_11-54-2.jpeg upload_2018-8-10_11-54-16.jpeg
     
    Last edited: Aug 10, 2018
  4. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    603
    Location:
    Dallas, TX
    Select Government Popup:

    upload_2018-8-10_11-54-38.jpeg upload_2018-8-10_11-54-51.jpeg
     
    Last edited: Aug 10, 2018
  5. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    603
    Location:
    Dallas, TX
    National Wonder Buildings (part 1):

    upload_2018-8-10_11-55-33.jpeg upload_2018-8-10_11-55-46.jpeg upload_2018-8-10_11-56-0.jpeg upload_2018-8-10_11-56-11.jpeg upload_2018-8-10_11-56-24.jpeg upload_2018-8-10_11-56-36.jpeg upload_2018-8-10_11-56-59.jpeg
     
    Last edited: Aug 10, 2018
  6. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    603
    Location:
    Dallas, TX
    National Wonder Buildings (part 2):

    upload_2018-8-10_11-57-15.jpeg upload_2018-8-10_11-57-27.jpeg upload_2018-8-10_11-57-44.jpeg upload_2018-8-10_11-57-57.jpeg upload_2018-8-10_11-58-8.jpeg
     
    Last edited: Aug 10, 2018
  7. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    603
    Location:
    Dallas, TX
    Government Unit Promotions:

    upload_2018-8-10_11-59-9.jpeg upload_2018-8-10_11-59-20.jpeg upload_2018-8-10_11-59-31.jpeg upload_2018-8-10_11-59-42.jpeg
     
    Last edited: Aug 10, 2018
  8. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    603
    Location:
    Dallas, TX
    Civilizational Discernment - how well do you know/understand the target Civ?

    upload_2018-8-10_12-0-2.jpeg upload_2018-8-10_12-0-32.jpeg upload_2018-8-10_12-0-44.jpeg upload_2018-8-10_12-0-55.jpeg upload_2018-8-10_12-1-5.jpeg upload_2018-8-10_12-3-10.jpeg
     
    Last edited: Aug 12, 2018
  9. MariusMagnus

    MariusMagnus Chieftain

    Joined:
    Mar 12, 2018
    Messages:
    44
    Looks interesting. Reminds me of Civic and Reform for Vox Populi. I'll be sure to check this out when I find the time.
     
  10. MariusMagnus

    MariusMagnus Chieftain

    Joined:
    Mar 12, 2018
    Messages:
    44
    The quality of this is superb! Without a doubt now one of my favorite mods. Excellent work on this. If I were to make any complaints, however, the World Governments overview is a bit too big for my screen. I usually play in windowed mode, 1200x800 resolution, and the World Governments overview takes up just about all of the screen, with the top and bottom being slightly cut off. Nothing too serious, but felt I should mention it.
     
    sman1975 likes this.
  11. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    603
    Location:
    Dallas, TX
    Thanks @MariusMangus! I'm pretty happy with how the mod turns out.

    Sorry about the window size. I play/code/test on a pair of 32 inch monitors, which I guess throws off my perspective... :crazyeye:

    Can you at least press the "Change Government" button on the bottom of the window? Otherwise, the report is more like reading the newspaper...

    It's odd - when I first started the mod, the lower panel had about 4 items. It looked off balance with the top panel, so I started looking for little tidbits of information to beef up the report. I started thinking, "What kind of data would a 'Foreign Government Report' contain?" I started by recycling things from the Demographics report, then added a few here and there during development. By the time the mod was done, the entire window was covered.

    I did lower the separation between the items in the report - to make the window smaller - but it really got quite unattractive, and hard to differentiate which line was which. The text just melded together, and the result was just off...
     
  12. MariusMagnus

    MariusMagnus Chieftain

    Joined:
    Mar 12, 2018
    Messages:
    44
    Yeah I can push the change governments button just fine, but the close button is slightly cut-off. It's nothing major and it doesn't actually bother me, but I felt I should report it nevertheless.

    Sorry, but uh, I can't exactly relate... :lol:
     
  13. MariusMagnus

    MariusMagnus Chieftain

    Joined:
    Mar 12, 2018
    Messages:
    44
    It would seem that using less civs than the default amount of whatever map size you're playing on causes a CTD during initialization. I isolated your mod and set up a game on huge with 10 players instead of 12, lua.log with dprint enabled shows that the last successful addition to the Government Age table to be iDX: 9, meaning it likely crashed at 10. I'm not certain as for what exactly is causing the crash, but adding a Player:IsEverAlive() check to your InitializeGovernmentTable function seems to have resolved the issue.
     
  14. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    603
    Location:
    Dallas, TX
    @MariusMagnus - wow! you're a much better tester than I (obviously... ;) )

    When you say you addded an IsEverAlive test, was that in addition to the existing IsAlive test or a replacement?

    Did the test look like this?

    Code:
    if not pPlayer:IsEverAlive() then
         iGovType = GOV_OUT_OF_GAME                                                -- Default to "Out of Game" for never/non-living civs
    end            
    
    I'm updating this mod as it will "join" a family of mods I'm working on now, and hope to release soon. I'm seeing a similar bug in the other mods, and am wondering if the bug may be related.

    If you could post the "working" version of the code, I'd greatly appreciate it, so I can add the changes to the next version.

    BTW - are you interested in a "testing from hell" challenge...? I can add you as a co-collaborator to the project I'm currently working on, and you could see the mod before release and hopefully catch a few of the probably thousand bugs that are in the mods....

    No worries if you don't want to. It's a painful thing to ask...

    Thanks!

    sman
     
  15. MariusMagnus

    MariusMagnus Chieftain

    Joined:
    Mar 12, 2018
    Messages:
    44
    I added the IsEverAlive check the line after the code checks if pPlayer is not nil so that it encompasses everything beneath it. The function looks like this now:
    Code:
    function InitializeGovernmentTable()                                                        -- Gets gov building game turn creation from game's SavedData
        if (iGOV_Table_Built == nil) then                                                        -- No saved table exists - populate it with default valuesa
            print("Building Governments Age table...")
            iStartingGameTurn = Game.GetStartTurn() or 1
    
            for iDX = 0, GameDefines.MAX_MAJOR_CIVS - 1, 1 do
                local pPlayer = Players[iDX];
                if pPlayer ~= nil then
                    if pPlayer:IsEverAlive() then     --INSERTED -MM
                        local iGovType = GetGovernmentType(pPlayer)                -- Default to "Anarchy" for major/live civs
                        local sCivDBKey = string.format("GOV_OV_GOV_AGE_PLAYER_%02i", pPlayer:GetID())
                        local iCivGovAge = g_tSavedData.GetValue(sCivDBKey) or -1                        -- Get govt Age, but use "Anarchy" if the return type isn't valid   
                        if iCivGovAge == -1 then iCivGovAge = iStartingGameTurn end
                        if not pPlayer:IsAlive() then
                             iGovType = GOV_OUT_OF_GAME                                                -- Default to "Out of Game" for never/non-living civs
                        end           
                        g_tSavedData.SetValue(sCivDBKey, iCivGovAge)
                        dPrint("iDX: " .. iDX .. "     Player: " .. pPlayer:GetCivilizationShortDescription() .. "     Gov Type: " .. g_tGovernment_Types[iGovType][1] .. "     DB Key: " .. sCivDBKey .. "     Gov Start GT: " .. iCivGovAge)                       
                    end                                --INSERTED -MM
                end
            end
        end   
    end
    Events.SequenceGameInitComplete.Add( InitializeGovernmentTable )
    As a general rule of thumb, it's usually a good idea to use Player:IsEverAlive() whenever you're iterating through the Players table.

    Color me intrigued. PM me with more details and I'll see about it.
     
  16. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    603
    Location:
    Dallas, TX
  17. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    5,615
    Location:
    Illinois, USA
    IsEverAlive is whether or not they were ever part of the game. IsAlive returns whether or not they are still a part of the game.
    When iterating through the list of players you need to use one or the other method. Sometimes you need to do both methods to ensure they are currently alive because there's that whole "resurrecting" a dead civ mechanic.
     
  18. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    603
    Location:
    Dallas, TX
    Thanks, @LeeS. I understand the difference between the two methods. What I haven't had time to delve into is why using IsAlive() causes a CTD in "advanced setup", where IsEverAlive() doesn't. @MariusMagnus looks to have found a fix, but I'm hoping to look at the changes to figure out the "why" of the original problem.

    Just haven't had time to run this to ground - on the road with work, with no time to mod... :sad:
     

Share This Page

Ebates: Get Paid to Shop