improvements that produce tourism

Ambug666

Chieftain
Joined
Jun 23, 2009
Messages
92
So let's say I create a new Yield in the XML, YIELD_TOURISM, and I create an improvement that produces it.

Where would I go in the LUA to add that tourism to the player's total and how would I get the amount of tourism produced by improvements?
 
Is there a way to modify Player.GetTourism?

Is there a way to get all of the yield of something, like YIELD_FOOD, a player produces?
 
Here's something interesting. I did create a new Yield, and an improvement that produced it, just to see what it would do. Nothing, of course, BUT Workshops, Windmills, and other buildings that produce YIELD_PRODUCTION, produce 1554452196 of my new yield. I thought that was interesting.
 
Is there a way to modify Player.GetTourism?

Only by modding the DLL.

The Lua Player:GetTourism() method is a wrapper on the C++ code in the DLL. This wrapping is one way.

While you could replace the Lua method with your own, that would only affect the lua code (typically the UI) and NOT the C++ code - so the core DLL code would still be using the original C++ method. A sure fire way to confuse your players.
 
Is there a way to get all of the yield of something, like YIELD_FOOD, a player produces?

Gold, science, culture, tourism, faith and happiness can all be found in the TopPanel.lua file for both total and per turn.

If there arn't player totals for production and food, these could be calculated by summing the values for every city a player controls.

While there appear to be six yields - prod, food, gold, science, culture and faith - the last two are handled as special cases within the DLL.

Tourism and happiness are not yields, and again are handled as special cases.
 
Back
Top Bottom