Results 1 to 16 of 16

Thread: Admin / Siege

Hybrid View

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

    Default Admin / Siege

    monitor_event FactionTurnStart FactionIsLocal
    and I_NumberOfSettlements >= 20
    and I_NumberOfSettlements < 40
    console_command add_money -20000
    end_monitor

    Hopefully this will remove "admin" money every turn from the player so you're never getting too rich. But, is there a way to do it by the actual number of cities? Meaning: 21 = -21000.

    monitor_event FactionTurnStart FactionType (all fations...)
    and not FactionisLocal

    if settlementunderSiege
    and TimerElapsed <= 3
    siege_settlement, maintain
    end_if
    end_monitor

    You cannot change the siege points, but is this going to make the AI maintain the siege for at least 3 turns?

    If I start a counter for siege and there is another siege afterwards I don't know how is going to work. Do I have to specify the settlement under siege? Anybody got an idea how to handle sieges duration?

    It takes 16.000 dead to make a Major-General. Joffre.

  2. #2

    Default Re: Admin / Siege

    Sorry. I mean... console_command add_money FactionIsLocal -20000
    this would work or I have to script and choose the faction for every campaign?

    They were a lot more popular with the designers than they were with the users. About certain weapons.

  3. #3

    Default Re: Admin / Siege

    I was just working on something similar
    Try this attached script out for your Admin money...
    Just change set_kings_purse $$$$$ to console_command add_money -$$$$$
    and change the settlement values...good to go...if you want specific settlement amounts then it would look like this...

    monitor_event FactionTurnStart FactionType england
    and I_NumberOfSettlements == 20
    console_command add_money -20000
    end_if

    and I_NumberOfSettlements == 21
    console_command add_money -21000
    end_if
    end_monitor



    but you would have to write a new script for every faction...i found that in this case it's easier to do like 21 - 25, 26 - 30, 31 - 35 etc...
    Last edited by valvegas1; November 07, 2011 at 02:19 AM.

  4. #4

    Default Re: Admin / Siege

    Thanks Val, that's what I was trying to avoid but it seems there is no way to apply 2 conditions at the same time: number of settlements owned by the player. At least I havenīt been able to find it, I'm always back to Number OR Local. There is a -not exactly the same- SettlementsTaken but only for characters.

    To decrease the money linked to the settlements maybe a SetCounter, but as I don't have the settlements...

    -I left a General behind me… -Who?... -General consternation. JEB.

  5. #5

    Default Re: Admin / Siege

    Quote Originally Posted by semmes View Post
    Thanks Val, that's what I was trying to avoid but it seems there is no way to apply 2 conditions at the same time: number of settlements owned by the player. At least I havenīt been able to find it, I'm always back to Number OR Local. There is a -not exactly the same- SettlementsTaken but only for characters.

    To decrease the money linked to the settlements maybe a SetCounter, but as I don't have the settlements...

    -I left a General behind me… -Who?... -General consternation. JEB.
    sorry but this is the quickest and easiest way i have found...multiple conditions are possible they just cant be the same condition...if it is the same condition it would have to do it like i did in my script...you could do something like this

    monitor_event FactionTurnStart FactionType england
    and I_NumberOfSettlements == 20
    and Treasury >= 30000
    console_command add_money -20000
    end_if

    and I_NumberOfSettlements == 21
    console_command add_money -21000
    and Treasury >= 31000
    end_if
    end_monitor


    I was thinking about what your trying to accomplish...if you use the console_command add_money i don't think the money you lose will show up in you finance scroll in game...you could however set up an event scroll to pop up in game to alert the player of losing money....just a thought...
    Last edited by valvegas1; November 07, 2011 at 03:55 PM.

  6. #6

    Default Re: Admin / Siege

    [QUOTE=valvegas1;10579034]sorry but this is the quickest and easiest way i have found...multiple conditions are possible they just cant be the same condition...if it is the same condition it would have to do it like i did in my script...you could do something like this

    I was thinking about what your trying to accomplish...


    Thanks Val. I was trying to find NumberofLocalSettelments, that would be easy. Probably >=10 <=19 is good enough,and I can use the set_kings_purse -10000.

    The log is already in the mod I'm using but, even if trial an error is the good old one to get things, provoking a CTD makes me feel stupid, specially because I'm sure somebody tried it before.

    What was possible, difficult or impossible; the last, he left to the enemy. Baron de Comeau about N.

  7. #7

    Default Re: Admin / Siege

    monitor_event FactionTurnStart FactionType (all fations...)
    and not FactionisLocal

    if settlementunderSiege
    and TimerElapsed <= 3
    siege_settlement, maintain
    end_if
    end_monitor

    You cannot change the siege points, but is this going to make the AI maintain the siege for at least 3 turns?

    If I start a counter for siege and there is another siege afterwards I don't know how is going to work. Do I have to specify the settlement under siege? Anybody got an idea how to handle sieges duration?
    one way to find out would be to write the script for one faction and put it in and test it....before you do add these lines to the top of your preferences file

    [log]
    to=logs/system.log.txt
    level = * trace
    ;file = game.script.* logs/pkh.script2.log.txt
    ;file = game.script* logs/pkh.script.log.txt
    ;file = game.script logs/pkh.scriptoutput.log.txt


    this will give you good details on whether it works or not and why it doesn't work...has helped me a ton since i found it...
    Last edited by valvegas1; November 07, 2011 at 06:15 PM.

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

    Default Re: Admin / Siege

    Quote Originally Posted by semmes View Post
    But, is there a way to do it by the actual number of cities? Meaning: 21 = -21000.
    monitor_event SettlementTurnStart ! FactionType slave
    console_command add_money -1000
    end_monitor

    That's a simple way to do it, but I wonder what kind of effect on performance it might have. Might be fine, might add some seconds to AI turn times, I'd check it before settling on it

    Quote Originally Posted by semmes View Post
    You cannot change the siege points, but is this going to make the AI maintain the siege for at least 3 turns?
    You can make a trait for AI characters that they receive at the turns end when they are sieging.

    As for forcing a long siege, it seems impossible unless you know the character's name or label.
    Last edited by Taiji; November 08, 2011 at 02:01 PM. Reason: corrected something dumb...

  9. #9

    Icon1 Re: Admin / Siege

    semmes: I haven't actually tested this so it may not work, but because you only want to know how many settlements the local faction has, you could try something along these lines:
    Spoiler Alert, click show to read: 
    Code:
    declare_counter local_settlement_upkeep
    
    	monitor_event GiveSettlement FactionIsLocal
    		inc_counter local_settlement_upkeep -1
    	end_monitor
    
    	monitor_event GiveSettlement TargetFactionIsLocal
    		inc_counter local_settlement_upkeep 1
    	end_monitor
    
    	monitor_event GeneralCaptureSettlement FactionIsLocal
    		inc_counter local_settlement_upkeep 1
    	end_monitor
    
    	monitor_event GeneralCaptureSettlement TargetFactionIsLocal
    		inc_counter local_settlement_upkeep -1
    	end_monitor
    
    	monitor_event FactionTurnEnd FactionIsLocal
    		while I_CompareCounter local_settlement_upkeep > 0
    		console_command add_money -1000
    		inc_counter local_settlement_upkeep -1
    	end_while
    	end_monitor

  10. #10
    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: Admin / Siege

    This is a siege that gets maintained until the third round when an attack gets triggered. It includes ownership of the besieged settlement (crash if besieging own settlement) before and at the end of the siege (in case of revolts):

    Code:
    declare_counter siege_Fareyar
    monitor_event FactionTurnStart FactionIsLocal
        and I_TurnNumber = 1
        and not I_SettlementOwner Fareyar = norway
        and not I_SettlementOwner Fareyar = horda
        and not I_SettlementOwner Fareyar = denmark
        and not I_SettlementOwner Fareyar = spain
    
        spawn_army
            faction spain
            character    Bjalfi, general, age 29, x 89, y 193, label v00, direction W
            unit    Huskarl Swordsmen        exp 4 armour 0 weapon_lvl 0
            unit    Leidgangr Spearmen        exp 3 armour 0 weapon_lvl 0
            unit    Leidgangr Spearmen        exp 3 armour 0 weapon_lvl 0
            unit    Herkledi Spearmen        exp 3 armour 0 weapon_lvl 0
            unit    Vikingr Axemen            exp 3 armour 0 weapon_lvl 0
            unit    Vikingr Axemen            exp 3 armour 0 weapon_lvl 0
            unit    Leidgangr Archers        exp 3 armour 0 weapon_lvl 0
        sieging
            siege_settlement v00, Fareyar, maintain
        terminate_monitor
    end_monitor
    
    monitor_event FactionTurnEnd FactionType spain
        and I_CharacterExists v00
        and not I_SettlementOwner Fareyar = norway
        and not I_SettlementOwner Fareyar = horda
        and not I_SettlementOwner Fareyar = denmark
        and not I_SettlementOwner Fareyar = spain
        and I_SettlementUnderSiege Fareyar
    
        if I_CompareCounter siege_Fareyar < 2
                siege_settlement v00, Fareyar, maintain
        end_if
        if I_CompareCounter siege_Fareyar = 2
            siege_settlement v00, Fareyar, attack
        terminate_monitor
        end_if
    
        inc_counter siege_Fareyar 1
    end_monitor










  11. #11

    Default Re: Admin / Siege

    Thanks to all. I guess:

    monitor_event FactionTurnStart FactionIsLocal

    if I_NumberOfSettlements armenia >= 10
    and I_NumberOfSettlements armenia <= 19
    console_command add_money -5000
    end_if


    if I_NumberOfSettlements armenia >= 20
    and I_NumberOfSettlements armenia <= 39
    console_command add_money -20000
    end_if

    if I_NumberOfSettlements armenia >= 40
    and I_NumberOfSettlements armenia <= 59
    console_command add_money -40000
    console_command add_money -40000
    end_if

    if I_NumberOfSettlements armenia >= 60
    and I_NumberOfSettlements armenia <= 79
    console_command add_money -40000
    console_command add_money -40000
    console_command add_money -40000
    console_command add_money -40000
    end_if

    if I_NumberOfSettlements armenia >= 80
    and I_NumberOfSettlements armenia < 200
    console_command add_money -40000
    console_command add_money -40000
    console_command add_money -40000
    console_command add_money -40000
    console_command add_money -40000
    end_if
    end_monitor

    for every faction is the safest way. About the siege, I do not think I'm going to make a script with the name of every single settlement.

    Those on the forward slope slid down, those on the reverse slope slid back; otherwise, no change. Sitrep, Conical Hill.

  12. #12

    Default Re: Admin / Siege

    I'm lost, in the original post you have a script that only works for the local player,

    Now you have a script that removes cash from the local player based on the amount of settlements armenia has. Regardless of wether or not the local player is even playing with Armenia. If you copy this for all nations you'll be paying for all their settlements not just your own.

    So if I get it correctly the most efficient script would be this one:

    Code:
     
    monitor_event SettlementTurnStart SettlementIsLocal 
      console_command add_money -1000
    end_monitor
    It costs you 1000 per city you own, ( it shouldn't noticably slow the game down I have a similar script running and you don't even notice it)

    If you want to use the script you had in your last post you'll need to make the following changes (and duplicate for all nations)

    The condition makes sure you only pay for the settlements of the faction you're actually playing with,
    the small if statement terminates all monitors that aren't needed ( the ones referring to all the other factions)
    Code:
    monitor_event FactionTurnStart FactionIsLocal
    if not I_LocalFaction armenia 
      terminate_monitor
    end_if 
    
    if I_LocalFaction armenia 
           if I_NumberOfSettlements armenia >= 10
           and I_NumberOfSettlements armenia <= 19
               console_command add_money  -5000
           end_if
    
    
           if I_NumberOfSettlements armenia  >= 20
           and I_NumberOfSettlements armenia  <= 39
              console_command add_money  -20000
           end_if
    
           if I_NumberOfSettlements armenia  >= 40
           and I_NumberOfSettlements armenia  <= 59
             console_command add_money  -40000
             console_command add_money  -40000
           end_if
    
           if I_NumberOfSettlements armenia  >= 60
           and I_NumberOfSettlements armenia  <= 79
             console_command add_money  -40000
             console_command add_money  -40000
             console_command add_money  -40000
             console_command add_money  -40000
           end_if
    
           if I_NumberOfSettlements armenia  >= 80
           and I_NumberOfSettlements armenia  < 200
             console_command add_money  -40000
             console_command add_money  -40000
             console_command add_money  -40000
             console_command add_money  -40000
             console_command add_money  -40000
           end_if
    
    end_if 
    
    end_monitor
    Last edited by ilmrik; November 28, 2011 at 09:08 AM.

  13. #13

    Default Re: Admin / Siege

    Sorry, I copied the notepad not the script. Yes, Armenia when the player is Armenia, but I saw another thing and I don't know why I didn't used it:

    monitor_event SettlementTurnStart FactionType seljuks

    if SettlementIsLocal
    and I_NumberOfSettlements seljuks >=10
    and I_NumberOfSettlements seljuks <=19
    console_command add_money -500
    end_if

    if SettlementIsLocal
    and I_NumberOfSettlements seljuks >=20
    and I_NumberOfSettlements seljuks <=39
    console_command add_money -1000
    end_if
    ...
    but anyway I have to do it for every faction. The terminate_ is a very good idea, thanks.

    All this started trying to find: quote:

    monitor_event SettlementTurnStart SettlementIsLocal
    if I_NumberOfSettlements IsLocal >=20
    console_command add_money -1000
    end_monitor

    Behind every hill there is a river, and behind that river, another hill. O. Bradley.

  14. #14

    Default Re: Admin / Siege

    you can't put SettlementIsLocal in an "if" statement. Also you can't use the I_NumberOfSettlements "IsLocal" it requires a country like england, france etc

    You're trying to base the amount of money you pay on the amount of settlements you own right ?
    The I suggest you write it like this:

    Code:
    declare_counter  AmountOfSettlements
    
    monitor_event FactionTurnStart FactionIsLocal 
       set_counter AmountOfSettlements 0
    end_monitor
    
    
    monitor_event SettlementTurnStart SettlementIsLocal 
      inc_counter AmountOfSettlements 1
    
        if I_CompareCounter AmountOfSettlements >= 10 
          console_command add_money -500
        end_if 
    
        if I_CompareCounter AmountOfSettlements >= 20 
          console_command add_money -500
        end_if 
    
    end_monitor
    The idea is simple,
    Every settlements you own increases the counter like so:

    Local Settlement 1: turnstart --> inc counter by 1 ( now 1); <= 10 so no pay
    Local Settlement 2: turnstart --> inc counter by 1 ( now 2); <= 10 so no pay
    Local Settlement 3: turnstart --> inc counter by 1 ( now 3); <= 10 so no pay

    Local Settlement 9: turnstart --> inc counter by 1 ( now 9); <= 10 so no pay
    Local Settlement 10: turnstart --> inc counter by 1 ( now 10); = 10 so -500
    etc until the 20th settlement
    Local Settlement 20: turnstart --> inc counter by 1 ( now 20); > 10 so -500
    and
    Local Settlement 20: turnstart --> inc counter by 1 ( now 20); = 20 so -500

    Essentially you pay 500 per city after the first 10 and 1000 for every after the first 20
    At the turn start the counter is reset to 0, so it's ready for next turn.

    This script automatically works regardless of what faction the player chooses! So no need to mulitply etc.
    Last edited by ilmrik; November 30, 2011 at 08:45 AM.

Posting Permissions

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