I'm trying to write a program that will warn the player whenever they discover an advance the makes a building obsolete. The popup message will tell the player the advance, the building made obsolete, and the replacement building. Here's a sample of my code:
Then in "info_str.txt" I have the following string:
BUILDING_OBSOLETE_1 "Our knowledge of {advance[0].name} has made the improvement {building[0].name} obsolete. However we can now build the {building[1].name} improvement instead."
Now everything works except when I get the popup message in-game, where it should say "Bazaar" it says "{building[0].name}" and where it should say "Brokerage" it says "{building[1].name}". I don't get it.
Please help!
Code:
messagebox 'BUILDING_OBSOLETE_1_MSG' { Text(ID_BUILDING_OBSOLETE_1); Show(); } HandleEvent(GrantAdvance) 'BuildingExpires' post { int_t advanceType; advanceType = value[0]; advance[0] = advanceType; if (advanceType == AdvanceDB(ADVANCE_ECONOMICS)) { building[0] = BuildingDB(IMPROVE_BAZAAR); building[1] = BuildingDB(IMPROVE_BROKERAGE); Message(player[0], 'BUILDING_OBSOLETE_1_MSG'); } }
BUILDING_OBSOLETE_1 "Our knowledge of {advance[0].name} has made the improvement {building[0].name} obsolete. However we can now build the {building[1].name} improvement instead."
Now everything works except when I get the popup message in-game, where it should say "Bazaar" it says "{building[0].name}" and where it should say "Brokerage" it says "{building[1].name}". I don't get it.
Please help!
Comment