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

Why sometimes GameInfoTypes["CIVILIZATION_MY_SPONSOR"] is nil?

Discussion in 'CivBE - Modding Help & Mod Creation' started by g02703, Apr 16, 2016.

  1. g02703

    g02703 Chieftain

    Apr 2, 2016
    On certain GameEvents, I want to check whether the player's civilization is my mod-sponsor in order to give that player (whether it's me or if it's AI) some bonuses, so I use this code:

    if GameInfoTypes["CIVILIZATION_MY_SPONSOR"] == player:GetCivilizationType() then
    -- give bonus here

    Sometimes, GameInfoTypes["CIVILIZATION_MY_SPONSOR"] is nil - I don't know why. So far, it happens when I first load CivBE and set up a game where I pick that sponsor as me. Printing to FireTuner shows nil.

    The funny thing is, I will need to quit that current game to Main Menu, set up a game picking that same sponsor again, and voila - GameInfoTypes["CIVILIZATION_MY_SPONSOR"] is no longer nil, but the expected value.

    What could I be doing wrong?
  2. Ryika

    Ryika likes cookies and milk.

    Aug 30, 2013
    It's the same bug that makes action bars not show up properly. Just return to the mod menu after activating mods and activate them a second time (don't have to be the same mods, you can just load some empty dummy-mod to speed up the process), then that stuff should not return nil anymore.

Share This Page

Ebates: Get Paid to Shop