1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

How to upgrade 'classic' tech tree shape?

Discussion in 'Civ5 - Creation & Customization' started by maxf, Apr 14, 2020.

  1. maxf

    maxf Chieftain

    Joined:
    Jan 4, 2019
    Messages:
    30
    Gender:
    Male
    In general, I have two questions:
    1. How add more "circles" to techs where we can see new units, buildings etc. 5 is not enouth.
    2. How to change order in these "circles"? Say, wonders first, next buildings, units and so on.

    Moderator Action: Moved to main C&C forum as that is where we post questions. leif
     
    Last edited by a moderator: Apr 14, 2020
  2. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,398
    Location:
    Near Portsmouth, UK
    Both require a considerable understanding of the CivV UI code, and how to replace it with a mod.

    a) The "circles" are the buttons B1 thru B5 defined in TechTree.xml and referenced in the function AddSmallButtonsToTechButton in the TechButtonInclude.lua file. To add more you would need to make the techs bigger, which also requires changing the connection lines and the size of the eras, then adding extra buttons (B6 onwards) (all in the XML UI context), then changing "local maxSmallButtons = 5;" in TechTree.lua to reflect how many you added.

    b) Slightly easier, as the order is hard-coded in the function AddSmallButtonsToTechButton in the TechButtonInclude.lua file - so just change the code around for your desired order.

    HTH
     
  3. maxf

    maxf Chieftain

    Joined:
    Jan 4, 2019
    Messages:
    30
    Gender:
    Male
    Thank you. Yes, I see that a) is the complex problem whereas b) not so hard. I placed wonders first by adding 2 lines in TechButtonInclude.lua code and repeat one block:
    Code:
         for thisBuildingInfo in GameInfo.Buildings(string.format("PreReqTech = '%s'", techType)) do
             -- if this tech grants this player the ability to construct this building
            local thisBuildingClass = GameInfo.BuildingClasses[thisBuildingInfo.BuildingClass];                --!
            if thisBuildingClass.MaxGlobalInstances == 1 then                                                                    --!
                if validBuildingBuilds[thisBuildingInfo.BuildingClass] == thisBuildingInfo.Type then
                    local buttonName = "B"..tostring(buttonNum);
                    local thisButton = thisTechButtonInstance[buttonName];
                    if thisButton then
                        AdjustArtOnGrantedBuildingButton( thisButton, thisBuildingInfo, textureSize );
                        buttonNum = buttonNum + 1;
                    end
                end
            end
         end
    
    Btw i'm surprised what a weak language. I tried first "if thisBuildingInfo.BuildingClass.MaxGlobalInstances == 1 then" - it don't work, so I had to add thisBuildingClass variable.
     

Share This Page