S3rgeus
Emperor
I'm creating a UA that utilizes new columns I've added to the Traits table. I want to implement these traits using Lua (and I will be including a DLL, but I'd prefer a Lua solution to this particular issue). What I'm unclear on is how to go from a player's in-game ID to the trait info from the database. I should be able to, loosely, navigate along the tables and follow the connections between player and Civ to leader and then to trait. But I'm getting lost in the Lua API (I have been using the wiki).
I get lost fairly fast, here's an example:
I get lost fairly fast, here's an example:
Code:
function customTrait(iPlayer)
local pPlayer = Players[iPlayer]
local iLeader = pPlayer:GetLeaderType() -- This is the Leader ID in the Leaders table, correct?
-- and here I'm lost. How can I get to the Trait? I want to be able to do something like:
local traitInfo = GameInfo.Traits[*something*]
end