Hey guys,
I would like to add some money to the faction if its treasury was more than a fixed amount or subtract some money if its treasury was less than a fixed amount.
Adding money way has works, it looks like this:
Code:
local function AddMoney(context)
local current_faction = context.string;
local treasury_count = context:faction():treasury();
if treasury_count <= 500 then
scripting.game_interface:treasury_mod(current_faction, 250);
end
end
scripting.AddEventCallBack("FactionTurnStart", AddMoney)
But I was not able to get it to work with scripting.game_interface:treasury_mod(current_faction, -250)
So I turned to other methods.
Has someone any experiences with the losing_money function and its parameters?
Code:
local function SubtractMoney(context)
local current_faction = context.string;
local treasury_count = context:faction():treasury();
if treasury_count >= 20000 then
-- Here I wanna subtract the faction's money when it more than 20000.
scripting.game_interface:losing_money(current_faction, 3000);
end
end
scripting.AddEventCallBack("FactionTurnStart", SubtractMoney)
I've tried to written this but it didn't work.
And the set_tax_disabled function doesn't work either.
Code:
local function SubtractMoney(context)
local current_faction = context.string;
local treasury_count = context:faction():treasury();
if treasury_count >= 20000 then
scripting.game_interface:set_tax_disabled(current_faction);
end
end
scripting.AddEventCallBack("FactionTurnStart", SubtractMoney)
Is there a way to subtract a faction's treatury?
Thanks in advance!