LeeS
Imperator
Both functions are being passed the info for a Building, so you need your GameInfoTypes["Something"] to refer to the Building and not the Building-Class.
These:
are called "arguments", and they are automatically passed from the game to any function that is "Add"-ed to GameEvents.CityConstructed. The arguments are given the appropriate data by the game each time the function FortKnoxBuilt needs to run. The arguments give pre-defined (by Firaxis) types of information, and must be placed in pre-defined order. buildingType will be the game's internal ID# for the building that was just constructed. What you are telling the lua to do when you state GameInfoTypes["BUILDING_FORT_KNOX"] is to go look through the XML/SQL database and give you the internal ID# for BUILDING_FORT_KNOX.
This line:
is comparing the ID# the game passed to function FortKnoxBuilt for its argument buildingType to what is assigned as an internal ID# for BUILDING_FORT_KNOX and only running the next line:
when the two are the same ID# (hence the == symbology).
With regard to spending-away all your gold and still being able to build the wonder, are you spending away all your gold before or after you start constructing the wonder in one of your cities?
These:
Code:
function FortKnoxBuilt([COLOR="Blue"]playerId, cityId, buildingType, bGold, bFaithOrCulture[/COLOR])
This line:
Code:
if(buildingType == GameInfoTypes["BUILDING_FORT_KNOX"]) then
Code:
player:ChangeGold(-300);
With regard to spending-away all your gold and still being able to build the wonder, are you spending away all your gold before or after you start constructing the wonder in one of your cities?