Results 1 to 3 of 3

Thread: upkeep_expenditure_percent - function help

  1. #1
    Jake Armitage's Avatar Artifex
    Patrician

    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    4,694

    Default upkeep_expenditure_percent - function help

    I have problems with the "upkeep_expenditure_percent" function.
    It seems it does nothing.

    I have a script (the one below) and it's not triggering:

    local function Turtle_Upkeep(context)
    local factionName = context.string
    if context:faction():is_human() == true and context:faction():region_list():num_items() == 6
    then scripting.game_interface:upkeep_expenditure_percent(factionName, 20)
    end
    end

    but, if i put the same script with another function (like treasury_mod):

    local function Turtle_Upkeep(context)
    local factionName = context.string
    if context:faction():is_human() == true and context:faction():region_list():num_items() == 6
    then scripting.game_interface:treasury_mod(factionName, 20)
    end
    end

    ...well, now changes takes places in campaign.

    Anyone?

  2. #2
    Litharion's Avatar Artifex
    Join Date
    Sep 2013
    Location
    Germany
    Posts
    2,622

    Default Re: upkeep_expenditure_percent - function help

    The function upkeep_expenditure_percent is part of the faction script interface and not actually designed to change the game. If used correctly it will return an integer value with the average tax level for the faction.

    like:

    return context:faction():upkeep_expenditure_percent()

    will return an integer value for example 40.

    If you want to influence the upkeep value or income values you should use

    scripting.game_interface:apply_effect_bundle("EFFECT_KEY","FACTION_KEY", INTEGER)
    -- INTEGER = turn number, 0 is infinite.
    -- FACTION_KEY = faction name for example rom_rome

    you can remove it with

    scripting.game_interface:remove_effect_bundle("EFFECT_KEY","FACTION_KEY")
    Last edited by Litharion; February 28, 2017 at 05:42 PM.

  3. #3
    Jake Armitage's Avatar Artifex
    Patrician

    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    4,694

    Default Re: upkeep_expenditure_percent - function help

    Thank yo for the answer, Litharion.

    I'll give a try and if have problems i'll ask help again.

    Tx.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •