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

Tech web eras

Discussion in 'CivBE - Mod Development' started by Starrynite120, Dec 1, 2015.

  1. Starrynite120

    Starrynite120 Chieftain

    Joined:
    Jul 15, 2015
    Messages:
    472
    I'm playing around with the tech tree a bit, moving some things around, and something that really bothers me is it's so easy to beeline techs. So I thought of adding a requirement for moving among the rings. You can't research anything in the second ring until you have so many techs in the first ring, so each ring is like an era. I would actually like to make each ring an era (I'll be moving techs around and making a fourth ring) and make it a requirement that you need so many techs per era. Unfortunately I'm not too skilled in modding (yet, I'm working on it), and I was wondering if anyone could give me advice for how to go about this.
     
  2. Machiavelli24

    Machiavelli24 Mod creator

    Joined:
    May 9, 2012
    Messages:
    818
    You should be able to use PlayerCanResearch(playerID, techType) add additional restrictions to techs. If the techType has a radius of X count the number of less than radius X techs they have. If they don't have enough return false and the player will not be allowed to research that tech.
     
  3. Starrynite120

    Starrynite120 Chieftain

    Joined:
    Jul 15, 2015
    Messages:
    472
    Ah ok. Sounds simple enough. Thanks!
     
  4. Starrynite120

    Starrynite120 Chieftain

    Joined:
    Jul 15, 2015
    Messages:
    472
    Would you (or anyone) mind giving me an example of code showing me how I could do this? I'm only beginning to code lua, and I'm finding it a bit tricky to get the hang of it.

    Would it be something like this?

    local Variable = ResearchedTechs where GridRadius = 1
    If Variable < 4 then
    PlayerCanResearch where GridRadius = 2
    Return false
    Else
    PlayerCanResearch = true

    I'm sure there are plenty of problems with this haha I'm just trying to figure it out.
     

Share This Page