Results 1 to 11 of 11

Thread: Settlement name change

  1. #1

    Default Settlement name change

    Hello

    I am trying to add settlement name change in the campaign script.

    I found this in the americas campaign as exemple

    Code:
    ;;;;; Mexico - Tenochtitlan
    
        declare_counter Tenochtitlan_Spain
        
        ;;; Spain captures Tenochtitlan
        monitor_conditions I_SettlementOwner Tenochtitlan = spain
            and I_CompareCounter Tenochtitlan_Spain = 0
            
            set_counter Tenochtitlan_Spain 1
            change_settlement_name Tenochtitlan Mexico
    
         end_monitor
    
        ;;; Natives capture Tenochtitlan
        monitor_conditions not I_SettlementOwner Tenochtitlan = spain
            and not I_SettlementOwner Tenochtitlan = england
            and not I_SettlementOwner Tenochtitlan = france
            and I_CompareCounter Tenochtitlan_Spain = 1
    
            set_counter Tenochtitlan_Spain 0
            change_settlement_name Tenochtitlan Tenochtitlan
    
         end_monitor
    An I wrote this, but when the factions normans take the settlement, the name doesn't change Did I mistaked ?

    Code:
    ;;;;; Naha - Shuri
    
        declare_counter Shuri_Japan
        
        monitor_conditions I_SettlementOwner Tenochtitlan = normans
            and I_CompareCounter Shuri_Japan = 0
            
            set_counter Shuri_Japan 1
            change_settlement_name Shuri Naha
    
         end_monitor
    
        monitor_conditions not I_SettlementOwner Tenochtitlan = normans
            and I_CompareCounter Shuri_Japan = 1
    
            set_counter Shuri_Japan 0
            change_settlement_name Shuri Shuri
    
         end_monitor

  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,095
    Blog Entries
    35

    Default Re: Settlement name change

    The new settlement name needs an entry in text\expanded.txt - in the same way as it would be in text\imperial_campaign...txt
    The same applies if the name gets reversed to the original one.










  3. #3

    Default Re: Settlement name change

    I added the settlement name.

    No need to add the region/province name right ?

  4. #4
    lolIsuck's Avatar WE HAVE NO CAKE!
    Patrician Citizen Moderator Emeritus

    Join Date
    Dec 2010
    Location
    Heerlen, Limburg
    Posts
    13,693

    Default Re: Settlement name change

    Why is Tenochtitlan still in the script? I don't know a lot about scripting so I could be wrong but that seems weird.
    This way it says that if Tenochtitlan is Norman the name of Shuri will change to Naha, seems to make sense then that when you capture Shuri nothing will change.

  5. #5

    Default Re: Settlement name change



    Oops

    But still doesn't work :S

    Here is all the script I simplified to test first how to do...

    Code:
    script
    ;;;;;;;;;;;;;;;;;;;;;;;; Name Settlements ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    ;;;;; Naha - Shuri
    
        monitor_conditions I_SettlementOwner Shuri = normans
            change_settlement_name Shuri Naha
         end_monitor
    
        monitor_conditions I_SettlementOwner Shuri = ryukyu
            change_settlement_name Shuri Shuri
         end_monitor
    end_script
    I simply added this to expanded :

    Code:
    {Naha}Naha
    {Shuri}Shuri
    Last edited by falcom4ever; May 08, 2012 at 09:33 AM.

  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: Settlement name change

    You forgot the "wait_monitors" line, second last row\line of your script.
    Last edited by Gigantus; May 08, 2012 at 10:07 AM.










  7. #7

    Default Re: Settlement name change

    Thanks it works now :

    Code:
    script
    ;;;;;;;;;;;;;;;;;;;;;;;; Name Settlements ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    ;;;;; Naha - Shuri
    
        monitor_conditions I_SettlementOwner Shuri = normans
            change_settlement_name Shuri Naha
         end_monitor
    
        monitor_conditions I_SettlementOwner Shuri = ryukyu
            change_settlement_name Shuri Shuri
         end_monitor
    
    wait_monitors
    
    end_script
    But now when I take the settlement, it looks like if it was in loop. I can't do CTRL+A to select the army, as it unselect. Maybe it is because the script is too small and it renames always the settlement ?

  8. #8
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: Settlement name change

    Yep, since monitor_conditions is a real time monitor and since you've not defined an end to this, you're caught in an infinite loop
    Add a counter to it like f.e.:

    declare_counter shuri
    monitor_conditions I_SettlementOwner Shuri = ryukyu
    and I_CompareCounter shuri = 0
    change_settlement_name shuri shuri
    set_counter shuri 1
    end_monitor


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

  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,095
    Blog Entries
    35

    Default Re: Settlement name change

    One of the reasons I avoid monitor_conditions wherever I can.










  10. #10

    Default Re: Settlement name change

    I see thanks about that.

    My first time at scripting sorry.

  11. #11
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: Settlement name change

    Quote Originally Posted by Gigantus View Post
    One of the reasons I avoid monitor_conditions wherever I can.
    This!
    Quote Originally Posted by falcom4ever View Post
    I see thanks about that.

    My first time at scripting sorry.
    Welcome and no need to apologise, just enjoy modding


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

Posting Permissions

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