GameEvents.TeamTechResearched (Civ5 API)

From Civilization Modding Wiki
Revision as of 20:28, 19 September 2012 by DonQuich (talk | contribs) (Bot update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This page is a part of the Lua and UI Reference (Civ5).


Function.png This function is a member of GameEvents.

This is a static method, invoke it with a dot.


Triggered when a team researches a tech.


Usage

void GameEvents.TeamTechResearched(TeamID team, TechType tech, int change)


Event Type

Unknown

Parameters

team: The ID of the team that has researched.
tech: The ID of the tech that has been researched (presumably).
change: No idea.


Source code samples

TurnsRemaining.lua - DLC_02 DLC

DLC/DLC_02/Scenarios/NewWorldScenario/TurnsRemaining.lua
0518
GameEvents.TeamTechResearched.Add(OnTechResearched);


TurnsRemaining.lua (G&K)

DLC/Expansion/Scenarios/SteampunkScenario/TurnsRemaining.lua
0522
GameEvents.TeamTechResearched.Add(function(iTeam, iTech, iChange)
0523
local kCultureBonus = GetCultureFromLastTech();
0525
if (iTech == GameInfo.Technologies["TECH_THE_GRAND_IDEA"].ID) then
0526
for iPlayer = 0, GameDefines.MAX_MAJOR_CIVS - 1, 1 do
0527
   if (Players[iPlayer] ~= nil) then
0528
   if (Players[iPlayer]:GetTeam() == iTeam) then
0529
   Players[iPlayer]:ChangeJONSCulture(kCultureBonus);
0530
   end
0531
   end
0532
   end
0533
   end
0534
   end);



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.