Results 1 to 11 of 11

Thread: Settlement name change

  1. #1
    Aquilifer
    Join Date
    Dec 2006
    Posts
    363
    Tournaments Joined
    0
    Tournaments Won
    0

    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 woke up, lifted my arms, moved my knees, turned my neck. Everything made the same noise: Crrrrraaaacccckkk. I came to a conclusion: I am not old, I am crispy!
    Artifex

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    33,406
    Tournaments Joined
    0
    Tournaments Won
    0

    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.
    .

    Member of the H.E.L.P. Project

  3. #3
    Aquilifer
    Join Date
    Dec 2006
    Posts
    363
    Tournaments Joined
    0
    Tournaments Won
    0

    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?!
    Content Staff Citizen

    Join Date
    Dec 2010
    Location
    Heerlen, Limburg
    Posts
    10,090
    Tournaments Joined
    0
    Tournaments Won
    0

    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
    Aquilifer
    Join Date
    Dec 2006
    Posts
    363
    Tournaments Joined
    0
    Tournaments Won
    0

    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 10:33 AM.

  6. #6
    Gigantus's Avatar I woke up, lifted my arms, moved my knees, turned my neck. Everything made the same noise: Crrrrraaaacccckkk. I came to a conclusion: I am not old, I am crispy!
    Artifex

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    33,406
    Tournaments Joined
    0
    Tournaments Won
    0

    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 11:07 AM.
    .

    Member of the H.E.L.P. Project

  7. #7
    Aquilifer
    Join Date
    Dec 2006
    Posts
    363
    Tournaments Joined
    0
    Tournaments Won
    0

    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 yippee ki yay
    Artifex Vault Staff

    Join Date
    Mar 2009
    Location
    Dante's other pocket
    Posts
    9,163
    Tournaments Joined
    0
    Tournaments Won
    0

    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 and Makrell, house of Siblesz

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

  9. #9
    Gigantus's Avatar I woke up, lifted my arms, moved my knees, turned my neck. Everything made the same noise: Crrrrraaaacccckkk. I came to a conclusion: I am not old, I am crispy!
    Artifex

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    33,406
    Tournaments Joined
    0
    Tournaments Won
    0

    Default Re: Settlement name change

    One of the reasons I avoid monitor_conditions wherever I can.
    .

    Member of the H.E.L.P. Project

  10. #10
    Aquilifer
    Join Date
    Dec 2006
    Posts
    363
    Tournaments Joined
    0
    Tournaments Won
    0

    Default Re: Settlement name change

    I see thanks about that.

    My first time at scripting sorry.

  11. #11
    Aikanár's Avatar yippee ki yay
    Artifex Vault Staff

    Join Date
    Mar 2009
    Location
    Dante's other pocket
    Posts
    9,163
    Tournaments Joined
    0
    Tournaments Won
    0

    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 and Makrell, house of Siblesz

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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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