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

Won't player:GetStats() work correctly on Firetuner?

Discussion in 'Mod Creation Help' started by seed.of.apricot, Dec 27, 2017.

Tags:
  1. seed.of.apricot

    seed.of.apricot Chieftain

    Joined:
    Mar 24, 2015
    Messages:
    8
    On Firetuner, I tried this:
    Code:
    function()
       local listItems = {};
        listItems[1] = Players[0]:GetCulture():GetCultureYield();
        return listItems;
    end
    it returned some value.
    However, when I tried this:
    Code:
    function()
       local listItems = {};
       listItems[1] = Players[0]:GetStats():GetTourism();
       return listItems;
    end
    it said
    Code:
    Failed to populate list:
    Runtime Error: [string "return function()..."]:3: function expected instead of nil
    stack traceback:
    	[string "return function()..."]:3: in function '(anonymous)'
    Lua callstack:
    So cannot I use this method to obtain the total yield of tourism or total military strength?
    I'm considering using GetCulture():GetTourismAt( plotID ) for all the plots in the map or adding up all the strength across the map instead.
     

Share This Page

Ebates: Get Paid to Shop