1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Command to get Production in a city

Discussion in 'CivBE - Modding Help & Mod Creation' started by Starrynite120, Apr 27, 2016.

  1. Starrynite120

    Starrynite120 Chieftain

    Joined:
    Jul 15, 2015
    Messages:
    472
    What is the command that gives you how much production a city is giving? City:GetProduction gives you the progress towards whatever you're building, but I want the production yield.

    Also, how do I get your energy per turn instead of how much you have amassed? Player:GetEnergy just gives you your total.
     
  2. Machiavelli24

    Machiavelli24 Mod creator

    Joined:
    May 9, 2012
    Messages:
    818
    The command to get Energy per turn is:
    Code:
    player:CalculateGoldRate()
    Yes, that is Gold not Energy. I guess it didn't get swept up in the find replace.
     
  3. Starrynite120

    Starrynite120 Chieftain

    Joined:
    Jul 15, 2015
    Messages:
    472
    Great, thanks. Do you know about getting production per city? Like I said, getproduction gets how much you've invested in whatever you're building not your yield.
     
  4. Ryika

    Ryika likes cookies and milk.

    Joined:
    Aug 30, 2013
    Messages:
    8,323
    CityView.lua uses city:GetYieldRate(YieldTypes.YIELD_PRODUCTION)
     

Share This Page