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

Thread: GeneralCaptureSettlement "event"

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default GeneralCaptureSettlement "event"

    i have this script...


    monitor_event GeneralCaptureSettlement SettlementName blahh
    and I_SettlementOwner blahh = byzantium
    do a couple of things....
    and a historic_event
    end_monitor

    the former owner of "blahh" is byzantium, so when the settlement is taken over by the rebels (i tested it with rioting) the historic event pops up.....

    so, what i want to ask is, whom the "SettlementOwner" condition refers to....to the former owner or the the future one???


    thanks!
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

  2. #2
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: GeneralCaptureSettlement "event"

    The current, I guess from the name of the event, so it would be redundant in that script. If you wanted to check who it was taken from then you can use TargetFactionType blahh. And if you wanted to check who took it then FactionType blahh. The event exports both requirements for those conditions.
    Last edited by Taiji; October 08, 2011 at 12:42 PM.

  3. #3
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default Re: GeneralCaptureSettlement "event"

    thanks! (+rep)

    i don't suppose there is an "I_" option with a factions.... so i can use a bunch of them inside one monitor...???
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

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

    Default Re: GeneralCaptureSettlement "event"

    I have had strange behaviour with GeneralCaptureSettlement in the past, where the event seemed be be firing after the capture but before the settlement changed ownership. So I_SettlementOwner would be the 'previous' owner.

    It was a while ago and maybe I did something wrong. Just a heads up anyway.

    i don't suppose there is an "I_" option with a factions.... so i can use a bunch of them inside one monitor...???
    There are things like TargetFactionCultureType, TargetFactionReligion but nothing like (e.g.) I_SettlementOwnerIsOneOf. Depending on what you're trying to test perhaps something like this...

    Code:
    monitor_event GeneralCaptureSettlement SettlementName blahh
     
      if I_SettlementOwner blahh = byzantium
        do a couple of things....
      end_if
      if I_SettlementOwner blahh = greece
        do a couple of things....
      end_if
    
      ...
    
     end_monitor

  5. #5
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default Re: GeneralCaptureSettlement "event"

    i have the the same problem with you...

    yes, sth like this....
    btw, if you write a "campaign_wait 1.5" (or sth like that) between the monitor and the if's ?? any chance it will work....???
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

  6. #6
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: GeneralCaptureSettlement "event"

    Withwnar's example looks undesireable to me. I wouldn't want a script to fire every time that event fires. I think that would impact performance more than having 200+ monitors sat there doing nothing.

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

    Default Re: GeneralCaptureSettlement "event"

    Quote Originally Posted by Taiji View Post
    Withwnar's example looks undesireable to me. I wouldn't want a script to fire every time that event fires. I think that would impact performance more than having 200+ monitors sat there doing nothing.
    A monitor will need to exist for each settlement that needs this because the settlement name is a monitor condition. If there are lot of them then that is undesirable, yes.

    There might be a better way, depending on what it is you are trying to do Spyros. What is the "do a couple of things" and does the historic event need to be specific to that settlement?

    Quote Originally Posted by SpyrosM91 View Post
    if you write a "campaign_wait 1.5" (or sth like that) between the monitor and the if's ?? any chance it will work....???
    I'm not sure. Worth a try.

    TNZ's idea might work but if this "capture" event is firing before the capturer actually moves into the settlement then it probably won't. That's my understanding of it: the general has captured it but not yet moved in and taken ownership. Or maybe he has moved in but just not taken ownership yet.

  8. #8
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: GeneralCaptureSettlement "event"

    Quote Originally Posted by Withwnar View Post
    A monitor will need to exist for each settlement that needs this because the settlement name is a monitor condition. If there are lot of them then that is undesirable, yes.
    Not undesirable compared to making a monitor that fires an if statement everytime a common event fires. Unless you're prioritising a need to do less work over a need to have a better mod.

  9. #9
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default Re: GeneralCaptureSettlement "event"

    Quote Originally Posted by Withwnar View Post
    A monitor will need to exist for each settlement that needs this because the settlement name is a monitor condition. If there are lot of them then that is undesirable, yes.

    There might be a better way, depending on what it is you are trying to do Spyros. What is the "do a couple of things" and does the historic event need to be specific to that settlement?
    the first thing is simple: change of names in a settlement after it has been captured.... and this will require a lot of monitors... SO, WHICH IS THE LEAST TIME/PROCESSING POWER CONSUMING METHOD??

    second thing: when a specific city is taken by a specific faction, then some counters are set, events popping etc....... BUT this is only one monitor... and there isn't any "time consumtion" problem... so with a simple "monitor_event GeneralCapturesSettlement" and a "factionType" the problem is solved....



    Quote Originally Posted by Withwnar View Post
    TNZ's idea might work but if this "capture" event is firing before the capturer actually moves into the settlement then it probably won't. That's my understanding of it: the general has captured it but not yet moved in and taken ownership. Or maybe he has moved in but just not taken ownership yet.
    if you put "if I_FactionNearTile byzantium 01 48,30" ???
    well, there might be another anemy or allied army helping with the siege....


    Quote Originally Posted by Taiji View Post
    Not undesirable compared to making a monitor that fires an if statement everytime a common event fires. Unless you're prioritising a need to do less work over a need to have a better mod.
    so, what method do you propose???
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

  10. #10
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default Re: GeneralCaptureSettlement "event"

    yes, but that even't doesn't fire each FactionTurnStart or End, when the majority of monitors fire.... also a settlement is not captured every turn....


    an example could be a change in the settlement name.... or even sth more complicated...



    EDIT: but as i asked, will it work if you add a "wait_campaign"???
    Last edited by SpyrosM91; October 09, 2011 at 07:32 AM.
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

  11. #11

    Icon1 Re: GeneralCaptureSettlement "event"

    Try this:
    Code:
    	monitor_event GeneralCaptureSettlement SettlementName blahh
      		if I_FactionNearTile byzantium 0 48,30
        		do a couple of things....
      	end_if
      		if I_FactionNearTile greece 0 48,30
        		do a couple of things....
      	end_if
    	end_monitor
    Code:
    ---------------------------------------------------
    Identifier:              I_FactionNearTile
    Trigger requirements:    
    Parameters:              faction, distance in squares, x, z
    Sample use:              I_FactionNearTile romans_julii 10 48,30
    Description:             Is a member of a faction near a particular tile?
    Battle or Strat:         Strat
    Class:                   I_FACTION_NEAR_TILE
    Implemented:             Yes
    Author:                  Guy
    ---------------------------------------------------

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

    Default Re: GeneralCaptureSettlement "event"

    Ah, well, that would lead to an interesting conversation about the efficiency of monitors with I_ conditions versus if statements. Something I have often wondered. Do you know of any threads on this subject? (Efficiency is always my top priority BTW.)

  13. #13
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: GeneralCaptureSettlement "event"

    Quote Originally Posted by Withwnar View Post
    Ah, well, that would lead to an interesting conversation about the efficiency of monitors with I_ conditions versus if statements. Something I have often wondered. Do you know of any threads on this subject? (Efficiency is always my top priority BTW.)
    Hmm it seems you may have misunderstood me. But also that I was wrong about the event firing the monitor all the time, since you'd have to make one per settlement. So it shouldn't cause any issues with performance compared to another method, sorry for any confusion.

    As for whether multiple monitors are more efficient than if statements, I think in one respect they are and in another they are not. For example if you have a monstrous if statement then the things on the end of it take longer to fire. But then on the other hand less monitors probably means less processor cycles and memory usage. There's a stab at describing the issues, but I think the full answer could be very complicated indeed.

    But if you're using an if statement to replace a sequence of monitors that need to be fired in order, I suspect the if statement will win every time.
    Last edited by Taiji; October 09, 2011 at 01:36 PM.

  14. #14
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: GeneralCaptureSettlement "event"

    Quote Originally Posted by Withwnar View Post
    Ah, well, that would lead to an interesting conversation about the efficiency of monitors with I_ conditions versus if statements. Something I have often wondered. Do you know of any threads on this subject? (Efficiency is always my top priority BTW.)
    Hmm it seems you have misunderstood me. But also that I was wrong about the event firing the monitor all the time, since you'd have to make one per settlement. So it shouldn't cause any issues with performance compared to another method.

    As for whether multiple monitors are more efficient than if statements, I think in one respect they are and in another they may not be. For example if you have a monstrous if statement then the things on the end of it take longer to fire. But then on the other hand less monitors probably means less processor cycles and memory usage. There's a stab at describing the issues, but I think the full answer could be very complicated indeed.

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

    Default Re: GeneralCaptureSettlement "event"

    Are we talking about a lot of settlements here? All settlements? Or is just a few special ones?

    If it was every settlement (let's say 200) then that's 200 monitors. If you also need a separate monitor for each possible faction that captured it then that's 200 x faction_count monitors. At 15 factions that's 3000 monitors. Ouch.

    well, there might be another anemy or allied army helping with the siege
    That's right. With TNZ's use of 0 you know that it can only refer to the faction currently in that settlement. It's worth trying out his suggestion. Maybe it does work differently to CurrentOwner.

  16. #16
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default Re: GeneralCaptureSettlement "event"

    yes!!!, if you put a "campaign_wait 0.5" before the if's for each faction, the script works fine!....

    if you don't, the engine takes the "former" owner instead of the conqueror...



    so, for renaming the settlements which solution is better??? monitors and if's OR only monitors???
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

  17. #17
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: GeneralCaptureSettlement "event"

    I'd probably just use an if statement at the start of the player's turn to execute the name change.

    And a monitor to trigger running the if statement.

    monitor_event GeneralCaptureSettlement I_CompareCounter triggerif == 0
    set_counter triggerif 1
    end_monitor

    monitor_event FactionTurnStart I_CompareCounter triggerif == 1
    if I_SettlementOwner settlement faction
    and I_CompareCounter settlementfaction == 0
    set_counter settlementfaction 1
    set_counter settlementotherfactions 0
    ...etc. (one for each other faction)
    change_settlement_name settlement settlementfaction
    end_if
    ...etc. (one for each other settlement that changes name)
    set_counter triggerif 0
    end_monitor
    Last edited by Taiji; October 09, 2011 at 03:40 PM.

  18. #18
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default Re: GeneralCaptureSettlement "event"

    are you sure that there isn't sth wrong with your script??... i think that there's sth missing... will this whole script must be written for every faction (in their respective faction turn start???)
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

  19. #19
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: GeneralCaptureSettlement "event"

    Ah yes, tiny mistake:

    monitor_event GeneralCaptureSettlement I_CompareCounter triggerif == 0
    set_counter triggerif 1
    end_monitor

    monitor_event FactionTurnStart FactionIsLocal
    and
    I_CompareCounter triggerif == 1
    if I_SettlementOwner settlement faction
    and I_CompareCounter settlementfaction == 0
    set_counter settlementfaction 1
    set_counter settlementotherfactions 0
    ...etc. (one for each other faction)
    change_settlement_name settlement settlementfaction
    end_if
    ...etc. (one for each other settlement that changes name)
    set_counter triggerif 0
    end_monitor

    Don't want it running for every factionturnstart, just the player's will do.

    Is that what you mean where you say you spotted a mistake, Spyro?

    BTW if you only have a few settlements that change name then I'd make a 'triggerif' monitor for each of those settlements.
    Last edited by Taiji; October 10, 2011 at 03:38 AM.

  20. #20
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default Re: GeneralCaptureSettlement "event"

    sorry for the delayed answer but i wasn't available....

    i have this question: we have 3 factions: byzantium, russia & england

    Code:
        monitor_event GeneralCaptureSettlement I_CompareCounter triggerif == 0
            set_counter triggerif 1
        end_monitor
    
    
        monitor_event FactionTurnStart FactionIsLocal
        and I_CompareCounter triggerif == 1
        
            if I_SettlementOwner Rome byzantium
            and I_CompareCounter rome-to-byzantium == 0
    
                  set_counter rome-to-byzantium 1
                set_counter rome-to-russia 0
                set_counter rome-to-england 0
    
                  change_settlement_name Rome Romi
    
              end_if
    
            if I_SettlementOwner Venice byzantium
            and I_CompareCounter venice-to-byzantium == 0
    
                  set_counter venice-to-byzantium 1
                set_counter venice-to-russia 0
                set_counter venice-to-england 0
    
                  change_settlement_name Venice Venetia
    
              end_if
    
    
            if I_SettlementOwner Paris byzantium
            and I_CompareCounter paris-to-byzantium == 0
    
                  set_counter paris-to-byzantium 1
                set_counter paris-to-russia 0
                set_counter paris-to-england 0
    
                  change_settlement_name Paris Loutekia
    
              end_if
    
    
            set_counter triggerif 0
    
        end_monitor
    so, from the above it looks like i have to make and "if-argument" for each settlement and faction... right??? but won't that take longer???
    1) the monitor is running during the FactionTurnStart, along with many other monitors.... whereas mine will only run when a settlment is captured...
    2) also every time it will have to run to the end....[and thus checking over 199x31 if-statments.... if we assume we do this for all settlements and factions...] .... wherease mine will check 199 monitors...(because the if's for the factions will be inside the monitors)
    3) 199x31 counters must be set... doesn't this take space and time???... don't know... just asking..


    i'm not so much experienced with scripting... and with finding ways to diminish the time needed... but


    what i proposed
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

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
  •