1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. 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

    Joined:
    Apr 2, 2016
    Messages:
    33
    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
    end

    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. Valessa

    Valessa Communistress

    Joined:
    Aug 30, 2013
    Messages:
    8,103
    Gender:
    Female
    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