Page 4 of 4 FirstFirst 1234
Results 61 to 71 of 71

Thread: Lesson 3

  1. #61

    Default Re: Lesson 3

    @ AL : Yes , i noticed it FantionTurnEnd

    And i'll see if the holy script works .

    Spoiler Alert, click show to read: 
    Code:
    script
    
    ;;; armoury ;;;
    
    monitor_event SettlementSelected SettlementBuildingExists = plate_armourer
    
     set_event_counter armory_present 1
    
    end_monitor
    
    monitor_event SettlementSelected not SettlementBuildingExists = plate_armourer
    
     set_event_counter armory_present 0
    
    end_monitor
    
    monitor_event FactionTurnEnd FactionIsLocal
    
     set_event_counter armory_present 1
    
    end_monitor
    
    ;;;;;;;;;;;Holy unit ;;;;;;;;;;;
    
    monitor_event FactionTurnStart FactionType england
      and FactionIsLocal
      and DiplomaticStanceFromFaction papal_states > Allied
      and I_SettlementOwner Jerusalem = england
    
     set_event_counter holy_unit 1 ; needed for holy barracks
    
    end_monitor
    
    monitor_event FactionTurnStart FactionType england
      and FactionIsLocal
      and DiplomaticStanceFromFaction papal_states = Allied
      and I_SettlementOwner Jerusalem = england
    
     set_event_counter holy_unit 0 ; needed for holy barracks
    
    end_monitor
    
    monitor_event FactionTurnStart FactionType england
      and FactionIsLocal
      and DiplomaticStanceFromFaction papal_states > Allied
      and not I_SettlementOwner Jerusalem = england
    
     set_event_counter holy_unit 0 ; needed for holy barracks
    
    end_monitor
    
    monitor_event FactionTurnEnd FactionIsLocal
    ;   and not FactionType england
    
     set_event_counter holy_unit 1 ; needed for holy barracks
    
    end_monitor
    
    ;;;;;;;;;; Hero stuff ;;;;;;;;;;;;;
    
    monitor_conditions I_FactionLeaderTrait england GoodCommander >= 2
    
     set_event_counter hero 1
    
    end_monitor
    
    monitor_conditions I_FactionLeaderTrait england GoodCommander <= 3
    
     set_event_counter hero 0
    
    end_monitor
    
    monitor_event FactionTurnEnd FactionIsLocal
    
     set_event_counter hero 1
    
    end_monitor
    
    wait_monitors
    end_script

  2. #62

    Default Re: Lesson 3

    Quote Originally Posted by Augustus Lucifer View Post
    @ Theodotos I:

    Have you tested this one? It shouldn't work as written, because you're using a condition which requires a trigger in an if statement. The only conditions which can be used in if statements start with I_ because the event doesn't export its triggers to if statements within it. What the I_ conditions do is supply their own trigger parameters or require none except a true/false, which is why they work independently of events and often require more parameters than their counterparts.
    Actually, no. Usually I do, but I couldn't figure out how to get Settlement Health that low to begin with. Is there a way to rewrite the script to make it work, or should I just throw it away and start fresh?
    Son of PW

  3. #63
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Lesson 3

    Quote Originally Posted by Theodotos I View Post
    Actually, no. Usually I do, but I couldn't figure out how to get Settlement Health that low to begin with. Is there a way to rewrite the script to make it work, or should I just throw it away and start fresh?
    You would just attach it to the monitor and make a counter-monitor.

    Code:
    monitor_event SettlementSelected HealthPercentage < 35
      set_event_counter putrid_streets 1
      historic_event sewage_problem
    end_monitor
    
    monitor_event SettlementSelected HealthPercentage >= 35
      set_event_counter putrid_streets 0
    end_monitor
    Could also use not HealthPercentage < 35 on the second one, it does the same thing. If you're having trouble testing it, use a higher value or specify it in the opposite direction. If it works principally, it should work for < 35 assuming no syntax errors or sweeping changes are made in reverting it to how you want it.

  4. #64

    Default Re: Lesson 3

    Doh shows i need to check my scripts properly before posting. I think i got them both the first was obvious when i looked.

    Spoiler Alert, click show to read: 

    ;England are expanding lets build a stone wall
    monitor_event FactionTurnEnd FactionType england
    and FactionIsLocal
    and I_SettlementOwner York = england
    set_event_counter proud_people 1
    end_monitor

    monitor_event FactionTurnEnd FactionType england
    and FactionIsLocal
    and not I_SettlementOwner York = england
    set_event_counter proud_people 0
    end_monitor

    monitor_event FactionTurnEnd FactionIsLocal
    set_event_counter proud_people 1
    end_monitor

    ; keep script unfinished until last monitor termination
    wait_monitors
    end_script



    Hope you are better now Augustus
    Last edited by Alex-ander; July 31, 2009 at 10:02 AM.

  5. #65
    B. Ward's Avatar ★★★★ RockNRolla ★★★★
    Join Date
    Feb 2007
    Location
    East Coast, United States
    Posts
    4,376

    Default Re: Lesson 3

    Today or tomorrow.

  6. #66
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Lesson 3

    Quote Originally Posted by Alex-ander View Post
    Doh shows i need to check my scripts properly before posting. I think i got them both the first was obvious when i looked.

    Spoiler Alert, click show to read: 

    ;England are expanding lets build a stone wall
    monitor_event FactionTurnEnd FactionType england
    and FactionIsLocal
    and I_SettlementOwner York = england
    set_event_counter proud_people 1
    end_monitor

    monitor_event FactionTurnEnd FactionType england
    and FactionIsLocal
    and not I_SettlementOwner York = england
    set_event_counter proud_people 0
    end_monitor

    monitor_event FactionTurnEnd FactionIsLocal
    set_event_counter proud_people 1
    end_monitor

    ; keep script unfinished until last monitor termination
    wait_monitors
    end_script



    Hope you are better now Augustus
    Yes I'm fine now. Looks good.

    Quote Originally Posted by B. Ward View Post
    Today or tomorrow.
    F-

  7. #67

    Default Re: Lesson 3

    Here's the rest of my script. I upped the numbers, because it wasn't serving the purpose I wanted it to. Anyway, it should work now, unless my copy-paste jams it out of sync.
    monitor_event SettlementSelected HealthPercentage < 49
    set_event_counter putrid_streets 1
    historic_event sewage_problem
    end_monitor

    monitor_event SettlementSelected not HealthPercentage < 49
    set_event_counter putrid_streets 0
    end_monitor

    monitor_event FactionTurnEnd FactionIsLocal
    set_event_counter putrid_streets 1
    end_monitor
    Son of PW

  8. #68

    Default Re: Lesson 3

    i have finally updated the post #2 with some new thoughts, can some one tell me if using the same script(structurally) can be consider a character and condition script?.(see post #2)

    Another thing , i was trying to make a cultural script or more exact way to put it, a racist script , where factions of the same the culture can unlock buildings that improve the economy,
    Spoiler Alert, click show to read: 
    Code:
    monitor_event FactionTradeAgreementMade TargetFactionCultureType britton
    and FactionBuildingExists >= roads
    set_event_counter trade_cavallos 1
    end_monitor
    monitor_event FactionTradeAgreementMade not TargetFactionCultureType britton
    set_event_counter trade_cavallos 0
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    set_event_counter trade_cavallos 1
    end_monitor
    EDB:
    Code:
    building horse_supplier
    {
        levels horse_farmer horse_dealer horse_trader
        {
            horse_farmer  requires factions { middle_eastern, eastern_european, greek, southern_european, northern_european, } and event_counter trade_cavallos 1
            {
                capability
                {
                trade_base_income_bonus bonus 1 requires event_counter is_the_ai 0
                trade_base_income_bonus bonus 2 requires event_counter is_the_ai 1
                }
                material wooden
                construction  2
                cost  3750 
                settlement_min village
                upgrades
                {
                    horse_dealer
                }
            }

    i found 2 problems ,
    1- The building (horse farmer) is available every 2 turns, so if this turn is available the next one it wont be, and is not what i was trying to made, and when the target faction made the trade agreement the horse farmer is lock for ever.

    Any help is appreciated.
    Last edited by Icedie El Guaraní; August 06, 2009 at 08:01 AM.
    Contribuitor IBIICB-WOTN-Modeler-Scripter


  9. #69

    Default Re: Lesson 3

    Quote Originally Posted by Icedie of South View Post
    i have finally updated the post #2 with some new thoughts, can some one tell me if using the same script(structurally) can be consider a character and condition script?.(see post #2)

    Another thing , i was trying to make a cultural script or more exact way to put it, a racist script , where factions of the same the culture can unlock buildings that improve the economy,
    Spoiler Alert, click show to read: 
    Code:
    monitor_event FactionTradeAgreementMade TargetFactionCultureType britton
    and FactionBuildingExists >= roads
    set_event_counter trade_cavallos 1
    end_monitor
    monitor_event FactionTradeAgreementMade not TargetFactionCultureType britton
    set_event_counter trade_cavallos 0
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    set_event_counter trade_cavallos 1
    end_monitor
    EDB:
    Code:
    building horse_supplier
    {
        levels horse_farmer horse_dealer horse_trader
        {
            horse_farmer  requires factions { middle_eastern, eastern_european, greek, southern_european, northern_european, } and event_counter trade_cavallos 1
            {
                capability
                {
                trade_base_income_bonus bonus 1 requires event_counter is_the_ai 0
                trade_base_income_bonus bonus 2 requires event_counter is_the_ai 1
                }
                material wooden
                construction  2
                cost  3750 
                settlement_min village
                upgrades
                {
                    horse_dealer
                }
            }

    i found 2 problems ,
    1- The building (horse farmer) is available every 2 turns, so if this turn is available the next one it wont be, and is not what i was trying to made, and when the target faction made the trade agreement the horse farmer is lock for ever.


    Any help is appreciated.
    Check this post. I tried the trade agreement thing myself.
    Son of PW

  10. #70

    Default Re: Lesson 3

    Yeah, it works i think i have done lesson 3!! check on post number #2

    EDITED
    Bump
    as soon as i add this script to a second faction the building is available right after second turn with no agreements made what so ever by me or the other faction.
    Last edited by Icedie El Guaraní; August 08, 2009 at 09:08 PM.
    Contribuitor IBIICB-WOTN-Modeler-Scripter


  11. #71
    aduellist's Avatar Push the button Max!
    Join Date
    Mar 2005
    Location
    Shenandoah Valley
    Posts
    1,822

    Default Re: Lesson 3

    Okay, GED and AL. I know I'm waaaaaay late on this. Here's script code for this lesson:

    Spoiler Alert, click show to read: 
    Code:
    ; Construction conditional events
    
    ; Zero event counters at beginning of player turn
    
    monitor_event FactionTurnStart FactionIsLocal
       set_event_counter governor_present 0
       set_event_counter monarch_resident 0
    end_monitor
    
    ;  Is a governor present and is that governor the king?
    
    monitor_event SettlementSelected GovernorInResidence
       and FactionIsLocal
          set_event_counter governor_present 1
    
          if GovernorAttribute FactionLeader > 0
             set_event_counter monarch_resident 1
          end_if
    
    end_monitor
    
    ; Reset to 0 if settlement selected does not have governor
    
    monitor_event SettlementSelected not GovernorInResidence
       and FactionIsLocal
          set_event_counter governor_present 0
          set_event_counter monarch_resident 0
    end_monitor
    
    ; Set counters to 1 for AI (no AI construction restrictions)
    
    monitor_event FactionTurnEnd FactionIsLocal
       set_event_counter governor_present 1
       set_event_counter monarch_resident 1
    end_monitor
    
    ; Event to disable recruitment of Catholic priests if faction is Excommunicated (player and AI)
    
    monitor_event FactionTurnStart Religion catholic
       set_event_counter interdict 0
    
       if FactionExcommunicated
          set_event_counter interdict 1
       end_if
    
    end_monitor[


    And here's the code from EDB:

    Spoiler Alert, click show to read: 


    Example of code for military buildings, which require a governor to be present:

    Code:
            stables castle requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, } and event_counter governor_present 1
    
            knights_stables castle requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, } and event_counter governor_present 1 
    
            barons_stables castle requires factions { scotland, denmark, hre, france, england, middle_eastern, eastern_european, greek, southern_european, } and event_counter governor_present 1 
    
            earls_stables castle requires factions { scotland, denmark, hre, france, england, middle_eastern, eastern_european, greek, southern_european, } and event_counter governor_present 1
    Example for various "royal" military buildings, which require FL to be resident governor:

    Code:
            kings_stables castle requires factions { hre, france, middle_eastern, eastern_european, greek, venice, } and event_counter monarch_resident 1
    Example of code which prevents recruitment of priests if faction is excommunicated. This applies to AI as well.

    Code:
            small_church city requires factions { normans, denmark, hre, scotland, france, england, hungary, poland, venice, papal_states, portugal, spain, sicily, milan, } 
            {
                convert_to 0
                capability
                {
                    agent priest  0  requires factions { normans, denmark, scotland, hre, france, england, } and  not event_counter interdict 1
                    agent priest  0  requires factions { hungary, poland, } and  not event_counter interdict 1 
                    agent priest  0  requires factions { papal_states, portugal, spain, sicily, milan, venice, } and  not event_counter interdict 1 
                    happiness_bonus bonus 1
                    religion_level bonus 1
    ;                pope_disapproval 1
                    agent_limit priest 1
                }
                material wooden
                construction  1 
                cost  800 
                settlement_min town
                upgrades
                {
                    church
                }
            }


    The interesting thing is that the "governor_present" one is cheatable. If you select a settlement without a Governor, none of the military buildings show up as available for construction. If you then move a unit into the settlement, which does not require selecting the settlement, all buildings are available. Couldn't see a way around that one.

    Now to attempt to catch up on Lesson 4...
    Under the patronage of TheFirstONeill
    Proud team member of
    THERA, A New Beginning


    "The trouble with fighting for human freedom is that one spends most of one's time defending scoundrels. For it is against scoundrels that oppressive laws are first aimed, and oppression must be stopped at the beginning if it is to be stopped at all." H. L. Mencken

    "Liberty is meaningless where the right to utter one’s thoughts and opinions has ceased to exist. That, of all rights, is the dread of tyrants. It is the right which they first of all strike down." Frederick Douglass

Page 4 of 4 FirstFirst 1234

Posting Permissions

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