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

[Lua] How to grant a tech to a player? Solved

Discussion in 'CivBE - Modding Help & Mod Creation' started by Protok St, Apr 29, 2020.

  1. Protok St

    Protok St Chieftain

    Joined:
    Jul 7, 2018
    Messages:
    73
    Gender:
    Male
    Location:
    Univesrity of Planet
    How to grant a tech to a player?
    Via LUA script.

    For example, at 2nd turn need to grant Physics tech to player 2.

    This is not working. A mistake inside. But where?
    Code:
    techID = 5
    ChangeResearchProgressPercent(techID, 100, player:GetID());
    
     
  2. Protok St

    Protok St Chieftain

    Joined:
    Jul 7, 2018
    Messages:
    73
    Gender:
    Male
    Location:
    Univesrity of Planet
    In Beyond Earth game code the Techs is property of not Player but Team.
    At first we need to take a Team of our Player, and then set a tech owned or not.

    Code:
    Team = Teams[player:GetTeam()]
    Team:SetHasTech(GameInfo.Technologies["TECH_ECOLOGY"].ID, true)
    
     

Share This Page