-
February 26, 2017, 08:02 PM
#1
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?
-
February 28, 2017, 05:38 PM
#2
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.
-
February 28, 2017, 06:24 PM
#3
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
-
Forum Rules