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

Creating compatability with my mod

Discussion in 'Community Patch Project' started by Countbuffalo, Oct 21, 2017.

  1. Countbuffalo

    Countbuffalo Chieftain

    Joined:
    Aug 16, 2013
    Messages:
    94
    Hi, I've been told by a few users of my mods that some of my LUA doesn't work in tandem with Vox Populi. I'm a little unsure myself of the changes Vox Populi makes that would affect this, so I'm going to post my thoughts and see if we can't figure something out.

    So, my LUA makes use of the following Lua
    Code:
    gFoodBuilding = GameInfoTypes.BUILDING_FARM_KING
    gRequiredCivilization = "CIVILIZATION_SHIRATORI"
    
    GameEvents.PlayerDoTurn.Add(function(iPlayer)
        local pPlayer = Players[iPlayer]
        if not pPlayer:IsAlive() then return end
        if pPlayer:GetCivilizationType() ~= GameInfoTypes[gRequiredCivilization] then return end
        local pCapitalCity = pPlayer:GetCapitalCity()
        local iNUmberCities = pPlayer:GetNumCities()
        pCapitalCity:SetNumRealBuilding(gFoodBuilding, iNUmberCities)
    end)
    
    The number of cities the player has will give +1 great person points to a unique great person per city. Apparently this is causing issues where other Civs will spawn massive numbers of them despite being unable to theoretically access them through generation.

    There's also an issue where the meter will not reset and eventually the player and AI will be recieving 10 of these unique great people per turn. As well as issues where the bar breaks and displays massive figures like 214363/200.

    My thoughts on this are, does VP change the way specialists generate in any way? Or perhaps include something called gFoodBuilding or such, I would appreciate any ideas people can contribute to this issue.

    Thanks.
     
  2. Enginseer

    Enginseer Salientia of the Community Patch Supporter

    Joined:
    Nov 7, 2012
    Messages:
    3,226
    Gender:
    Male
    Location:
    Somewhere in California
    What exactly does this unique Great Person is?
     
  3. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,024
    Gender:
    Male
    Location:
    Little Rock
    This sounds like a bug that can happen with CSD if certain files are not created. Namely, you need to add a 'GreatPersons' Datatype, otherwise the DLL doesn't initialize the incremental method properly. Like so:

     
  4. Countbuffalo

    Countbuffalo Chieftain

    Joined:
    Aug 16, 2013
    Messages:
    94
    I set this up as a new XML table but it didn't seem to have any effect, the AI cities were still overflowing with them
     

Share This Page