Check if two civs have DoF?

Putmalk

Deity
Joined
Sep 26, 2010
Messages
2,652
Location
New York
Simple question here, but I can't find my answer anywhere.

How can I check if two civs have a declaration of friendship with each other?
 
From InfoTooltipInclude

Code:
pActivePlayer:IsDoF(iOtherPlayer)
pActivePlayer:IsPlayerDoFwithAnyFriend(iOtherPlayer)
pOtherPlayer:IsPlayerDoFwithAnyEnemy(iActivePlayer)
 
so isDoF(iOtherPlayer) is the function? Many thanks.
 
I have another question.

How can I grant a set amount of beakers to the player?

I'm looking through the LUA reference and nothing's effects are really documented at all. Is there anywhere I can go to get the effects documented? Thank you.
 
The best/only documentation for the API is the core game code ... and don't forget the FireTuner .ltp files

From C:\Program Files (x86)\Steam\SteamApps\common\sid meier's civilization v\Debug\Active Player.ltp

Code:
  local pPlayer = Players[Game.GetActivePlayer()];
  local pTeam = Teams[pPlayer:GetTeam()];
  local pTeamTechs = pTeam:GetTeamTechs();
  local eCurrentTech = pPlayer:GetCurrentResearch();
  pTeamTechs:SetResearchProgress(eCurrentTech, value);

So to add 100 beakers you'd need to set value to

Code:
value = pTeamTechs:GetResearchProgress(eCurrentTech) + 100

or (by looking at http://wiki.2kgames.com/civ5/index.php/Lua_Game_Objects/TeamTech) you can use

Code:
pTeamTechs:ChangeResearchProgress(eCurrentTech, 100);

But that's when it starts getting "interesting", as the wiki says you need a third parameter for set/change (iPlayer) but FireTuner only passes two for the set method, so do you need three for change? ... you'll need to experiment to find out :)
 
Alright, that looks like it'll work. Thank you so much for your help!
 
Back
Top Bottom