Results 1 to 2 of 2

Thread: [scripting]How can I subtract AI & player's money?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Icon5 [scripting]How can I subtract AI & player's money?

    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:
    
    
    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!

  2. #2
    Slor's Avatar Civis
    Join Date
    Sep 2012
    Location
    Florida
    Posts
    102

    Default Re: [scripting]How can I subtract AI & player's money?

    You havent been able to do this since Shogun2 I believe. CA and there reasons

Posting Permissions

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