Page 1 of 2 12 LastLast
Results 1 to 20 of 23

Thread: List of scripting effects for Ancillaries and Traits

  1. #1

    Default List of scripting effects for Ancillaries and Traits

    It was a long research from posts dating back to 2005, some of them were pretty hard to find, others were right here on TWC but scattered all around the Workshop(s). Hunting down every attribute and trait related function for characters and buildings was fun and frustrating at the same time. But now I think I have them all, so I want to share this list where I've noted what each command does and which character or building type it affects. Having everything in a single comprehensive list helps immensely.
    I hope it does for you too.


    MTW2 SCRIPTING EFFECTS FOR ANCILLARIES AND TRAITS TIED TO CHARACTERS


    Effect Trading - in % Trade Income
    Effect TaxCollection - in % Tax Income
    Effect Subterfuge - in points, Subterfuge Skill level (increases chances of spying in a settlement)
    Effect Sabotage - in points, Sabotage Skill level (increases cheances of sabotaging in a settlement)
    Effect LocalPopularity - in points, Public Order level when character is in a settlement
    Effect TroopMorale - in points, Global Troop Morale level
    Effect HitPoints - in points, Hitpoint level (General only) how many hits he can take before dying
    Effect Construction - in % Construction Cost discount
    Effect Squalor - in points, Public Order level and Population Growth level
    Effect BribeResistance - in points, Bribing resistance level
    Effect Assassination - in points, Assassin Skill level
    Effect PersonalSecurity - in points, chance of detecting and preventing Assassination attempts (characters)
    Effect PublicSecurity - in points, chance of detecting and preventing Sabotage attempts (settlements)
    Effect Authority - in points, Authority level (affects chances of desertion from captain-lead armies)
    Effect MovementPoints - in % Movement Points
    Effect SiegeEngineering - in points, Siege Equipment building points
    Effect Farming - in points, Farming Output level
    Effect Mining - in % Mining Income
    Effect LineOfSight - in points, Line of Sight (detecting enemies nearby)
    Effect Unrest - in points, negative Public Order
    Effect Law - in points, positive Public Order
    Effect BattleSurgery - in points, chance of recovering men from their wounds after battle (fewer global losses)
    Effect TrainingUnits - in % Training units discount
    Effect TrainingAgents - in % Training agents discount
    Effect Influence - in points, Influence level, increase chances of successfully achieving a diplomatic action (for Diplomats)
    Effect Charm - in points, Charm level (same as Influence, but for princesses)
    Effect Finance - in points, Finance level (same as Influence, but for merchants)
    Effect Piety - in points, Piety level (same effect as Subterfuge, but for Priests)
    Effect Unorthodoxy - in points, chances for a Priest to be converted by an heretic, going against the church
    Effect Chivalry - in points, Chivalry level \ mirror of Dread (boosts own troops' morale, improves Public Order - more than Dread)
    Effect Dread - in points, Dread level \ mirror of Chivalry (lowers enemies' morale in battle, improves Public Order and Population Growth)
    Effect Command - in points, Global Troop Morale level
    Effect NavalCommand - in points, Global Naval Morale level
    Effect CavalryCommand - in points, Cavalry Troop Morale level
    Effect GunpowderCommand - in points, Gunpowder Troop Morale level
    Effect ArtilleryCommand - in points, Artillery Troop Morale level
    Effect Loyalty - in points, Loyalty level for Generals (resistance to Bribing attempts and joining rebellions)
    Effect Violence - in points, likelyhood of calling a Crusade \ Jihad (Priests only)
    Effect Looting - in % money gained from looting a settlement
    Effect SiegeAttack - in points, attack bonus for Troops when in a Siege battle
    Effect SiegeDefence - in points, defence bonus for Troops when in a Siege battle
    Effect Attack - in points, attack bonus for Troops in battle
    Effect Defence - in points, defence bonus for Troops in battle



    BUILDINGS EFFECTS \ CAPABILITIES
    All work with points, unless specified


    wall_level X - city wall level, affects how big and resistant the walls are. From 0 to 4 (palisade, wooden, stone, large stone, huge stone)
    gate_strength X - city gate level, affects how strong the gate is to siege engines. From 1 to 2 (reinforced, iron)
    tower_level X - tower level, set if the city has a tower defense and which type. From 1 to 3 (arrow, ballista, cannon)
    law_bonus bonus X - in %, Public Order bonus due to law, this amount gets multiplied by 5
    recruitment_slots X - how many recruitment slots there are in this city
    stage_races X - triggers the cavalry races, total number of races allowed \ sacrifices in the americas campaign
    stage_games X - triggers the dances in the americas campaign
    free_upkeep X - units with the "free upkeep" ability in the EDU can be maintained in this city for free, depending on the number of slots available (defined here)
    happiness_bonus bonus - in %, Public Order bonus due to happiness, this amount gets multiplied by 5
    armour X - makes the building act like a blacksmith. It can upgrade the armor of the units, from 1 to 6
    trade_base_income_bonus bonus X - in %, Income bonus due to trade, this value gets multiplied by 5
    trade_fleets X - recruitment slots for trade fleets
    recruitment_cost_bonus_naval bonus X - in %, reduces the recruitment cost of the ships. This value gets multiplied by 10.
    agent X - trains the agent of the specified type in this settlement. It can be: named character, spy, assassin, merchant, admiral, princess, diplomat, priest, heretic, witch, inquisitor
    agent_limit "type" X - limits the number of trainable agents specified, in this settlement. The "type" is the agent, from the selection above.
    road_level X - sets a different road level for marching troops, from 0 to 2
    farming_level X - adds more farms in the settlement adding up to the global farming income.
    mine_resource X - adds more mimes in the settlement, adding up to the global mining income.
    population_health_bonus bonus X - increases health of the population in the settlement, this value gets multiplied by 5
    population_growth_bonus bonus X - increases growith of the population in the settlement, only half of this value gets calculated
    retrain_cost_bonus bonus X - reduces the cost to retrain units by 10%.
    weapon_naval_gunpowder X - upgrades the weapon level of the ships using artillery fire by the specified value
    weapon_missile_gunpowder X - upgrades the weapon level of the land troops using muskets and pistols by the specified value
    weapon_artillery_gunpowder X - upgrades the weapon level of the land artillery units by the specified value
    weapon_projectile X - upgrades the weapon level of all the gunpowder-able units, no matter the type, by the specified value
    weapon_melee_blade X - upgrades the weapon level of all the melee units, no matter the type, by the specified value
    religion_level bonus X - if the building is tied to a specific religion via convert_to "religion", then this value gets used and multiplied by 5.
    pope_disapproval X - sets the approval of the Pope to the specific amount
    amplify_religion_level X - increases the effectiveness of the religious buildings in converting the people by 33 \ 1\3 the number specified
    heavy_cavalry_bonus bonus X - adds the specified amount of experience to heavy cavalry troops trained in this settlement
    gun_bonus X - adds the specified amount of experience to all gunpowder-able units trained in this settlement
    archer_bonus X - adds the specified amount of experience to all archer units trained in this settlement
    cavalry_bonus X - adds the specified amount of experience to all cavalry units trained in this settlement
    navy_bonus X - gives an experience bonus to the ships.

  2. #2
    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,047
    Blog Entries
    35

    Default Re: List of scripting effects for Ancillaries and Traits

    Great stuff - thanks for putting it all in one place.

    Maybe add a separate list of stuff that doesn't work in case someone might wonder why it isn't listed? Like taxable_income_bonus.
    Last edited by Gigantus; October 12, 2016 at 10:57 PM.










  3. #3

    Icon14 Re: List of scripting effects for Ancillaries and Traits

    This is a great find! Wow! I'll be using this in the future a lot!

    I did happen to notice that a few from the buildings attributes were missing from this list. Here they are:


    weapon_melee_simple X -- upgrades all units that use a "blunt" weapon (peasants, ships, religious fanatics, etc.).

    weapon_missile_mechanical X -- upgrades the side arms of all archers.

    weapon_artillery_mechanical X -- upgrades the side arms of siege engine crews.

    trade_level_bonus bonus X -- upgrades the entire trade level of the settlement, vastly more powerful than "trade_base_etc."

    income_bonus bonus X -- adds the amount of income to that building.


    And now the more difficult ones:

    taxable_income_bonus bonus X -- when placed under "construction_cost_bonus_stone bonus X" with the same number, allows the stone reduction benefit to work.

    Example:

    Code:
    construction_cost_bonus_stone bonus 5 
    taxable_income_bonus bonus 5
    Same applies to the wooden cost reduction attribute:

    Code:
    construction_cost_bonus_wooden bonus 5 
    population_loyalty_bonus bonus 1     (where 1 stands for 5%)

    These are just some that I noticed missing from the list. It may be that there are more that modders have created since this list was first created. Still, this is an awesome work and so very useful. Thanks for taking the time to make this list for us!

  4. #4
    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,047
    Blog Entries
    35

    Default Re: List of scripting effects for Ancillaries and Traits

    taxable_income_bonus bonus X -- when placed under "construction_cost_bonus_stone bonus X" with the same number, allows the stone reduction benefit to work.
    That is surprising, because 'taxable income' doesn't work itself.










  5. #5

    Default Re: List of scripting effects for Ancillaries and Traits

    Quote Originally Posted by Gigantus View Post
    That is surprising, because 'taxable income' doesn't work itself.
    Yeah, I know, but if you look at Stainless Steel, they have the stonemason set up like this. It took me a long time to figure out that the "tax" line was necessary to get the stone benefit to work. I still do not know why that is. And the same goes for the Logging Camp. Someone figured that one out while creating that mod.

  6. #6

    Default Re: List of scripting effects for Ancillaries and Traits

    As far as I'm aware, construction_cost_bonus_stone works normally. It reduces the construction cost by the given value as a percentage with no multiplier, e.g. construction_cost_bonus_stone bonus 30 would be a 30% reduction in the cost of stone buildings in that settlement.

    The line numbers of building effects in EDB don't matter - all the effects simply contribute to the totals for the settlement the building is located in. I suspect you messed something up while testing and reached a confused conclusion about the necessity of taxable_income_bonus.

  7. #7
    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,047
    Blog Entries
    35

    Default Re: List of scripting effects for Ancillaries and Traits

    There is also the small matter that most buildings are made of wood (178 in vanilla), while some are made of stone (25 in vanilla). It's easy to mix that up and come to the conclusion that one of the bonuses doesn't work.










  8. #8

    Default Re: List of scripting effects for Ancillaries and Traits

    Quote Originally Posted by Callistonian View Post
    As far as I'm aware, construction_cost_bonus_stone works normally. It reduces the construction cost by the given value as a percentage with no multiplier, e.g. construction_cost_bonus_stone bonus 30 would be a 30% reduction in the cost of stone buildings in that settlement.

    The line numbers of building effects in EDB don't matter - all the effects simply contribute to the totals for the settlement the building is located in. I suspect you messed something up while testing and reached a confused conclusion about the necessity of taxable_income_bonus.
    Actually, I discovered it by modding Stainless Steel. That line was there and I didn't understand why, so I removed it as well as the line for wooden bonus. Then, in the game, there was zero benefit right at the start. So I went back and put the line back in and it worked, but ONLY if it came AFTER the stone bonus line.

    I found in another file the names of the weird lines and to my surprise, they were set to give a stone bonus and a wood bonus. I tried removing those benefits from the weird named lines and it still didn't work. In the end, I was forced to put everything back the way it was. It's something that someone who made Stainless Steel came up with. I just accept it.

    And yes, Gigantus is right (although it's not a small matter ), the stone bonus is very limited in value, so I gave my Masons Guild an equal amount of both stone and wooden bonus, so it helps with every building. This is the first level of my Masons Guild in Bare Geomod and it works fine:

    Code:
    capability
                {
                    construction_cost_bonus_stone bonus 20 
            taxable_income_bonus bonus 20 
                    construction_cost_bonus_wooden bonus 20 
            population_loyalty_bonus bonus 4 
                }
    But since you bring it up, I might try the stone bonus line alone again to see if it works on its own or not. I also seem to remember long ago that it didn't need that other line below it, but it was a long time ago, and I don't trust my memory anymore.

  9. #9

    Default Re: List of scripting effects for Ancillaries and Traits

    OK, after some testing and perusing of TWC, I think I found the source of the confusion.

    The material of the final building level in a chain is what determines the material of every level in the chain. For example, if we do this with the city church building chain:

    Code:
    small_church - wooden
    church - wooden
    abbey - wooden
    cathedral - wooden
    huge_cathedral - stone
    The entire chain is now considered stone and the construction_cost_bonus_stone will apply to every level of the chain. Conversely, if we just make the 'church' level stone while the 'huge_cathedral' is wooden, the construction_cost_bonus_stone won't apply anymore to any level of the chain.

    I was tipped off to this fact by this guide which is a lot more thorough than the OP here. It mentions that the 'whole tree', which I refer to as the 'building chain' consisting of multiple levels, must be one material or the other, but it doesn't mention how the chain acquires the material. The answer is that the chain's material comes from the material of the last level in the chain.

    The reason Stainless Steel and other mods associate a taxable_income_bonus effect with construction_cost_bonus_stone (or wooden) is because the former has a visible text effect on the building info scroll in-game while the latter does not. This trick using taxable_income_bonus with a renamed text effect comes from posts like this one.


    Edit: Another thing I found during testing is that the 'bonus' part isn't necessary for these effects to work. It probably isn't necessary for any EDB effects. In other words, these two lines are equivalent:

    Code:
    construction_cost_bonus_wooden bonus 50
    construction_cost_bonus_wooden 50
    Last edited by Callistonian; November 23, 2023 at 09:31 PM.

  10. #10

    Icon14 Re: List of scripting effects for Ancillaries and Traits

    Wow. That's an interesting guide, but it seems to leave out more than it answers. At least I can check up on some of those things.

    I do seem to remember that if I removed the taxable income line, then there was nothing listed under the benefits line for the masons guild. It was just empty. Only a description of the guild appeared. But I also seem to remember that when I scrolled over buildings after I had the guild or the stonemasons hut, there was no bonus applied if that other line was missing. Like I said, I just gave up on trying to fix it and just went with whatever SS 6.4 was doing. And yet, looooong ago, I seem to remember that line NOT being used in the masons guild edb script. I did figure out that the line taxable_income-blah, blah, allowed the stone bonus line to appear in text in the building info panel (while the taxable income line was invisible). At that point, I decided it was just all over my head and moved on.

    "The entire chain is now considered stone and the construction_cost_bonus_stone will apply to every level of the chain. Conversely, if we just make the 'church' level stone while the 'huge_cathedral' is wooden, the construction_cost_bonus_stone won't apply anymore to any level of the chain."

    Are you sure about this? I tried changing the materials of the buildings in the church tree and it did not work for me in the past. Someone, (Gigantus perhaps?) told me that the material line in the edb was only for graphical rendering of the building on the battle map. Still, I'm gonna try and see if I can get the stone bonus to work on churches since they are so obviously made of stone. Guess I need to check the cathedral line first. The southern_eurpoean churches are all of stone, but eastern and northern_eurpoean churches are made of wood. Gonna go look at that now.

    This might also explain why wooden walls and dirt roads are only affected by the stonemason and not the logging camp.

    Thanks for that information Callistonian! Let us know what else you find out.

  11. #11
    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,047
    Blog Entries
    35

    Default Re: List of scripting effects for Ancillaries and Traits

    Someone, (Gigantus perhaps?) told me that the material line in the edb was only for graphical rendering of the building on the battle map
    Nope, certainly not me, nor the case. It's more a case of reference for this file: descr_building_battle, eg health level










  12. #12

    Default Re: List of scripting effects for Ancillaries and Traits

    Quote Originally Posted by Gigantus View Post
    Nope, certainly not me, nor the case. It's more a case of reference for this file: descr_building_battle, eg health level

    Au contraire! I am now one hundred percent sure it was you who told me that.

    I have NO memory problems. None.

  13. #13

    Default Re: List of scripting effects for Ancillaries and Traits

    Quote Originally Posted by Nordlaender View Post
    Wow. That's an interesting guide, but it seems to leave out more than it answers.
    Yeah, quite a few lines have no information. But there are some very interesting comments below the table. Here is my current version of the Docudemons which contains a lot more verified information in one place.

    Quote Originally Posted by Nordlaender View Post
    I do seem to remember that if I removed the taxable income line, then there was nothing listed under the benefits line for the masons guild.
    Again, this is because taxable_income_bonus has a visible text effect in the building info scroll while construction_cost_bonus_stone(and wooden) does not. Someone modding Stainless Steel simply changed the SMT_CAPABILITY_TAXABLE_INCOME_BONUS text in strat.txt so that it would say something about construction costs instead of tax bonuses.

    Quote Originally Posted by Nordlaender View Post
    Are you sure about this? I tried changing the materials of the buildings in the church tree and it did not work for me in the past.
    But did you change the material of the last level in the chain? I tested by changing the materials of the levels of the church building in my sandbox version of the vanilla game (basically Bare Geomod 2.2.3). I added a construction_cost_bonus_stone to the core building which is present in London and inspected building costs when playing as england. The second 'church' level is what is available for construction in London on turn 0, and I found that by changing the material only of the last level in that chain, 'huge_cathedral', to stone, the construction_cost_bonus_stone from the core building would be applied to the 'church' upgrade (and all subsequent upgrades). My conclusion is that the material of the entire chain derives from the material of the last level in the chain.

    Quote Originally Posted by Nordlaender View Post
    This might also explain why wooden walls and dirt roads are only affected by the stonemason and not the logging camp.
    Indeed, the city walls in vanilla are stone because, although the first few levels (wooden_pallisade, wooden_wall) are wooden, the last level (huge_stone_wall) is stone. So you will actually get the construction_cost_bonus_stone bonus for the wooden pallisade and wall. To me, this indicates a bug - someone at CA wanted to script materials for individual building levels but someone else programmed buildings to only have one material per chain.

  14. #14

    Default Re: List of scripting effects for Ancillaries and Traits

    "Again, this is because taxable_income_bonus has a visible text effect in the building info scroll while construction_cost_bonus_stone(and wooden) does not. Someone modding Stainless Steel simply changed the SMT_CAPABILITY_TAXABLE_INCOME_BONUS text in strat.txt so that it would say something about construction costs instead of tax bonuses."

    Yeah, that's exactly what happened. It took me a long time to figure it out, but I never really knew or understood that some benefits did not have in game text while others had in game text, but no benefits. You put it very succinctly there. Thanks!

    "But did you change the material of the last level in the chain? "

    I have now, and it seems to be working. I'm amazed you found that out.

    "So you will actually get the construction_cost_bonus_stone bonus for the wooden pallisade and wall. To me, this indicates a bug - someone at CA wanted to script materials for individual building levels but someone else programmed buildings to only have one material per chain."

    I bet you're right about that. Roads used to be wooden, but then I changed the paved roads to stone and I no longer got a bonus on dirt roads from the logging camp. I never knew what I had done to cause that. Now I know.

  15. #15

    Default Re: List of scripting effects for Ancillaries and Traits

    Quote Originally Posted by Gigantus View Post
    Nope, certainly not me, nor the case. It's more a case of reference for this file: descr_building_battle, eg health level

    I read that file and yes, someone did refer me to that file, but not specifically. I found it in the main root of MTW2, and it clearly states that it shows what buildings are made of on the battle map. I guess they also are harder to destroy if they are made of stone.

    I remember in a version of Stainless Steel that I would just roll up to Al-aqaba and just throw stones at their temple and other buildings and then withdraw. Lol... I was just forcing the AI to rebuild all that stuff. I can't seem to replicate it in Bare Geomod, but probably because I am not familiar with that file or how to mod it.

  16. #16

    Default Re: List of scripting effects for Ancillaries and Traits

    This also exist on the wiki for building effects:
    https://wiki.twcenter.net/index.php?...ngs.txt_-_M2TW


  17. #17

    Default Re: List of scripting effects for Ancillaries and Traits

    "Yeah, quite a few lines have no information. But there are some very interesting comments below the table. Here is my current version of the Docudemons which contains a lot more verified information in one place."

    I just downloaded your docudemons and it opened up in Microsoft XML! That's the first time I've seen ANY file in MTW2 in table format. Wow!

    Thanks for doing that. I may try to open other files in XML or in OpenDoc, a freeware word processing program I used before I got stuck with Microsoft Office.

    This is VERY useful.

  18. #18

    Default Re: List of scripting effects for Ancillaries and Traits

    That's very interesting and useful. I never thought that there might be hardcoded limits to such things as law_bonus or happiness_bonus. I'm just now learning that there are limits and I need to go through my EDB file and make sure they don't go over the limits, although I also have negative effects going on as well, so they may even out some. I still need to check it though.

    Thanks for this link Gebilde!

  19. #19
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    8,419

    Default Re: List of scripting effects for Ancillaries and Traits

    Quote Originally Posted by Nordlaender View Post
    That's very interesting and useful. I never thought that there might be hardcoded limits to such things as law_bonus or happiness_bonus. I'm just now learning that there are limits and I need to go through my EDB file and make sure they don't go over the limits, although I also have negative effects going on as well, so they may even out some. I still need to check it though.
    Thanks for this link Gebilde!
    Neither have I realised there's such upper limit, thanks @Nordlaender.
    JoC

  20. #20

    Default Re: List of scripting effects for Ancillaries and Traits

    You're welcome, but it was actually someone else who brought this to my attention by putting up a link.

    I noticed that 5 seems to be a common limit for many things such as happiness, law, population, etc. If I have something set at +6 happiness, I wonder if the game just ignores that and sees it as 0 happiness? That's what really concerns me. I may limit most of the top bonuses to 5 unless someone has proven that one or another will go above 5. I know you can have 6 free upkeep slots, but that's a different thing to settlement mechanics.

    Too bad we cannot have 5 outgoing trade fleets.

Page 1 of 2 12 LastLast

Posting Permissions

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