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

Thread: how to scripting conquest one of regions as condition

Hybrid View

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

    Default how to scripting conquest one of regions as condition

    I want to make script making an event coquest one of provinces in Syria. (conquest at least one of specific regions) It's going to be a condition to recruit units of knights orders.
    I've tryed to make it on the base of holds_constantinople event, but without success. Maybe someone has any idea how to resolve it?

  2. #2
    TSD's Avatar Ordinarius
    Join Date
    May 2008
    Location
    Chicago, IL
    Posts
    725

    Default Re: how to scripting conquest one of regions as condition

    Quote Originally Posted by attyla View Post
    I want to make script making an event coquest one of provinces in Syria. (conquest at least one of specific regions) It's going to be a condition to recruit units of knights orders.
    I've tryed to make it on the base of holds_constantinople event, but without success. Maybe someone has any idea how to resolve it?

    Im not sure if I understand.

    so when you conquer a province you want a certain unit to become recruitable? Do you specifically only want this unit recruitable if the region is conquered (i.e. what if you aqcuired it via diplomacy).

    Correct me if I am wrong fellow TWCers but couldnt he just use the hidden_resource constraint in the EDB and not have to script anything?

    Wait nm, you arent referring to a specific province but a general group of provinces. Perhaps you can use an OR operand in the EDB or event. i.e. hidden_resource Constantinople OR hidden_resource Athens etc. Although I have no clue if you can do that.
    Last edited by TSD; October 14, 2010 at 02:02 PM.

  3. #3

    Default Re: how to scripting conquest one of regions as condition

    No. It should make available units in every regions after conquering one of specific regions. For example i my mod i have 10 provinces in Syria region (Baghdad, Mosul, Antioch, Aleppo, Damascus, Acre, Jerusalem, Tripolis, Laodikeia and Homs) and i want to make knights orders units available after conquering one of those cities (for example after conquering Jeruralem or Damascus, or Acre or all of them).

    hidden resources are useless because i want to available recruiting of this unis in every place in the world.
    Last edited by attyla; October 14, 2010 at 02:44 PM.

  4. #4
    TSD's Avatar Ordinarius
    Join Date
    May 2008
    Location
    Chicago, IL
    Posts
    725

    Default Re: how to scripting conquest one of regions as condition

    Quote Originally Posted by attyla View Post
    No. It should make available units in every regions after conquering one of specific regions. For example i my mod i have 10 provinces in Syria region (Baghdad, Mosul, Antioch, Aleppo, Damascus, Acre, Jerusalem, Tripolis, Laodikeia and Homs) and i want to make knights orders units available after conquering one of those cities (for example after conquering Jeruralem or Damascus, or Acre or all of them).

    hidden resources are useless because i want to available recruiting of this unis in every place in the world.
    Then you would need an event.

    The key here is you would want the event to trigger when any of the provinces are captured, not just a specific one. Then add it to the recruit_pool line of the EDB. Again, i only do some minor scripting, so whether or not you can use an or operand in an event I dont know offhand, I havent diddled around in there in a while.

  5. #5

    Default Re: how to scripting conquest one of regions as condition

    I know i need new event
    As i wrote i tryed to modify standard trigger from Crusaders campaign, but i have no idea if and how can i use or operand in campaign script
    Anyway the original script holds_constantinople using two conditions (hold Constantinople and having more than 0 holding provinces - if i understand this script well), but two togeder only and i need to make something what will start event after serving one of needs, some of needs or all of needs.

    Vegas_Bear
    I know how to use events I have some trubles with making triggered events
    Last edited by attyla; October 14, 2010 at 03:32 PM.

  6. #6
    Vegas_Bear's Avatar Biarchus
    Join Date
    Sep 2005
    Location
    Las Vegas, NV
    Posts
    605

    Default Re: how to scripting conquest one of regions as condition

    Make a script so that the event counter equals 1, if you hold one of those regions. Then in EDB have your unit listed in the building string of your choice and add the text at the end for you event. Like the gunpowder event.

    Code:
    recruit_pool "Spanish Dragoons"  1   0.5   4  0  requires factions { spain, portugal, }  and event_counter gunpowder_discovered 1
    Change "gunpowder_discovered 1" to your event counter.

  7. #7

    Default Re: how to scripting conquest one of regions as condition

    Ok attyla i think i get your question.

    U want say like England conquers Paris(France) then they should be able to recruit XY unit when they do that? And there should be a historic event message as well?
    Is that so?
    And if so then do you want that unit XY only recruitable in paris or your entire english kingdom?

  8. #8
    TSD's Avatar Ordinarius
    Join Date
    May 2008
    Location
    Chicago, IL
    Posts
    725

    Default Re: how to scripting conquest one of regions as condition

    Quote Originally Posted by Ishan View Post
    Ok attyla i think i get your question.

    U want say like England conquers Paris(France) then they should be able to recruit XY unit when they do that? And there should be a historic event message as well?
    Is that so?
    And if so then do you want that unit XY only recruitable in paris or your entire english kingdom?

    Heres what he wants Ishan:

    A single event which is triggered by the capture of province X OR province Y OR province Z.....when triggered, X unit should be recruitable from any of his cities.

    So say something like this (just an example of what he wants to happen):

    The Romans will be able to build "praetorians" in any of their cities if they capture Athens OR Rhodes OR Sparta OR Illyria.

    So in his case he wants whatever his faction is to build units of knights orders in any of his cities, if they capture any one of a particular list of cities.

    I know this is easy if you simply want to take a single city and make the unit buildable in that city.

    Furthermore I think he wants if after he takes one of the provinces he has to at least hold one of them to continue to be able to build the units.
    Last edited by TSD; October 14, 2010 at 10:36 PM.

  9. #9

    Default Re: how to scripting conquest one of regions as condition

    It's the Power centre he wants i have explained it all here and he has read it too. So i don't know what else he wants.

  10. #10
    TSD's Avatar Ordinarius
    Join Date
    May 2008
    Location
    Chicago, IL
    Posts
    725

    Default

    AH HA! Ive figured it out!

    He can replicate your power center script for each city.

    THEN

    he can put in multiple recruit_pool lines for the unit with each one restricted by a different city event.

    i.e.

    recruit_pool bla bla bla and event_counter holds_constantinople 1
    recruit_pool bla bla bla and event_counter holds_rome 1
    recruit_pool bla bla bla and event_counter holds_athens 1

    Although if he holds all of the regions he will be able to recruit a hell of alot of those units.


    Your posting early Ishan, what is it somewhere around 8ish/9ish am by you? (I managed an offshore development team in Bangalore for awhile, we used to have conference calls around this time when they started their work day) oh wait a second, is it saturday morning for you? I forgot I remember friday or monday cant remember if we had a phone call early in my morning or late at night, one of the times it was the weekend or something, time is confusing.
    Last edited by TSD; October 14, 2010 at 10:54 PM.

  11. #11

    Default Re: how to scripting conquest one of regions as condition

    Yes u are right on the second post part it's the only way that i can think of.

    And about the || or part i'm sure it's not possible i mean we can use the not=! thing but not that.

  12. #12
    TSD's Avatar Ordinarius
    Join Date
    May 2008
    Location
    Chicago, IL
    Posts
    725

    Default Re: how to scripting conquest one of regions as condition

    Quote Originally Posted by Ishan View Post
    Yes u are right on the second post part it's the only way that i can think of.

    And about the || or part i'm sure it's not possible i mean we can use the not=! thing but not that.

    Yeah I dont script enough to know what we can and cant do in mtw2. It seems elementary to me there would be a time where you would want to use an "or" guess CA didnt see it that way.

  13. #13

    Default Re: how to scripting conquest one of regions as condition

    Insted making one script with many conditions i've made many independent conditions connected by OR operand:
    recruit_pool "Templar Sergeant" 1 0.015 1 0 requires factions { poland, hungary, hre, denmark, france, england, scotland, milan, venice, sicily, spain, portugal, } and not event_counter holds_Jerusalem 1 or not event_counter holds_antioch 1 or not event_counter holds_aleppo 1 or not event_counter holds_edessa 1 or not event_counter holds_acre 1 or not event_counter holds_tripolis 1 or not event_counter holds_laodikeia 1 or not event_counter holds_homs 1 and region_religion catholic 40
    What do you think about it?

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: how to scripting conquest one of regions as condition

    do it via script:

    IsRegionOneOf


    Code:
    monitor_event GeneralCaptureSettlement IsTargetRegionOneOf Baghdad, Mosul, Antioch, Aleppo, Damascus, Acre, Jerusalem, Tripolis, Laodikeia and Homs
    historic_event enter_your_event_name_here
    end_monitor
    and then put the event condition into the EDB










  15. #15

    Default Re: how to scripting conquest one of regions as condition

    Gigantus
    It doesn't work. After starting campaign i only can admire a black screen

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: how to scripting conquest one of regions as condition

    Quote Originally Posted by attyla View Post
    Gigantus
    It doesn't work. After starting campaign i only can admire a black screen
    I took the region names from the example, you will need to enter the region names as they are in the descr_regions file.
    You shouldn't get a black screen if this doesn't work - it would only affect the script (the whole script wouldn't work) and the log would show th eerror line th escript (can't create a script from line xxx - or something like that)
    Quote Originally Posted by Sqυιd View Post
    In RTW you could have an extra section in an EDB building level, just below the capability section called faction_capability which gave faction wide whatever capabilities are listed there.

    Using an M2TW grand campaign example:

    Spoiler Alert, click show to read: 

    Code:
            c_ballista_towers castle requires factions {  northern_european, middle_eastern, eastern_european, greek,  southern_european, } 
            {
                convert_to 0
                capability
                {
                    tower_level 2
                }
                faction_capability
                {
                     recruit_pool "Spanish Dragoons"  1   0.5   4  0   requires factions { spain, portugal, }  and hidden_resource  my_hidden_resource
                }
                material stone
                construction  3 
                cost  3200 
                settlement_min large_city
                upgrades
                {
                    c_cannon_towers
                }
            }


    If at any time spain or portugal controlled a region with the my_hidden_resource hidden resource all their cities would get to recruit Spanish Dragons. As I said though I don't know if it works in M2TW or not though.
    That looks like twice the same condition (those faction need a hidden resource in that region), could you explain more? Or does it mean if a faction meets that condition the 'recruit pool' line would be automatically valid in every region?
    Last edited by Gigantus; October 15, 2010 at 09:15 PM.










  17. #17
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,751
    Blog Entries
    3

    Default Re: how to scripting conquest one of regions as condition

    Unless they took it out in M2TW (and I haven't tried using it so I don't know) but has anyone tried the RTW faction_capability section for edb? This would solve the given problem without any complex scripts or anything.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  18. #18
    irishron's Avatar Cura Palatii
    Moderator Emeritus

    Join Date
    Feb 2005
    Location
    Cirith Ungol
    Posts
    47,023

    Default Re: how to scripting conquest one of regions as condition

    Dumb queston, does vanilla camapign work?

  19. #19

    Default Re: how to scripting conquest one of regions as condition

    Irishron
    I don't know dump questions
    Yes it does.

    Squid
    what you mean?

  20. #20
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,751
    Blog Entries
    3

    Default Re: how to scripting conquest one of regions as condition

    In RTW you could have an extra section in an EDB building level, just below the capability section called faction_capability which gave faction wide whatever capabilities are listed there.

    Using an M2TW grand campaign example:

    Spoiler Alert, click show to read: 

    Code:
            c_ballista_towers castle requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, } 
            {
                convert_to 0
                capability
                {
                    tower_level 2
                }
                faction_capability
                {
                     recruit_pool "Spanish Dragoons"  1   0.5   4  0  requires factions { spain, portugal, }  and hidden_resource my_hidden_resource
                }
                material stone
                construction  3 
                cost  3200 
                settlement_min large_city
                upgrades
                {
                    c_cannon_towers
                }
            }


    If at any time spain or portugal controlled a region with the my_hidden_resource hidden resource all their cities would get to recruit Spanish Dragons. As I said though I don't know if it works in M2TW or not though.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

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
  •