Results 1 to 1 of 1

Thread: Advanced Scripting - GeneralAssaultsGeneral -> Target Character

  1. #1
    Member Member Alexandrivs's Avatar
    Join Date
    Dec 2012
    Location
    Rome
    Posts
    127

    Exclamation Advanced Scripting - GeneralAssaultsGeneral -> Target Character

    Hi every one,
    I'm currently working on a script that spawns an AI army that lay siege on a AI settlement.
    Everything is going fine, i use a trait that drop army movement's points to zero,preventing the lifting of the siege.

    Now, this siege must be interrupted by the player or must end with the win of the attacker.
    My problem occurs when the defending AI armies, try to sally / attack my spawned general. I need his forced victory.
    So,first i need to check if he's under attack, and then let him auto_win.

    But i cannot manage to restrict this condition only to him. ( i gave a traits that identify the sieging army)

    Here's my code:

    Code:
    monitor_event GeneralAssaultsGeneral TargetFactionType romani
    	and not TargetCharacterIsLocal
            and not FactionIsLocal 
    	and I_SettlementUnderSiege Cures
    	and Trait Aisiegingarmy = 1  ;;I use this trait to  identify the attacked general, but this conditions refers to the attacker, and not the defender...
    	and I_CompareCounter cures_siege_started = 1
            
           console_command auto_win defender
    
    terminate_monitor
    end_monitor
    My code should work if i know how to manage other exports by GeneralAssaultsGeneral that refers to the target_character_records.
    In other words, i need some condition like one of the following:

    TargetCharacterTrait
    TargetCharacterHasAnc
    TargetCharacterName


    Any help?
    Thank you...
    Last edited by Alexandrivs; 12-19-2012 at 01:06.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO