Page 1 of 3 123 LastLast
Results 1 to 20 of 50

Thread: Make a settlement a power centre for training special units.

  1. #1

    Default Make a settlement a power centre for training special units.

    How to make a Settlement "Power Centre" for recruiting certain units

    Well this was something i found in the crusades campaign_script.txt and thought it would be useful to some of the guys who want to put this cool trigger in the script of their mods.
    Lets us suppose there is a unit like Greek firethrower which you guys want to train only when you have a ownership of a particular settlement in this case lets take Constantinople for the Byzantium.

    Firstly open the campaign_script.txt for your mod which can found in this path:-
    your mod\data\world\maps\campaign\imperial_campaign folder.

    Open the file and paste this entry given below:

    ;Increment
    Code:
    monitor_conditions I_SettlementOwner Constantinople = byzantium
    and I_EventCounter holds_constantinople == 0
    add_events
    event counter holds_constantinople
    date 0
    end_add_events
    end_monitor
    ;Decrement
    Code:
    monitor_conditions not I_SettlementOwner Constantinople = byzantium
    and I_EventCounter holds_constantinople == 1
    and I_NumberOfSettlements byzantium > 0
    set_event_counter holds_constantinople 0
    end_monitor
    Save the script and now open the EDB(export_descr_buildings.txt) file in the data folder of your mod.
    Now add this line with a space after the recruit pool of your unit
    Code:
     and event_counter holds_constantinople 1
    The complete line should look like this now:-
    Code:
    recruit_pool "Greek Firethrower"  1   0.7   2  0  requires factions { byzantium, } and event_counter holds_constantinople 1
    Remember to add this event counter to every line of Greek firethrower recruitment entry present in the EDB file.
    And that's it we are done here.

    Now the Byzantium can train Greek firethrower's only when it has the ownership of Constantinople. So in this way we can add more units attached to ownership of Constantinople or any other city.

    This method is better than the Hidden resource one coz with that we can only recruit that in that settlement only but with this script the recruitment is global(that is u can train them any settlement having the necessary building but u need to hold that Power centre city to make it recruitable Global throughout your kingdom.
    Last edited by Ishan; January 31, 2012 at 04:37 PM. Reason: typo

  2. #2
    Gigantus's Avatar I am thinking more about running away now then I did as a kid, but by the time I put my teeth in, my glasses on and find my car keys I forget why I am going.
    Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    48,401
    Blog Entries
    23

    Default Re: Make a settlement a power centre for training special units.

    This kind of event (with variations of the condition) has been used even in the vanilla version - remember those "overseas" ships that you could only build when 'The world is round' had happened?

    Somewhat more elegant

    campaign_script:
    declare_counter holds_contstantinople
    ;Increment
    monitor_events I_SettlementOwner Constantinople = byzantium
    set_counter holds_constantinople 1
    end_monitor

    ;Decrease
    monitor_events not I_SettlementOwner
    Constantinople = byzantium
    set_counter holds_constantinople 0
    end_monito
    r

    EDB:
    recruit_pool "Greek Firethrower" 0 0.000001 0.999 0 requires factions { byzantium, } and counter holds_constantinople 1




  3. #3

    Default Re: Make a settlement a power centre for training special units.

    Ah yes you are right gigantus the overseas ships example and also the gunpowder units when the gunpowder event pops up.

  4. #4
    AnthoniusII's Avatar XXI ARMORED BRIGADE
    Join Date
    Feb 2007
    Location
    Thessalonike Greece
    Posts
    21,884

    Default Re: Make a settlement a power centre for training special units.

    Thank you for that...
    That is what i needed to add more realism in the medieval Roman (byzantine) faction for every era...
    Imperial troops and spesific kind of ships that can ONLY be reqruited to Constantinople.
    That could make the byzantine civil wars we intend to add to TGC mod more realistic and acurate because who ever holds the capital will gain the imperial troops also!
    A rep for you sir!
    There are moments (in history), in which a nation owes,
    if it wants to be considered as a great one, to be able to fight.
    Even without hope of winning. Just because it has to.
    Greek War motto.
    XXI Armored Brigade. Proud that served in that unit in 1996!
    "Spartans do not ask how many (enemies are) but where they are"!
    XXI Armored Brigade's motto.
    The Greek Secret (or why they will fight again if it will be necessary or why they do not sell their history).


  5. #5
    Gorrrrrn's Avatar Citizen
    Join Date
    Jan 2007
    Location
    here
    Posts
    5,546

    Default Re: Make a settlement a power centre for training special units.

    could one not also have greek_fire as a hidden resource.
    allocate to constantinople only.
    and have the EDB say the necessary building requires faction byzantium and hidden resource greek_fire ?

  6. #6
    Gigantus's Avatar I am thinking more about running away now then I did as a kid, but by the time I put my teeth in, my glasses on and find my car keys I forget why I am going.
    Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    48,401
    Blog Entries
    23

    Default Re: Make a settlement a power centre for training special units.

    It will work just as fine, but only in Constantinople. The script will allow the unit to be build even in Paris (by Byzantium) as long as that faction holds Constantinople as well.

    The counter requirement is by far more flexible in this case, and it does not take a spot in the hidden_resource list - which is limited (64 entries I believe).




  7. #7
    Gorrrrrn's Avatar Citizen
    Join Date
    Jan 2007
    Location
    here
    Posts
    5,546

    Default Re: Make a settlement a power centre for training special units.

    Very true, gigantus, I read the O/P as saying poster wanted something for Constantinople alone.

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

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

    Default Re: Make a settlement a power centre for training special units.

    Moved this out of the tutorial forum as this information already exists in the docudemons and other tutorials.
    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

  9. #9

    Default Re: Make a settlement a power centre for training special units.

    If this is for greek firethrowers for byzantine:

    campaign_script:
    declare_counter holds_contstantinople
    ;Increment
    monitor_events I_SettlementOwner Constantinople = byzantium
    set_counter holds_constantinople 1
    end_monitor

    ;Decrease
    monitor_events not I_SettlementOwner
    Constantinople = byzantium
    set_counter holds_constantinople 0
    end_monito
    r

    EDB:
    recruit_pool "Greek Firethrower" 0 0.000001 0.999 0 requires factions { byzantium, } and counter holds_constantinople 1

    Would this be how you would do it to have Germany be able to recruit Ritterbruder?

    campaign_script:
    declare_counter holds_marienburg
    ;Increment
    monitor_events I_SettlementOwner Marienburg = hre
    set_counter holds_marienburg 1
    end_monitor

    ;Decrease
    monitor_events not I_SettlementOwner
    Marienburg = hre
    set_counter holds_Marienburg 0
    end_monito
    r

    EDB:
    recruit_pool "Dismounted Ritter" 0 0.000001 0.999 0 requires factions { hre, } and counter holds_Marienburg 1
    Last edited by chris7ian; January 01, 2010 at 09:37 PM.

  10. #10
    Gigantus's Avatar I am thinking more about running away now then I did as a kid, but by the time I put my teeth in, my glasses on and find my car keys I forget why I am going.
    Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    48,401
    Blog Entries
    23

    Default Re: Make a settlement a power centre for training special units.

    Absolutely correct.




  11. #11

    Default Re: Make a settlement a power centre for training special units.

    Danke for your time.
    Last edited by chris7ian; January 23, 2010 at 08:50 PM.
    Oh, for Heaven's sake, now you're being deliberately stupid.
    Dr. Sheldon Cooper
    Wudang why did you close the thread? Because you can't find a source refuting mine? LoL how's the quest to ban me going?

  12. #12
    alhoon's Avatar Moderator
    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    21,931

    Default Re: Make a settlement a power centre for training special units.

    Monitor_events?
    How's that different from monitor_event?
    DIE: Diversity, Inclusion, Equality (Pun on SJWs, I am not far-right)
    _______________________________________________________
    Beta-tester for Darthmod Empire, the default modification for Empire Total War that does not ask for your money behind patreon.

    Developer of Causa Belli submod for Darthmod, headed by Hammeredalways and a ton of other people.
    Developer of LtC: Random maps submod for Lands to Conquer (that brings a multitude of random maps and other features).

  13. #13
    Gigantus's Avatar I am thinking more about running away now then I did as a kid, but by the time I put my teeth in, my glasses on and find my car keys I forget why I am going.
    Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    48,401
    Blog Entries
    23

    Default Re: Make a settlement a power centre for training special units.

    In that we all overlooked this obvious mistake. Thanks for pointing out.




  14. #14

    Default Re: [Tutorial] Make a settlement a power centre for training special units.

    How can I adjust the script so that the effect is that whenever whatever faction conquers Constantinople they can train Greek_Firethrowers?

  15. #15
    Gigantus's Avatar I am thinking more about running away now then I did as a kid, but by the time I put my teeth in, my glasses on and find my car keys I forget why I am going.
    Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    48,401
    Blog Entries
    23

    Default Re: [Tutorial] Make a settlement a power centre for training special units.

    You need a monitor for each faction whether they hold Constantinople, which triggers an event
    In the EDB you have to set a condition in the recruitment line for each faction combined with that event.




  16. #16

    Default Re: [Tutorial] Make a settlement a power centre for training special units.

    Hmm I guess I have some modding to do then!

    Thanks

  17. #17
    Gigantus's Avatar I am thinking more about running away now then I did as a kid, but by the time I put my teeth in, my glasses on and find my car keys I forget why I am going.
    Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    48,401
    Blog Entries
    23

    Default Re: [Tutorial] Make a settlement a power centre for training special units.

    One is glad to be of service




  18. #18
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,738

    Default Re: [Tutorial] Make a settlement a power centre for training special units.

    Some confusing/wrong stuff in this thread. Shouldn't the examples use event counters?

  19. #19

    Default Re: [Tutorial] Make a settlement a power centre for training special units.

    Quote Originally Posted by Taiji View Post
    Some confusing/wrong stuff in this thread. Shouldn't the examples use event counters?
    I have used event counters in the first post.
    Is there something wrong with it?

  20. #20
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,738

    Default Re: [Tutorial] Make a settlement a power centre for training special units.

    You just copied vanilla, didn't you? It works in vanilla so of course you (actually CA) got it right.

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

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