Results 1 to 4 of 4

Thread: Script Problem with "FactionWarDeclared"

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 Script Problem with "FactionWarDeclared"

    I wanted to write a monitor that fires when a specific faction gets attacked.
    And a second monitor when this faction attacks another faction.

    Underneath the monitor line for both, unfortunately they always fire together....


    1. monitor_event FactionWarDeclared TargetFactionType france ; - France gets attacked
    2. monitor_event FactionWarDeclared FactionType france ; - France attacks


    Maybe I have got the terminology wrong...anyone with some bright ideas?










  2. #2

    Icon1 Re: Script Problem with "FactionWarDeclared"

    Gigantus: It might be worth trying ‘Transgression’ in place of ‘FactionWarDeclared’. That would look something like this:
    Spoiler Alert, click show to read: 
    Code:
    	monitor_event Transgression FactionType france
    		and TargetFactionType england
    		and TransgressionName = TC_DECLARED_WAR
    		...
    	end_monitor
    
    	monitor_event Transgression FactionType england
    		and TargetFactionType france
    		and TransgressionName = TC_DECLARED_WAR
    		...
    	end_monitor

    I have no idea if it will actually work though.

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

    Default Re: Script Problem with "FactionWarDeclared"

    From memory Transgression only fires during turn end - could be wrong about that. Just something to keep in mind while testing at least.

  4. #4
    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: Script Problem with "FactionWarDeclared"

    I messed up the conditions I think, underneath should work.

    Code:
    declare_counter france_war
    monitor_event FactionWarDeclared FactionType france
    and TargetFactionType FactionIsLocal
    
    if I_CompareCounter france_war = 1
        terminate_monitor
    end_if
    
    .....
    
        set_counter france_war 1
    end_monitor 
    
    monitor_event FactionWarDeclared FactionType france
    and TargetFactionType not FactionIsLocal
    
    if I_CompareCounter france_war = 1
        terminate_monitor
    end_if
    
    .....
    
        set_counter france_war 1
    end_monitor
    
    monitor_event FactionWarDeclared FactionType FactionIsLocal
    and TargetFactionType france
    
    if I_CompareCounter france_war = 1
        terminate_monitor
    end_if
    
    .....
    
        set_counter france_war 1
    end_monitor 
    
    monitor_event FactionWarDeclared FactionType not FactionIsLocal
    and TargetFactionType france
    
    if I_CompareCounter france_war = 1
        terminate_monitor
    end_if
    
    .....
    
        set_counter france_war 1
    end_monitor
    Last edited by Gigantus; December 13, 2011 at 04:30 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
  •