Results 1 to 12 of 12

Thread: Some questions about modding population growth

  1. #1

    Default Some questions about modding population growth

    Hey there,

    this post will contain a lot of questions, I would be really grateful if anyone could answer at least some of them.
    Also please excuse my very limited knowledge about coding, I hope I didn't made too many stupid mistakes...

    First, I'll describe my situation :
    I'm using a very large modification for m2tw kingdoms, in which only parts of the growth mechanisms work.
    Every influence on growth given directly from buildings, which means the farming capability and the constant bonuses on growth, simply doesn't work.
    I've already edited the settlements_mechanics script, but without any effect.

    So I decided to use the campaign_script to reenable these bonuses, here my idea about it:

    monitor_event FactionTurnStart FactionType hre
    and SettlementBuildingExists farms+1
    and SettlementBuildingExists wooden_pallisade

    add population 50

    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionType hre
    and SettlementBuildingExists farms+1
    and SettlementBuildingExists wooden_pallisade
    and event_counter very_good_harvest

    add population 20

    terminate_monitor
    end_monitor

    If a growth influencing buildings exists, a specific amount of population will be added and influenced further by the tier of the city and the harvest.

    First of all, I'd like to know wether this would work. Or is there a possible improvment?
    Also, will a settlement with wooden walls get the bonuses of the part with the wooden_pallisade condition?

    My second question about this topic is, wether there is command that directly influences the "SPF_FARMING_LEVEL" and "SPF_BUILDINGS" elements of population growth,
    which are mentioned in the settlement_mechanics script.

    The next thing I'd like to know is how I could show the amount of population, a settlement gained within a turn, within the settlement infoscroll.
    If this is impossible, I'll use historic events to show that.

    My last question is, wether it would be possible to only allow settlements to upgrade once in the campaign, for example like this:

    monitor_event SettlementUpgraded
    and SettlementBuildingExists stone_wall

    forbid construction of building large_stone_wall (Here I'd need a working command)

    terminate_monitor
    end_monitor

    I demand pretty much, but I hope anyone could help me somehow.

    Thank you very much in advance

  2. #2

    Default Re: Some questions about modding population growth

    1) you need to specify the settlement in question too, not just the buildings which are needed to activate the console command

    2)the Spf values are part of the settlement mechanics (don't think you can manipulate them via c_s)

    3)yeah sure, you can use as many historic events as you want to inform about the increase/decrease.

    4)to limit upgrades, you may want to use hidden resources in the EDB, but this might apply to a large scale, depending how you distribute the resources in the descr_regions. Via script I think is not viable due to lack of apposite commands (never seen before).


  3. #3
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: Some questions about modding population growth

    Let me approach this from the root: have you checked what the fertility levels of the regions are? If they are are zero then it's unlikely any bonus will have more then a minimal effect as all the other stuff are multipliers (multiplying zero will always be zero).

    And the format is: console_command add_population [settlement name], [value]










  4. #4

    Default Re: Some questions about modding population growth

    Thank you for your constructive replies.

    About the specification, could I also use a hidden resources condition instead of writing the small script part for every region/settlement?

    Gigantus, I have checked the feritility of the regions, and they are all above zero, so they're not the reason for this malfunction.
    I've tried very much to reenbale the complete growth mechanism and lost my hope to do this in the "normal" manner via editing export_descr_buildings, settlement_mechanics and descr_regions ...
    To use this opportunity: I'm working on the Rage of the Dark Gods mod, and I consider it to be extremely good, it beats even Total War Warhammer in my opinion. Very well done, Gigantus!

    Unfortunately, I do still have a question left:
    How can I show the actual value (the gained population in this turn) if I use historic events?
    I know how to create a historic event and add some text, but I don't know how I could show the values for the settlements under the players control within the scroll of the historic event.

    Many thanks in advance.

  5. #5

    Default Re: Some questions about modding population growth

    In case you use the hidden_resource, it will apply to all settlements where such given resource is registered in the descr_regions. So, try to put it only where you want the limitations.
    For the fertility values do not pass value 6 (otherwise too strong agriculture ahah)

    For the historic_events you can edit as you like. Just an example:

    {xxx_TITLE}Population decrease city A
    {xxx_BODY}Settlement: City A\n\nDue to the events occurred, there was a decrease in population in City A\nWhat a disaster!\n\nLoss of population: xxxxx

    the \n\n means a full empty line in the scroll that appears (no text), the \n means full stop, new line (without the empty space in the middle)
    And you can create as many h_e as you want according to the increase/decrease you look for.


  6. #6
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: Some questions about modding population growth

    I haven't got RodG installed at the moment so I can't check, but another possibility for the reduced fertility could be the entries in the descr_settlement_mechanics file. All entries prefixes with SPF are modifiers for population growth. If you could copy that section here then I could have a look if there are some values that can do with adjustment. Underneath are the defautl values:
    Code:
          <factor name="SPF_FARMING_LEVEL">
             <pip_modifier value="1.0"/>
             <castle_modifier value="0.7"/>
          </factor>
          <factor name="SPF_FARMS_BUILT">
             <pip_modifier value="1.0"/>
             <pip_min value="0"/>
             <pip_max value="25"/>
          </factor>
          <factor name="SPF_HEALTH">
             <pip_modifier value="1.0"/>
             <pip_min value="0"/>
             <pip_max value="25"/>
          </factor>
          <factor name="SPF_BUILDINGS">
             <pip_modifier value="0.5"/>
          </factor>
          <factor name="SPF_TAX_RATE_BONUS">
             <pip_modifier value="1.0"/>
          </factor>
          <factor name="SPF_BUILDINGS_FUN">
             <pip_modifier value="0.5"/>
             <pip_min value="0"/>
             <pip_max value="25"/>
          </factor>
          <factor name="SPF_GOVERNORS_INFLUENCE">
             <pip_modifier value="1.0"/>
             <pip_min value="0"/>
             <pip_max value="10"/>
          </factor>
          <factor name="SPF_TRADE">
             <pip_modifier value="0.12"/>
             <pip_min value="0"/>
             <pip_max value="25"/>
          </factor>
          <factor name="SPF_SQUALOUR">
             <pip_modifier value="0.8"/>
             <pip_min value="0"/>
             <pip_max value="32"/>
          </factor>
          <factor name="SPF_PLAGUE">
             <pip_modifier value="0.75"/>
          </factor>
          <factor name="SPF_TAX_RATE_PENALTY">
             <pip_modifier value="1.0"/>
          </factor>










  7. #7

    Default Re: Some questions about modding population growth

    Gigantus, I already knew about the settlement_mechanics script, and modified it in the past.
    The strange thing about it is, that every factor with influence on growth appears in the campaign but only the bonuses of buildings (population_growth_bonus x within export_description_buildings) and the farming level do not appear.
    I don't know any further solutions, so I decide to use the campaign_script instead.
    But still thank you for givin me the original values for the settlement_mechanics script.

    rafmc1989, I do not completely understand your post. The \n\n command creates a new line without any text, but how do I manage it, that there is written something like: Farms: population increase x; harvest : population increase y ... ?

    Also would the script work now?

    monitor_event FactionTurnStart FactionType hre Settlement Altdorf_province
    and SettlementBuildingExists farms+1
    and SettlementBuildingExists wooden_pallisade

    console_command add_population Altdorf_Province 50

    if health >= 10% (working command ?)
    console_command add_population Altdorf_Province 25

    if fun >= 10% (working command?)
    console_command add_population Altdorf_Province 10

    if public_order >= 150% (working command?)
    console_command add_population Altdorf_Province 10

    if tax_rate_low (working command?)
    console_command add_population Altdorf_Province 10

    if spualour >= 10% (working command?)
    console_command add_population Altdorf_Province -20

    if settlement_income >= 750 (working command?)
    console_command add_population Altdorf_Province 20

    if event_counter very_good_harvest (working command?)
    console_command add_population Altdorf_Province 25

    if I_FactionIsLocal
    historic_event GROWTH_REPORT

    terminate_monitor
    end_monitor

    I do need to know wether all of the conditions are working. I fsome parts, for example the tax rate bonus aren't working I'll just use the settlement_mechanics script.
    For the exact values, I do not require any further help, this part I can handle on my own.

    I demand very much of you, and I'm am sorry for that. My knowledge about the commands in mtw is not very advanced, please forgive me for that.

    Many thanks in advance.

  8. #8
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: Some questions about modding population growth

    Would you be talking about the 'improved farms and production +[level]' entry? The only way for that not to appear is by commenting out the bonus line in the EDB, eg putting a semi-colon in front of it.

    And no, that script will not work. Afaik the only thing you test for is the tax level, but a closer look through the conditions in the docudemons will help there.










  9. #9

    Default Re: Some questions about modding population growth

    [/QUOTE]rafmc1989, I do not completely understand your post. The \n\n command creates a new line without any text, but how do I manage it, that there is written something like: Farms: population increase x; harvest : population increase y ... ?[/QUOTE]

    You could do like this:

    {xxx_BODY}Settlement: City A\n\nDue to the events occurred, there was an increase in population in City A!\n\nIncrease due to farms built: +xxxxx\n\nIncrease due to better harvest: +xxxxx\n\netc. (and the same you can apply for the "decrease events")


  10. #10
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: Some questions about modding population growth

    This excample by rafmc
    Code:
    {xxx_BODY}Settlement: City A\n\nDue to the events occurred, there was an  increase in population in City A!\n\nIncrease due to farms built:  +xxxxx\n\nIncrease due to better harvest: +xxxxx\n\netc.
    Will display like this:

    Code:
    City A
    
    Due to the events occurred, there was an  increase in population in City A!
    
    Increase due to farms built:  +xxxxx
    
    Increase due to better harvest: +xxxxx
    
    etc.
    Note: there is no way to transfer the scripted value or settlement name to the message, it has to be entered. Making this a painful long list of messages required. Even with the script replicator this will be a long day.










  11. #11

    Default Re: Some questions about modding population growth

    Thank you very again.

    Gigantus, you are amazing! I've now been working and doing research on this problem for over three months. Removind the semicolons solved the matter completely, I greatly appreciate your help.

    Also thanks to both of you for giving me informations about how to add details to historic events, this will help me very much in the future.

    I do not require any more help form now on, due to this thread, I learned very much about how to code, and now, I am able to do a lot more modding on my own.

    Thank you very much again, you two helped me very well.

  12. #12
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: Some questions about modding population growth











Posting Permissions

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