Game Event for when a League Project Complete?

JFD

Kathigitarkh
Joined
Oct 19, 2010
Messages
9,132
Location
The Kingdom of New Zealand
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)
 
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...".
 
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...".
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)
 
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.
 
Back
Top Bottom