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

Game Event for when a League Project Complete?

Discussion in 'Civ5 - SDK / LUA' started by JFD, Feb 10, 2016.

  1. JFD

    JFD Kathigitarkh

    Joined:
    Oct 19, 2010
    Messages:
    9,114
    Location:
    The Kingdom of New Zealand
  2. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,370
    Location:
    Near Portsmouth, UK
    There's no event (but it wouldn't be hard to add one - CvLeague:: DoProjectReward), but you can probably achieve the same effect by adding a free building (or unit class where the reward already grants a free building) and detecting that (buildings are always be added to the capital, so only one city per major to check)
     
  3. Craig_Sutter

    Craig_Sutter Deity

    Joined:
    Aug 13, 2002
    Messages:
    2,745
    Gender:
    Male
    Location:
    Calgary, Canada
    There is actually a paucity of examples of how to do League based functions (for those who learn by example). For example, I need to figure out which stage the world congress is at (initial, city state votes, more city state votes, UN).

    There is a IsUnitedNations boolean, but I have't figured out a way to loop through the league states to determine which state the league is in... there is a league ID but no obvious (to me) way to cross check that with current state as in "if league == leagueID than...".
     
  4. JFD

    JFD Kathigitarkh

    Joined:
    Oct 19, 2010
    Messages:
    9,114
    Location:
    The Kingdom of New Zealand
  5. LastSword

    LastSword Prince

    Joined:
    Feb 24, 2013
    Messages:
    999
    Game.GetActiveLeague() -- for pLeague

    Anyway, for reference:
    LeagueOverview.lua (you can detect if there is vote currently, active resolutions, name...)
    LeagueProjectPopup.lua (op answers)
    LeagueSplash.lua (??? wasn't aware of this :p)

    GameEvents.PlayerDoTurn -- I would risk it will be enough
    pLeague:IsProjectComplete(iProject) -- This one is an answer.
    pLeague:GetMemberContributionTier(iPlayer, iProject) -- 3 - gold, 2 - silver, 1 - bronze, 0 - none (before completed always show 3)
     
  6. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,370
    Location:
    Near Portsmouth, UK
    Unfortunately the expansions packs add very, very little in the way of modder support (events, API, bonus table columns) beyond what Firaxis needed to get the UI/Scenarios to work.

    For example, there is no reliable way (obvious or otherwise) to ascertain which type of session the World Congress is in. No event is sent, and nothing in the API will let you get the associated database info/row.

    If you haven't modded the number of votes per member, for the host and per allied CS such that they don't generate unique numbers (ie you haven't set them all to 0) you can probably work it out from the "base votes" and "total votes" API methods.
     

Share This Page