I'm creating a mod where a player can purchase a particular unit when they adopt a certain belief. I've got the unit purchasing part right but setting up the xml tag using lua is proving to be more difficult. The operating factors:
Unit
BeliefType = BELIEF_TEOTEQUITL
UnitType = UNIT_TICOCYAHUACATL
New Tag = RequiresTeotequitlAdopted
The lua I wrote:
What am I missing here? I'd appreciate any help...
Unit
BeliefType = BELIEF_TEOTEQUITL
UnitType = UNIT_TICOCYAHUACATL
New Tag = RequiresTeotequitlAdopted
The lua I wrote:
Code:
GameEvents.PlayerCanTrain.Add(
function(iPlayer, unitTypeID)
local RequiresTeotequitlAdopted = GameInfo.Beliefs[BeliefType].RequiresTeotequitlAdopted
if RequiresTeotequitlAdopted then
local player = Players[iPlayer]
local unitID = UNIT_TICOCYAHUACATL
if not RequiresTeotequitlAdopted then
end
end
return true
end)
What am I missing here? I'd appreciate any help...