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

When adding a specialist to a building, how to make the new specialist appear in the clicked slot?

Discussion in 'Civ5 - Creation & Customization' started by cvm00der, Jun 30, 2018.

  1. cvm00der

    cvm00der Chieftain

    Joined:
    Jun 30, 2018
    Messages:
    5
    Gender:
    Male
    And not in the rightmost slot regardless of the slot clicked on? I'm creating a mod and having trouble finding how to do this or even where in the code to find where the game decides to magically produce the specialist in the first slot to the right.
     
  2. cvm00der

    cvm00der Chieftain

    Joined:
    Jun 30, 2018
    Messages:
    5
    Gender:
    Male
    If anyone happens to be interested, I found the solution. For the longest time I was thinking that there's something in the lua where if you click to add a specialist, it moves them over all the way to the right in the building and highlights them. Really, it's just a matter of the ordering of the buttons in CityView.xml (and CityView_small.xml), where the BuildingFilledSpecialistSlots are all listed before all the BuildingEmptySpecialistSlots. When clicking on a specialist, the lua enables the FilledSpecialist button and hides the EmptySpecialist button, which by virtue of the ordering in the xml means the filled button will be before all the other empty buttons.

    To change this, I simply intertwined the two types of buttons, so I have BuildingEmpty...1, then BuildingFilled..1, then BuildingEmpty...2, etc. So if you click on a specialist to enable him, he stays put and doesn't shift over. super helpful for what i've been working on, so I'm glad I figured this out.
     
  3. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,499
    Location:
    Near Portsmouth, UK
    just be aware that overriding the two CityView xml files will make your mod incompatible with other "major" mods that change the UI
     
  4. cvm00der

    cvm00der Chieftain

    Joined:
    Jun 30, 2018
    Messages:
    5
    Gender:
    Male
    Yeah, I figure. I've been messing around all over so I figure my mod will probably work no more than about 0 mods right now unfortunately. I'll see about compatibility later on, though I'm more concerned with the dll because I don't want to have to play against the vanilla ai.
     

Share This Page