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

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

    Ryika Lazy Wannabe Artista

    Joined:
    Aug 30, 2013
    Messages:
    9,398
    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