Results 1 to 11 of 11

Thread: Problem with turmoils

Hybrid View

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

    Default Problem with turmoils

    I said that Constantinople is too quiet town. So i made this script :
    PHP Code:
    monitor_event SettlementTurnStart SettlementName Constantinople
            
    and I_SettlementOwner Constantinople byzantium
            
    and SettlementBuildingExists small_church_o
            add_settlement_turmoil Constantinople 20
    end_monitor

    monitor_event SettlementTurnStart SettlementName Constantinople
            
    and I_SettlementOwner Constantinople byzantium
            
    and SettlementBuildingExists small_church_o
            add_settlement_turmoil Constantinople 15
    end_monitor

    monitor_event SettlementTurnStart SettlementName Constantinople
            
    and I_SettlementOwner Constantinople byzantium
            
    and SettlementBuildingExists church_o
            add_settlement_turmoil Constantinople 13
    end_monitor

    monitor_event SettlementTurnStart SettlementName Constantinople
            
    and I_SettlementOwner Constantinople byzantium
            
    and SettlementBuildingExists abbey_o
            add_settlement_turmoil Constantinople 11
    end_monitor

    monitor_event SettlementTurnStart SettlementName Constantinople
            
    and I_SettlementOwner Constantinople byzantium
            
    and SettlementBuildingExists cathedral_o
            add_settlement_turmoil Constantinople 9
    end_monitor

    monitor_event SettlementTurnStart SettlementName Constantinople
            
    and I_SettlementOwner Constantinople byzantium
            
    and SettlementBuildingExists huge_cathedral_o
            add_settlement_turmoil Constantinople 7
    end_monitor

    monitor_event CharacterTurnStart IsFactionLeader
        
    and DistanceCapital not 0
            add_settlement_turmoil Constantinople 20
    end_monitor 
    it needed to make higher the level of turmoil in Constantinople. Without temples buildings script should to set the level of turmoil on 20 points, 15 with small temple, 13 with bigger temple and so on. So the script needs to make smaller the level of turmoil after build the next level of the temple. Unfortunately this script make something different. It make the level of turmoil bigger instead smaller after bulid each of level of temples.
    Is there method to fix this mistake?
    Last edited by attyla; December 07, 2011 at 09:52 AM.

  2. #2

    Default Re: Problem with turmoils

    Wrong question
    This is a good one:
    How to restore the state before the script after command add_settlement_turmoil?

  3. #3

    Default Re: Problem with turmoils

    Your problem is that you add those turmoil points every turn without removing them, as you said.
    So either you need to restore a certain turmoil value each turn or you should work with events that fire only once.

    How about this one?

    Spoiler Alert, click show to read: 
    monitor_event SettlementTurnStart SettlementName Constantinople
    and I_SettlementOwner Constantinople = byzantium
    and I_TurnNumber = 1
    add_settlement_turmoil Constantinople 20
    end_monitor


    monitor_event BuildingCompleted SettlementName Constantinople
    and I_SettlementOwner Constantinople = byzantium
    and SettlementBuildingFinished = small_church_o
    add_settlement_turmoil Constantinople -5
    end_monitor

    monitor_event BuildingCompleted SettlementName Constantinople
    and I_SettlementOwner Constantinople = byzantium
    and SettlementBuildingFinished = church_o
    add_settlement_turmoil Constantinople -2
    end_monitor

    monitor_event BuildingCompleted SettlementName Constantinople
    and I_SettlementOwner Constantinople = byzantium
    and SettlementBuildingFinished = abbey_o
    add_settlement_turmoil Constantinople -2
    end_monitor

    monitor_event BuildingCompleted SettlementName Constantinople
    and I_SettlementOwner Constantinople = byzantium
    and SettlementBuildingFinished = cathedral_o
    add_settlement_turmoil Constantinople -2
    end_monitor

    monitor_event BuildingCompleted SettlementName Constantinople
    and I_SettlementOwner Constantinople = byzantium
    and SettlementBuildingFinished = huge_cathedral_o
    add_settlement_turmoil Constantinople -2
    end_monitor


    This script can of course be abused by destroying a religious building and rebuilding it again.
    So you need this additional script to recreate the penalties if the buildings are destroyed...

    Spoiler Alert, click show to read: 

    monitor_event BuildingDestroyed SettlementName Constantinople
    and BuildingName = small_church_o
    add_settlement_turmoil Constantinople 5
    end_monitor

    monitor_event BuildingDestroyed SettlementName Constantinople
    and BuildingName = church_o
    add_settlement_turmoil Constantinople 7
    end_monitor

    monitor_event BuildingDestroyed SettlementName Constantinople
    and BuildingName = abbey_o
    add_settlement_turmoil Constantinople 9
    end_monitor

    monitor_event BuildingDestroyed SettlementName Constantinople
    and BuildingName = cathedral_o
    add_settlement_turmoil Constantinople 11
    end_monitor

    monitor_event BuildingDestroyed SettlementName Constantinople
    and BuildingName = huge_cathedral_o
    add_settlement_turmoil Constantinople 13
    end_monitor



    Concerning the additional penalty for the absence of the faction leader, I would suggest raising the intial penalty and adding a 'law and order'- trait to the byzantine faction leader instead.

  4. #4
    Germanicu5's Avatar Will buy spare time...
    Join Date
    Feb 2009
    Location
    Not Zee Germany
    Posts
    2,101

    Default Re: Problem with turmoils

    How about making it simple:
    Code:
    monitor_event PreFactionTurnStart FactionType byzantium
    and SettlementBuildingExists >= church_o
    set_event counter add_byz_turmoil 0
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType byzantium
    and ! SettlementBuildingExists >= church_o
    set_event counter add_byz_turmoil 1
    end_monitor
    and then go to EDB and add this to each wall level:
    Code:
     law_bonus bonus -2 requires event_counter add_byz_turmoil 1
    Regards
    Last edited by Germanicu5; December 07, 2011 at 01:20 PM.
    I have no memory of this place.

  5. #5

    Default Re: Problem with turmoils

    Bungo Baggins
    Unfortunately the command add_settlement_turmoil doesn't accept value 0 and lower then 0.

    Second script doesn't meet my goals.

    Germanicu5
    Interesting idea. I need to check it. Thanx

  6. #6

    Default Re: Problem with turmoils

    hmmmm
    law_bonus bonus accepts negative values?
    I thought the game only accepts negative values only if there exist the same indicators of positive values​​.
    Last edited by attyla; December 07, 2011 at 02:26 PM.

  7. #7

    Default Re: Problem with turmoils

    Quote Originally Posted by attyla View Post
    hmmmm
    law_bonus bonus accepts negative values?
    I thought the game only accepts negative values only if there exist the same indicators of positive values​​.
    It should work the same way as an add_money or any other that accepts negative numbers i would think....

  8. #8

    Default Re: Problem with turmoils

    Indeed no strict negatives in law, alwas a minimum of 0,
    Still if you can't use a negative value in add_turmoil it's not very useful, so the law bonus would be your best bet, still the easiest way to do this wouldn't even require the campaign script.

    Give constantinople a hidden resource,
    then just give constantinople a unique building a net law decrease somehow, either by a unique building with a law penalty or a line in any building you're sure it will have.
    I would say the unique building as it allows you some for; of communication with the player.

    Code:
      law_bonus bonus -5 requires factions { byzantium, } [optional for none unique building] and hidden_resource Constantinople 
      law_bonus bonus -12 requires factions { turks, } [optional for none unique building] and hidden_resource Constantinople 
      law_bonus bonus -8 requires factions { egypt, } [optional for none unique building] and hidden_resource Constantinople 
    So that gives you some base turmoil, then just add the following line to the church buildings,
    Code:
    law_bonus bonus 2 requires factions { byzantium, } qnd hidden_resource Constantinople
    etc, obviously you can play around with this a bit, but there is no real need for any campaign script involvement,
    if you want Constantinople to go negative you could just have it start with say +5 law and have it drop again if you have a small church.

    I hope the idea is clear.

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

    Default Re: Problem with turmoils

    Turning it on:

    monitor_event SettlementTurnStart SettlementIsLocal
    and SettlementName Constantinople
    and I_LocalFaction byzantium
    and SettlementBuildingExists = small_church_o
    and I_CompareCounter constantinoplechurch1 != 1
    set_counter constantinoplechurch1 1
    add_settlement_turmoil Constantinople 15
    end_monitor

    monitor_event SettlementTurnStart SettlementIsLocal
    and SettlementName Constantinople
    and I_LocalFaction byzantium
    and SettlementBuildingExists = church_o
    and I_CompareCounter constantinoplechurch2 != 1
    if I_CompareCounter constantinoplechurch1 != 1
    set_counter constantinoplechurch1 1
    add_settlement_turmoil Constantinople 15
    end_if
    set_counter constantinoplechurch2 1
    add_settlement_turmoil Constantinople 5
    end_monitor

    monitor_event SettlementTurnStart SettlementIsLocal
    and SettlementName Constantinople
    and I_LocalFaction byzantium
    and SettlementBuildingExists = abbey_o
    and I_CompareCounter constantinoplechurch3 != 1
    if I_CompareCounter constantinoplechurch1 != 1
    set_counter constantinoplechurch1 1
    add_settlement_turmoil Constantinople 15
    end_if
    if I_CompareCounter constantinoplechurch2 != 1
    set_counter constantinoplechurch2 1
    add_settlement_turmoil Constantinople 5
    end_if
    set_counter constantinoplechurch3 1
    add_settlement_turmoil Constantinople 5

    end_monitor

    ...
    etc.

    Turning it off when AI takes settlement:

    monitor_event SettlementTurnStart SettlementName Constantinople
    and not SettlementIsLocal
    and I_CompareCounter constantinoplechurch1 == 1
    if I_CompareCounter constantinoplechurch2 == 1
    set_counter constantinoplechurch2 0
    add_settlement_turmoil Constantinople -5
    end_if
    if I_CompareCounter constantinoplechurch3 == 1
    set_counter constantinoplechurch3 0
    add_settlement_turmoil Constantinople -5
    end_if


    ...
    etc.
    set_counter constantinoplechurch1 0
    add_settlement_turmoil Constantinople -15

    end_monitor

    Turning it off when church has gone:

    monitor_event SettlementTurnStart SettlementIsLocal
    and SettlementName Constantinople
    and not SettlementBuildingExists >= small_church_o
    and I_CompareCounter constantinoplechurch1 == 1
    set_counter constantinoplechurch1 0
    add_settlement_turmoil Constantinople -15
    end_monitor

    monitor_event SettlementTurnStart SettlementIsLocal
    and SettlementName Constantinople
    and not SettlementBuildingExists >= church_o
    and I_CompareCounter constantinoplechurch2 == 1
    set_counter constantinoplechurch1 0
    set_counter constantinoplechurch2 0
    add_settlement_turmoil Constantinople -5
    end_monitor

    monitor_event SettlementTurnStart SettlementIsLocal
    and SettlementName Constantinople
    and not SettlementBuildingExists >= abbey_o
    and I_CompareCounter constantinoplechurch3 == 1
    set_counter constantinoplechurch1 0
    set_counter constantinoplechurch2 0
    set_counter constantinoplechurch3 0
    add_settlement_turmoil Constantinople -5
    end_monitor

    ...
    etc.


    There's probably some wasted stuff in there... Maybe something useful...

    edit:

    I was a little "the worse for wear" when I made this script, but in the cold light of day it still seems fine

    But oops, I notice now that you want something close to the opposite of what I've scripted to happen

    Maybe I will come back and fix it at some point, or maybe you will work it out since you only have to set your base and reverse the turmoil effect stuff.
    Last edited by Taiji; December 10, 2011 at 05:24 AM.

  10. #10

    Default Re: Problem with turmoils

    hmm,
    How does turmoil work anyway? is it reset every turn start or something?
    Because otherwise your script will alway ram up turmoil eevry turn until it's just toomuch to manage.

    Can or can't you add a negative amount of turmoil?

    Without this information none of us will be able to produce even a vaguely adequate script...

  11. #11

    Default Re: Problem with turmoils

    i'm hoping that i understand what your trying to accomplish here....you want there to be a law penalty for not owning a church but you only want it to be a one time penalty that doesn't add on every turn...if this is true then why not set up your first monitor for no church like this...
    PHP Code:
    monitor_event SettlementTurnStart SettlementName Constantinople
            
    and I_SettlementOwner Constantinople byzantium
            
    and SettlementBuildingExists small_church_o
            add_settlement_turmoil Constantinople 20
    end_monitor
    terminate_monitor 


    using terminate_monitor thus making it a one time penalty. from there you could just use the law_bonus on each building to take away from that penalty each time you upgrade it....just a thought and i hope it helps....

    Last edited by valvegas1; December 10, 2011 at 12:25 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
  •