Results 1 to 3 of 3

Thread: Problems with "IF" in my script

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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 Problems with "IF" in my script

    It has been driving my batty because I don't understand why this time it's different. I want to create a monitor with multiple options: the monitor should check that two towns have the same owner (a few other counter checks thrown in for good measure) and then execute some deeds. The first try was originally wrapped into [if....end_if] but didn't work. This is what I have tried:

    Code:
    ;This does not work
    monitor_event FactionTurnstart FactionIsLocal
    
            and I_SettlementOwner Bonn = moors
            and I_SettlementOwner Koeln = moors
            and I_EventCounter koeln_cath < 1
            set_event_counter koeln_prot 1
            set_religion Timurids orthodox
            add_events
                event    historic    koeln_kommt_prot
                date    0
                position    130, 198
                movie    event/koeln.bik    
            end_add_events
    
        terminate_monitor
    end_monitor
    
    ;This works
    monitor_conditions I_SettlementOwner Bonn = moors
            and I_SettlementOwner Koeln = moors
            and I_EventCounter koeln_cath < 1
            set_event_counter koeln_prot 1
            set_religion Timurids orthodox
            add_events
                event    historic    koeln_kommt_prot
                date    0
                position    130, 198
                movie    event/koeln.bik    
            end_add_events
    
        terminate_monitor
    end_monitor
    
    :This doesn't
    monitor_conditions I_SettlementOwner Bonn = moors
    
        if I_SettlementOwner Koeln = moors
            and I_EventCounter koeln_cath < 1
            set_event_counter koeln_prot 1
            set_religion Timurids orthodox
            add_events
                event    historic    koeln_kommt_prot
                date    0
                position    130, 198
                movie    event/koeln.bik    
            end_add_events
        end_if
    
        terminate_monitor
    end_monitor
    Can someone shed some light on what is happening here? I want to wrap it into [if..end_if] because I want to check a couple of factions and I don't want to write an independent monitor for each faction.










  2. #2

    Icon1 Re: Problems with "IF" in my script

    gigantus: Try this:
    Spoiler Alert, click show to read: 
    Code:
    	monitor_event FactionTurnstart FactionIsLocal
    		and I_EventCounter koeln_prot = 0
    		if I_EventCounter koeln_prot = 0
    		and I_SettlementOwner Bonn = moors
    		and I_SettlementOwner Koeln = moors
    		set_event_counter koeln_prot 1
    	end_if
    		if I_EventCounter koeln_prot = 0
    		and I_SettlementOwner Bonn = spain
    		and I_SettlementOwner Koeln = spain
    		set_event_counter koeln_prot 1
    	end_if
    	end_monitor
    
    	monitor_conditions I_EventCounter koeln_prot = 1
            	and I_EventCounter koeln_cath < 1
            	set_religion Timurids orthodox
            add_events
                event    historic    koeln_kommt_prot
                date    0
                position    130, 198
                movie    event/koeln.bik    
            end_add_events
        	terminate_monitor
    	end_monitor

  3. #3
    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: Problems with "IF" in my script

    It's worth a try, thanks.










Posting Permissions

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