First off, Master S3rgeus, your DDL is fantastic. You turned a 5 hour chore into 15 mins of fun. And I thank you.
I am still struggling a little bit with bTestVisible, and I read most of your conversations between FramedArchitect but I still just cant grasp what I'm doing wrong.
This is what I want to happen:
Unqiue Unit: Clan Elite
Has Mission: Influence City State (A once off Trade Missions that does not kill the unit)
Requirement: Must have 200 gold.
Here is my code, I will refine it for more conditions later, but at this stage the button doesnt show up at all unless I have over 200 gold (I would like it to be greyed out between 0-199 G)
Code:
function CanDoInfluenceCS(playerID, unitID, bTestVisible)
if (Players[playerID]:GetUnitByID(unitID):GetUnitType() ~= GameInfoTypes.UNIT_CLAN_ELITE) then
return false
end
if (Players[playerID]:GetGold() < 200 and not bTestVisible) then
return false
end
return true
end
GameEvents.CanDoInfluenceCS.Add(CanDoInfluenceCS)
Edit: found the problem. Silly me. had an extra paramater in function call