Results 1 to 3 of 3

Thread: script help needed

Hybrid View

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

    Default script help needed

    Hi All!

    I am trying to write this script but it does not seem to work. Can one the BIG dogs have a peek and tell me what is wrong if any?

    declare_counter loop
    set_counter loop 0

    monitor_event FactionTurnStart FactionType egypt
    and not FactionIsLocal

    console_command auto_win attacker

    end_monitor
    while I_CompareCounter loop = 0
    end_while


    Thanks.

  2. #2
    Lusted's Avatar Look to the stars
    Join Date
    Jan 2005
    Location
    Brighton, Sussex, England.
    Posts
    18,184

    Default

    Moved to the mod workshop.
    Creator of:
    Lands to Conquer Gold for Medieval II: Kingdoms
    Terrae Expugnandae Gold Open Beta for RTW 1.5
    Proud ex-Moderator and ex-Administrator of TWC from Jan 06 to June 07
    Awarded the Rank of Opifex for outstanding contributions to the TW mod community.
    Awarded the Rank of Divus for oustanding work during my times as Administrator.

  3. #3

    Default

    Quote Originally Posted by Gaius'TableScrap
    declare_counter loop
    set_counter loop 0

    monitor_event FactionTurnStart FactionType egypt
    and not FactionIsLocal

    console_command auto_win attacker

    end_monitor
    while I_CompareCounter loop = 0
    end_while
    I'm not a big dog, but I can give you my 2 cents.

    For me one possible problem is that the script has to monitor one event, happening in one given moment, but at that very moment there is no battle to fight.

    The possible solution for this might be to monitor a general condition, but the exact syntax would depend on your idea about who/when/why the attacker must win a battle in the turn of egypt, as an AI faction.

    Just to test the command, you could try something like this:
    Code:
    script
    declare_counter loop
    declare_counter egypt_turn
    set_counter loop 0
    set_counter egypt_turn 0
    
    monitor_event FactionTurnStart FactionType egypt
    and not FactionIsLocal
    set_counter egypt_turn 1
    terminate_monitor
    end_monitor
    
    monitor_conditions I_CompareCounter egypt_turn = 1
    console_command auto_win attacker
    terminate_monitor
    end_monitor
    
    monitor_event FactionTurnEnd FactionType egypt
    and not FactionIsLocal
    set_counter egypt_turn 0
    terminate_monitor
    end_monitor
    
    while I_CompareCounter loop = 0
    end_while
    
    end_script
    The idea (as you can see) is to trigger the condition only during the egypt turn. The auto_win command shouldn't be operative during the rest of the turns.
    In case it works (I doubt it, but who knows ), post it here.

Posting Permissions

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