Results 1 to 9 of 9

Thread: M2TW- Buildings and religion

  1. #1

    Default M2TW- Buildings and religion

    I would like to add some wonders to certain cities that can help with religious conversion if owned by the "correct" religion. For example, if Jerusalem with a wonder "The Holy Sepulchre", is owned by a Catholic faction, the wonder would help convert the populace to Catholicism, but would not convert the populace if owned by an Islamic faction. Is this at all possible?

  2. #2
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: M2TW- Buildings and religion

    Something like this...

    Code:
    building hinterland_wonder
    {
        convert_to hinterland_wonder
        religion catholic
        levels wonder
        {
            wonder requires factions { } 
            {
                convert_to 0
                capability
                {
                    religion_level bonus 1 requires factions { normans, denmark, hre, scotland, france, england, hungary, poland, venice, papal_states, portugal, spain, sicily, milan, } 
                }
                material wooden
                construction  1 
                cost  800 
                settlement_min town
                upgrades
                {
                }
            }
        }
        plugins 
        {
        }
    }
    The blue ones are the catholic factions; only the factions in that list will get the bonus.

  3. #3

    Default Re: M2TW- Buildings and religion

    It is, just remember that any building can only convert to one religion.

    Also note in the example above, that is an uncapped conversion. If you want it to stop applying at a certain level add and not region_religion catholic XX to it, where XX is the % you want to cap at.

  4. #4

    Default Re: M2TW- Buildings and religion

    I haven't playtested this enough yet to be sure that it works as I think it does, but you could also use the amplify_religion_level, which gives an increase to the conversion bonus for whatever conversion bonuses are there. So, by itself, the building will not convert, but if you have a 2% conversion bonus in the city and a building that amplifies conversion bonuses by 100%, then you've got 4%. Then you can also have the building give a positive bump for some factions, and a negative one for others. Something maybe like the following:

    Code:
    building hinterland_wonder
    {
        convert_to hinterland_wonder
        levels wonder
        {
            wonder requires factions { } 
            {
                convert_to 0
                capability
                {
                    amplify_religion_level 2 requires factions { normans, denmark, hre, scotland, france, england, hungary, poland, venice, papal_states, portugal, spain, sicily, milan, }
                    amplify_religion_level -2 requires faction { turks, mongols, egypt, moors, timurids, }
                }
                material wooden
                construction  1 
                cost  800 
                settlement_min town
                upgrades
                {
                }
            }
        }
        plugins 
        {
        }
    }
    As far as I can tell, this would then allow you to attach a bonus/malus for factions of different religions, whereas the tag religion catholic will prevent that.

    Also, someone correct me if I'm wrong, but if a building is locked to a certain religion, then that building will automatically be destroyed whenever the settlement is conquered by someone from a differenct religion, right? In digging through the EDB and campaign script, there is no destroy buildings line, so I assume that must be simply coded in there. Any info on this would be very helpful for my own work right now.
    | Community Creative Writing
    | My Library
    | My Mapping Resources
    | My Nabataean AAR for EBII
    | My Ongoing Creative Writing

  5. #5
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: M2TW- Buildings and religion

    As far as I remember, this functionnality is included in the "temple" buildings in EDB. If you call your building temple_something, then you will only be able to build one in each city and it will auto destruct when cdonquering a city with a different religion. The temple_ has hardcoded functionalities. in red here
    Code:
    building temple_horus-re
    {
        levels small_temple_horus-re temple_horus-re large_temple_horus-re
        {
            small_temple_horus-re requires factions { moors, sicily, }
            {
                capability
                {
                law_bonus bonus 2
                }
                material wooden
                construction  6
                cost  2000
                settlement_min large_town
                upgrades
                {
                temple_horus-re
                }
            }
            temple_horus-re requires factions { moors, sicily, }
            {
                capability
                {
                law_bonus bonus 4
                }
                material wooden
                construction  10
                cost  5000
                settlement_min city
                upgrades
                {
                large_temple_horus-re
                }
            }
            large_temple_horus-re requires factions { moors, sicily, }
            {
                capability
                {
                law_bonus bonus 6
                }
                material wooden
                construction  15
                cost  10000 
                settlement_min large_city
                upgrades
                {
                }
            }
        }
        plugins 
        {
        }
    }
    If you want to have multiple religions in a city, then you must use other names and it will also remove the auto-destruct. Like in the following
    Code:
    building church_corellon_larethian
    {
        levels church_corellon_larethian temple_corellon_larethian cathedral_corellon_larethian
        {
            church_corellon_larethian requires factions { papal_states, russia, }
            {
                capability
                {
                    recruits_exp_bonus bonus 1
                    recruit_pool "Yuirwood Druids"  5   5   5  0  requires factions { russia, } and hidden_resource yuirwood
                }
                material wooden
                construction  6
                cost  2000
                settlement_min large_town
                upgrades
                {
                temple_corellon_larethian
                }
            }
            temple_corellon_larethian city requires factions { papal_states, russia, }
            {
                capability
                {
                    recruits_exp_bonus bonus 2
                    recruit_pool "Yuirwood Druids"  5   5   5  0  requires factions { russia, } and hidden_resource yuirwood
                }
                material wooden
                construction  10
                cost  5000
                settlement_min city
                upgrades
                {
                cathedral_corellon_larethian
                }
            }
            cathedral_corellon_larethian city requires factions { papal_states, russia, }
            {
                capability
                {
                    recruits_exp_bonus bonus 4
                    recruit_pool "Yuirwood Druids"  5   5   5  0  requires factions { russia, } and hidden_resource yuirwood
                }
                material wooden
                construction  15
                cost  10000 
                settlement_min large_city
                upgrades
                {
                }
            }
        }
        plugins 
        {
        }
    }

  6. #6
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: M2TW- Buildings and religion

    "temple_" isn't the cause of auto-destruction, "religion" is and only if the building has a "city or "castle" qualifier.

  7. #7

    Default Re: M2TW- Buildings and religion

    Quote Originally Posted by Withwnar View Post
    "temple_" isn't the cause of auto-destruction, "religion" is and only if the building has a "city or "castle" qualifier.
    Yeah, I've been reading through a bunch of different posts that came up in my search for destroy_buildings, and found this just now, that auto-destruct only applies to things with the temple_ prefix and the city/castle bit as well. Small random query related to this though:

    If I take out the castle/city qualifier, delete the other building tree (e.g. delete the castle_farms line, so there is only the farms line), and then just tell the building tree to convert to itself, I should be able to then make all the buildings buildable in both castle and city, and have them stay put when I convert over, right? That seems to be what is in the vanilla files for some of the standard structures, and (I assume) there aren't errors there. Example from farms:
    Spoiler Alert, click show to read: 

    Code:
    building hinterland_farms
    {
        convert_to hinterland_farms
        levels farms farms+1 farms+2 farms+3 
        {
            farms  requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, } 
            {
                convert_to 0
                capability
                {
                    farming_level 1
                }
                material wooden
                construction  2 
                cost  600 
                settlement_min village
                upgrades
                {
                    farms+1
                }
            }
            farms+1  requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, } 
            {
                convert_to 1
                capability
                {
                    farming_level 2
                }
                material wooden
                construction  3 
                cost  1200 
                settlement_min town
                upgrades
                {
                    farms+2
                }
            }
            farms+2  requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, } 
            {
                convert_to 2
                capability
                {
                    farming_level 3
                }
                material wooden
                construction  4 
                cost  2400 
                settlement_min large_town
                upgrades
                {
                    farms+3
                }
            }
            farms+3  requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, } 
            {
                convert_to 3
                capability
                {
                    farming_level 4
                }
                material wooden
                construction  6 
                cost  4800 
                settlement_min city
                upgrades
                {
                }
            }
        }
        plugins 
        {
        }
    }

    If that works as I think/hope it does, this will be a serious breakthrough for my modding abilities!
    | Community Creative Writing
    | My Library
    | My Mapping Resources
    | My Nabataean AAR for EBII
    | My Ongoing Creative Writing

  8. #8

    Default Re: M2TW- Buildings and religion

    You can also remove the convert_to lines if you delete the city/castle requirement, I think.

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

    Default Re: M2TW- Buildings and religion

    The temple prefix prevents other buildings with the same prefix to be constructed. Most prominent example: the choice of multiple temples in RTW for a settlement. Once chosen only that line can be build, the others become unavailable.

    Auto destruct is as Withwnar says: it requires a combo of religion and city\castle.










Posting Permissions

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