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

Remind me how Agendas connect to Leaders

Discussion in 'Mod Creation Help' started by isau, Feb 8, 2018.

  1. isau

    isau Warlord

    Joined:
    Jan 15, 2007
    Messages:
    2,671
    It's been a while since I worked on my mod and I've totally blanked on this. I've forgotten the chain through which Agendas connect to Leaders. There is some code in this post for hopeful added clarity, but I don't necessarily need code advice, just to know the correct tables to join.

    This code produces a linkage from Agendas to the Trait level, using Agendas >> AgendaTraits >> Traits.

    select * from agendas
    left join agendatraits on agendas.AgendaType = agendatraits.AgendaType
    left join traits on traits.TraitType = agendatraits.TraitType

    Spoiler :
    upload_2018-2-8_18-53-54.png



    I would assume adding a left join to LeaderTraits would fix show which leader the Trait is attached to:

    select * from agendas
    left join agendatraits on agendas.AgendaType = agendatraits.AgendaType
    left join traits on traits.TraitType = agendatraits.TraitType
    left join leadertraits on leadertraits.TraitType = traits.TraitType


    ...but it returns nothing because there are no matches. What the is actual correct linkage from Agendas to Leaders?
     
  2. criZp

    criZp Chieftain

    Joined:
    Jul 19, 2013
    Messages:
    685
    Location:
    Nidaros, Norway
    I don't do sql, but agendas and leaders are connected in the leaders.xml or the agendas.xml, can't remember which one.
     
  3. raen

    raen Coat of Arms

    Joined:
    May 12, 2003
    Messages:
    1,689
    Location:
    Portugal
    I think you are missing "HistoricalAgendas" table, this is the one that matches agendas to leaders: "LeaderType" , "AgendaType"
     

Share This Page