Results 1 to 8 of 8

Thread: Question regarding Kings purse scripting

Hybrid View

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

    Default Question regarding Kings purse scripting

    Basically i'm scripting the kings purse to be based on the number of settlements owned and just wanted to double check if my work is correct....this is the first few lines of the scripting....also do i need to do a separate one for AI factions, or can i roll it right into the current one?

    ;------------------- KINGS PURSE -------------------;

    ;kings purse based on number of settlements owned by faction
    monitor_event PreFactionTurnStart FactionIsLocal
    and I_NumberOfSettlements = 1

    set_kings_purse 1000

    terminate_monitor

    end_monitor

    monitor_event PreFactionTurnStart FactionIsLocal
    and I_NumberOfSettlements = 2

    set_kings_purse 2000

    terminate_monitor

    end_monitor

    monitor_event PreFactionTurnStart FactionIsLocal
    and I_NumberOfSettlements = 3

    set_kings_purse 3000

    terminate_monitor

    end_monitor

  2. #2

    Default Re: Question regarding Kings purse scripting

    You can bundle all of them into a single monitor,
    Also the form correct forms are "I_NumberOfSettlements england == 1" and "set_kings_purse england 1000"
    As I doubt that it defaults to the local faction ( but I might be wrong )
    Code:
    monitor_event FactionTurnStart FactionIsLocal
      if I_NumberOfSettlements england == 1
         set_kings_purse england 1000
      end_if 
      if I_NumberOfSettlements england == 2
         set_kings_purse england 2000
      end_if 
      if I_NumberOfSettlements england == 3
          set_kings_purse england 3000
       end_if 
      if I_NumberOfSettlements france == 1
         set_kings_purse france 1000
      end_if 
    ...
    end_monitor
    Also is there a reason why you terminate the monitor ? Because that makes it pretty redundant as it will run the first turn and then end ( if that't the case you might aswel drop it entirely and set the kings purse in the desc_sm_factions based on howmany settlements a faction starts with.

  3. #3

    Default Re: Question regarding Kings purse scripting

    I guess my goal is to have every factions kings purse based on how many regions they control...i was hoping to avoid writing a separate script for every faction....I didn't realize that the terminate_monitor command would make it stop after the first turn, i'll surely change that....how would i accomplish this in the descr_sm_factions file? i did change all the starting kings purses to match the number of settlements in the descr_strat file...
    Last edited by valvegas1; November 02, 2011 at 03:34 PM.

  4. #4

    Default Re: Question regarding Kings purse scripting

    I meant if you terminate your monitors you could use the desc_sm factions.
    Since you want it to run every turn just ignore that comment!

    Just remove the "terminate_monitor" lines everywhere.

    I'm afraid you'll have to make seperate if statements for every faction though, but if you don't overdo it it shouldn't take very long. Don't forget that you can use < and > aswel.
    So "if I_NumberOfSettlements england > 5 " is also a viable option to prevent you having to write toomany if statements.

  5. #5

    Default Re: Question regarding Kings purse scripting

    ok thanks for the help

  6. #6

    Default Re: Question regarding Kings purse scripting

    ok one final quick question...how do i set a perameter of less than 10 but greater than 5? that would save me a lot of time....

  7. #7

    Default Re: Question regarding Kings purse scripting

    if I_NumberOfSettlements england > 5
    and I_NumberOfSettlements england < 11

    Will allow for any number of settlements of 6,7,8,9 and 10

    You will defintaly want to write the script for each faction. And u could if u are dedicated add all kinds of elements to such a script that would increase/decrease the income so its not solely based on settlement count, but things like number of Trade Agreements, Or Specific Buildings the faction owns (like a large Port), or how many Merchants are active, or whether the country is at war or not etc etc... I know that would make it a very detailed script... but i plan on working on something similar when i get off my ass and get back into finishing my lil mod ... Its the little things that all add up
    ...longbows, in skilled hands, could reach further than trebuchets...

  8. #8

    Default Re: Question regarding Kings purse scripting

    thanks for the input mate...when i'm done with this script i could share it with you to build on if you would like...i was actually thinking of adding a few other elements to the script as well...i'm just fairly new at the script writing and i haven't figured everything out yet...

Posting Permissions

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