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

Protok St

Warlord
Joined
Jul 7, 2018
Messages
136
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());
 
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)
 
Back
Top Bottom