Page 11 of 13 FirstFirst ... 2345678910111213 LastLast
Results 201 to 220 of 250

Thread: Skynet AI

  1. #201

    Default Re: Skynet AI

    ~ello, i have a lil problem
    (battle)when i us Skynet, AI dont want close a breach in the wall
    what i doing wrong?

  2. #202
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Skynet AI

    Close a breach, you mean on the campaign map or the battle map?
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  3. #203
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Skynet AI

    Battle map he meant.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  4. #204

    Default Re: Skynet AI

    Hi,

    I installed your Battle AI to Roar of conquest, I didnīt use the campaign AI only the BAI. I get some error messages whilst on the campaign map.

    17:24:33.950 [game.script] [always] EBII Campaign Based Battle Scripts
    17:24:33.950 [game.script] [always] Activated
    17:31:24.355 [game.script] [error] Script execution error for <set_counter>, at line 28633, in mods/ROC LMA VII/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    Counter capture_pike doesn't exist
    17:31:24.355 [game.script] [error] Script execution error for <set_counter>, at line 28634, in mods/ROC LMA VII/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    Counter capture_hoplite doesn't exist
    17:31:24.355 [game.script] [error] Script execution error for <set_counter>, at line 28635, in mods/ROC LMA VII/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    Counter heavy_horse doesn't exist
    17:31:24.355 [game.script] [error] Script execution error for <set_counter>, at line 28636, in mods/ROC LMA VII/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    Counter medium_battle doesn't exist
    17:31:24.355 [game.script] [error] Script execution error for <set_counter>, at line 28637, in mods/ROC LMA VII/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    Counter large_battle doesn't exist

    Is this normal or have I done something wrong here? No crashes or else so far.

    Thanks in Advance.

  5. #205
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Skynet AI

    You missed lines with declare_counter for all that counters that listed in log entry.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  6. #206

    Default Re: Skynet AI

    Thanks for your Reply,

    where should I set the counters? In the campaign script like this?

    ; *********************************************************************************************
    ; EBII Battle Script Counteres/Timers
    ; *********************************************************************************************

    declare_counter command_and_control
    declare_counter deploy_check
    declare_counter start_battle
    declare_counter FaW_and_S
    declare_counter Release_Labels
    declare_counter AI_GRP
    declare_counter AI_HTC
    declare_counter AI_reinforcements
    declare_counter AI_reinforcements_tc
    declare_counter capture_pike
    declare_counter capture_hoplite
    declare_counter heavy_horse
    declare_counter medium_battle
    declare_counter large_battle
    declare_timer AI_reinforcements_timer


    I really donīt know how I did miss them, just copy and pasted didnīt write anything manually. By closer Examination I found that there are two add-into-campaign-script files in the download, one version from 22/8/2016 and one from 6/5/2016. The 22/8/2016 is the one with the missing counters and a bit shorter but has more counters under Battle starting. Can you please look it up and tell me which version I should use? Another question I have is , the default AI-Labels and Naval Invasion preferances are only need for the Campaign AI right?

    And I found a bug in the download in the export_descr_advice the \ are the wrong way they have to be / to work properly, like this On_display scripts/show_me/background_script.txt. Otherwise the game couldnīt find the background script.
    Last edited by mekkermann; July 22, 2022 at 04:48 AM.

  7. #207

    Default Re: Skynet AI

    And I get a bunch of errors when in Batlle no crashes and the AI seems to behave normal so is this normal?


    11:50:13.271 [game.script] [always] EBII Campaign Based Battle Scripts
    11:50:13.271 [game.script] [always] Activated
    11:50:13.290 [game.script] [always] Battle Started
    11:50:13.290 [game.script] [error] Script execution error for <label_unit>, at line 28744, in mods/ROC LMA VII/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    label_unit referenced non-existent unit
    11:50:13.290 [game.script] [error] Script execution error for <label_unit>, at line 28745, in mods/ROC LMA VII/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    label_unit referenced non-existent unit
    11:50:13.293 [game.script] [error] Script execution error for <label_unit>, at line 28816, in mods/ROC LMA VII/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    label_unit referenced non-existent unit
    11:50:13.293 [game.script] [error] Script execution error for <label_unit>, at line 28817, in mods/ROC LMA VII/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    label_unit referenced non-existent unit
    11:50:13.293 [game.script] [error] Script execution error for <label_unit>, at line 28818, in mods/ROC LMA VII/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    label_unit referenced non-existent unit
    11:50:13.293 [game.script] [error] Script execution error for <label_unit>, at line 28819, in mods/ROC LMA VII/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    label_unit referenced non-existent unit
    11:50:13.293 [game.script] [error] Script execution error for <unit_set_experience>, at line 28839, in mods/ROC LMA VII/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    Error in battle script command 'unit_set_experience': invalid unit label 'Eu5'.

    11:50:13.294 [game.script] [error] Script execution error for <unit_set_experience>, at line 28840, in mods/ROC LMA VII/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    Error in battle script command 'unit_set_experience': invalid unit label 'Eu6'.

    11:50:13.294 [game.script] [error] Script execution error for <unit_set_experience>, at line 28841, in mods/ROC LMA VII/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    Error in battle script command 'unit_set_experience': invalid unit label 'Eu7'.

    11:50:13.294 [game.script] [error] Script execution error for <unit_set_experience>, at line 28842, in mods/ROC LMA VII/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    Error in battle script command 'unit_set_experience': invalid unit label 'Eu8'.

    There are a lot more of this error messages I just donīt want to post all of them.
    Last edited by mekkermann; July 22, 2022 at 05:03 AM.

  8. #208
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Skynet AI

    Log reports about trying to add attributes to not-existing units. I think it's no problem for AI performance.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  9. #209

    Default Re: Skynet AI

    Hold the logfile against the logfile of Tsardoms which uses also skynet AI and it seems to work normal and the errors are there too So I guess nothing to worry about. Had also read an expanded script where I could see the AI working. For future references. I used the 6/5/2016 version of the script, the other seems bugged.

  10. #210
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Skynet AI

    Oh, actually that's my mistake. I did not intend to include the old "Battle Scripts" folder.

    I originally intended only the file in "SkynetAI.zip\data\world\maps\campaign\imperial_campaign" to be used as the battle script. I thought this version was the best overall (since I wanted to be sure it was 100% stable as well, or as close as possible).
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  11. #211

    Default Re: Skynet AI

    Iīm a bit confused. So should I go with the 22/8/2016 version of the Battle script and fix the missing counters? Or was I right in choosing the 6/5/2016 version? The Tsardoms mod also uses the 6/5/2016 version thatīs why I thought this is the correct one. The 22/8/2016 version also has no counters for export section at the end and just ends with end_monitor instead of wait_monitors end_script. Should I add the counters for export section too or is this section not neccesary?
    Last edited by mekkermann; July 23, 2022 at 02:54 PM.

  12. #212

    Default Re: Skynet AI

    I gave the 22/8/2016 version the missing counters and added the counters for export section.

    System.log file now gives me more than just error codes for missing units, like this


    Error in battle script command 'define_unit_group': invalid unit label 'Eu38'.
    20:50:59.715 [game.script] [error] Script execution error for <define_unit_group>, at line 28927, in mods/ROC LMA VII/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    Error in battle script command 'define_unit_group': invalid unit label 'Eu39'.
    20:50:59.716 [game.script] [error] Script execution error for <define_unit_group>, at line 28927, in mods/ROC LMA VII/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    Error in battle script command 'define_unit_group': invalid unit label 'Eu40'.
    20:51:00.414 [game.script] [always] AI Normal Defense
    20:51:02.198 [game.script] [always] AI Normal Defense
    20:51:03.983 [game.script] [always] AI Normal Defense

    Stiil not sure but it looks better from my perspective.

  13. #213

    Default Re: Skynet AI

    Spoiler Alert, click show to read: 
    ; *********************************************************************************************
    ; EBII Battle Scripts
    ; 22/8/2016
    ; z3n
    ; *********************************************************************************************

    ; *********************************************************************************************
    ; EBII Battle Script Counteres/Timers
    ; *********************************************************************************************

    declare_counter command_and_control
    declare_counter deploy_check
    declare_counter start_battle
    declare_counter FaW_and_S
    declare_counter Release_Labels
    declare_counter AI_GRP
    declare_counter AI_HTC
    declare_counter AI_reinforcements
    declare_counter AI_reinforcements_tc
    declare_counter capture_pike
    declare_counter capture_hoplite
    declare_counter heavy_horse
    declare_counter medium_battle
    declare_counter large_battle
    declare_timer AI_reinforcements_timer

    log always EBII Campaign Based Battle Scripts
    log always Activated

    ; *********************************************************************************************
    ; EBII Battle Script Frequency Check - sum of battle_wait = total seconds between repeats
    ; *********************************************************************************************

    monitor_conditions I_BattleStarted

    inc_counter command_and_control 1

    if I_CompareCounter command_and_control = 125
    set_counter command_and_control 0
    end_if

    end_monitor

    ; *********************************************************************************************
    ; Game Reloaded
    ; *********************************************************************************************

    monitor_event GameReloaded

    log always Game Reloaded
    set_counter deploy_check 0
    set_counter Release_Labels 0
    set_counter command_and_control 0
    set_counter AI_GRP 0
    set_counter AI_reinforcements 0
    set_counter AI_HTC 0
    set_counter AI_reinforcements_tc 0
    log always Battle Scripts Reset

    end_monitor

    ; *********************************************************************************************
    ; Battle Starting
    ; *********************************************************************************************

    monitor_event ScrollClosed ScrollClosed prebattle_scroll

    prepare_for_battle
    set_counter command_and_control 0
    set_counter Release_Labels 0
    set_counter AI_GRP 0
    set_counter AI_reinforcements 0
    set_counter AI_HTC 0
    set_counter deploy_check 0
    set_counter capture_pike 0
    set_counter capture_hoplite 0
    set_counter heavy_horse 0
    set_counter medium_battle 0
    set_counter large_battle 0
    set_counter AI_reinforcements_tc 0
    restart_timer AI_reinforcements_timer

    if I_CompareCounter deploy_check = 0
    log always Battle Loading
    end_if

    end_monitor

    ; *********************************************************************************************
    ; Battle Started
    ; *********************************************************************************************

    monitor_conditions I_BattleStarted

    inc_counter deploy_check 1

    if I_CompareCounter deploy_check = 1
    log always Battle Started
    set_counter start_battle 1
    end_if

    end_monitor

    ;;;;*************************************************************************************************
    ;;;; Create Labels
    ;;;;*************************************************************************************************

    monitor_conditions I_BattleStarted
    and I_CompareCounter start_battle = 1

    set_counter Release_Labels 1
    set_counter FaW_and_S 1

    if I_CompareCounter Release_Labels = 1
    set_counter start_battle 0
    end_if

    if I_CompareCounter deploy_check = 1
    ; *********************************************************************************************
    ; Main Army unit Labels
    ; *********************************************************************************************
    label_unit 0 0 0 MAu1
    label_unit 0 0 1 MAu2
    label_unit 0 0 2 MAu3
    label_unit 0 0 3 MAu4
    label_unit 0 0 4 MAu5
    label_unit 0 0 5 MAu6
    label_unit 0 0 6 MAu7
    label_unit 0 0 7 MAu8
    label_unit 0 0 8 MAu9
    label_unit 0 0 9 MAu10
    label_unit 0 0 10 MAu11
    label_unit 0 0 11 MAu12
    label_unit 0 0 12 MAu13
    label_unit 0 0 13 MAu14
    label_unit 0 0 14 MAu15
    label_unit 0 0 15 MAu16
    label_unit 0 0 16 MAu17
    label_unit 0 0 17 MAu18
    label_unit 0 0 18 MAu19
    label_unit 0 0 19 MAu20
    label_unit 0 0 20 MAu21
    label_unit 0 0 21 MAu22
    label_unit 0 0 22 MAu23
    label_unit 0 0 23 MAu24
    label_unit 0 0 24 MAu25
    label_unit 0 0 25 MAu26
    label_unit 0 0 26 MAu27
    label_unit 0 0 27 MAu28
    label_unit 0 0 28 MAu29
    label_unit 0 0 29 MAu30
    label_unit 0 0 30 MAu31
    label_unit 0 0 31 MAu32
    label_unit 0 0 32 MAu33
    label_unit 0 0 33 MAu34
    label_unit 0 0 34 MAu35
    label_unit 0 0 35 MAu36
    label_unit 0 0 36 MAu37
    label_unit 0 0 37 MAu38
    label_unit 0 0 38 MAu39
    label_unit 0 0 39 MAu40
    ; *********************************************************************************************
    ; Allied unit Labels
    ; *********************************************************************************************
    label_unit 1 0 0 Eu1
    label_unit 1 0 1 Eu2
    label_unit 1 0 2 Eu3
    label_unit 1 0 3 Eu4
    label_unit 1 0 4 Eu5
    label_unit 1 0 5 Eu6
    label_unit 1 0 6 Eu7
    label_unit 1 0 7 Eu8
    label_unit 1 0 8 Eu9
    label_unit 1 0 9 Eu10
    label_unit 1 0 10 Eu11
    label_unit 1 0 11 Eu12
    label_unit 1 0 12 Eu13
    label_unit 1 0 13 Eu14
    label_unit 1 0 14 Eu15
    label_unit 1 0 15 Eu16
    label_unit 1 0 16 Eu17
    label_unit 1 0 17 Eu18
    label_unit 1 0 18 Eu19
    label_unit 1 0 19 Eu20
    label_unit 1 0 20 Eu21
    label_unit 1 0 21 Eu22
    label_unit 1 0 22 Eu23
    label_unit 1 0 23 Eu24
    label_unit 1 0 24 Eu25
    label_unit 1 0 25 Eu26
    label_unit 1 0 26 Eu27
    label_unit 1 0 27 Eu28
    label_unit 1 0 28 Eu29
    label_unit 1 0 29 Eu30
    label_unit 1 0 30 Eu31
    label_unit 1 0 31 Eu32
    label_unit 1 0 32 Eu33
    label_unit 1 0 33 Eu34
    label_unit 1 0 34 Eu35
    label_unit 1 0 35 Eu36
    label_unit 1 0 36 Eu37
    label_unit 1 0 37 Eu38
    label_unit 1 0 38 Eu39
    label_unit 1 0 39 Eu40
    end_if

    end_monitor

    monitor_conditions I_BattleStarted
    and I_BattlePlayerArmyNumberOfAttribute general_unit > 0
    and I_BattleEnemyArmyNumberOfAttribute general_unit = 0

    if I_CompareCounter deploy_check = 1
    ; *********************************************************************************************
    ; Help The Captain - AI
    ; *********************************************************************************************
    unit_set_experience Eu1 6
    unit_set_experience Eu2 6
    unit_set_experience Eu3 6
    unit_set_experience Eu4 6
    unit_set_experience Eu5 6
    unit_set_experience Eu6 6
    unit_set_experience Eu7 6
    unit_set_experience Eu8 6
    unit_set_experience Eu9 6
    unit_set_experience Eu10 6
    unit_set_experience Eu11 6
    unit_set_experience Eu12 6
    unit_set_experience Eu13 6
    unit_set_experience Eu14 6
    unit_set_experience Eu15 6
    unit_set_experience Eu16 6
    unit_set_experience Eu17 6
    unit_set_experience Eu18 6
    unit_set_experience Eu19 6
    unit_set_experience Eu20 6
    unit_set_experience Eu21 6
    unit_set_experience Eu22 6
    unit_set_experience Eu23 6
    unit_set_experience Eu24 6
    unit_set_experience Eu25 6
    unit_set_experience Eu26 6
    unit_set_experience Eu27 6
    unit_set_experience Eu28 6
    unit_set_experience Eu29 6
    unit_set_experience Eu30 6
    unit_set_experience Eu31 6
    unit_set_experience Eu32 6
    unit_set_experience Eu33 6
    unit_set_experience Eu34 6
    unit_set_experience Eu35 6
    unit_set_experience Eu36 6
    unit_set_experience Eu37 6
    unit_set_experience Eu38 6
    unit_set_experience Eu39 6
    unit_set_experience Eu40 6
    end_if

    end_monitor

    monitor_conditions I_BattleStarted
    and I_CompareCounter Release_Labels = 1

    if I_CompareCounter deploy_check = 1
    ;Must release Main Army, internal army label is recalibrated upon arrival of AI reinforcements causing 1 (previously the main AI army) to become 0 and 1 to become the secondary AI army.
    release_unit MAu1
    release_unit MAu2
    release_unit MAu3
    release_unit MAu4
    release_unit MAu5
    release_unit MAu6
    release_unit MAu7
    release_unit MAu8
    release_unit MAu9
    release_unit MAu10
    release_unit MAu11
    release_unit MAu12
    release_unit MAu13
    release_unit MAu14
    release_unit MAu15
    release_unit MAu16
    release_unit MAu17
    release_unit MAu18
    release_unit MAu19
    release_unit MAu20
    release_unit MAu21
    release_unit MAu22
    release_unit MAu23
    release_unit MAu24
    release_unit MAu25
    release_unit MAu26
    release_unit MAu27
    release_unit MAu28
    release_unit MAu29
    release_unit MAu30
    release_unit MAu31
    release_unit MAu32
    release_unit MAu33
    release_unit MAu34
    release_unit MAu35
    release_unit MAu36
    release_unit MAu37
    release_unit MAu38
    release_unit MAu39
    release_unit MAu40
    release_unit Eu1
    release_unit Eu2
    release_unit Eu3
    release_unit Eu4
    release_unit Eu5
    release_unit Eu6
    release_unit Eu7
    release_unit Eu8
    release_unit Eu9
    release_unit Eu10
    release_unit Eu11
    release_unit Eu12
    release_unit Eu13
    release_unit Eu14
    release_unit Eu15
    release_unit Eu16
    release_unit Eu17
    release_unit Eu18
    release_unit Eu19
    release_unit Eu20
    release_unit Eu21
    release_unit Eu22
    release_unit Eu23
    release_unit Eu24
    release_unit Eu25
    release_unit Eu26
    release_unit Eu27
    release_unit Eu28
    release_unit Eu29
    release_unit Eu30
    release_unit Eu31
    release_unit Eu32
    release_unit Eu33
    release_unit Eu34
    release_unit Eu35
    release_unit Eu36
    release_unit Eu37
    release_unit Eu38
    release_unit Eu39
    release_unit Eu40
    end_if

    end_monitor

    monitor_conditions I_BattleStarted
    and I_CompareCounter deploy_check = 1

    set_counter Release_Labels 0

    if I_CompareCounter Release_Labels = 0
    ; *********************************************************************************************
    ; Group Labels
    ; *********************************************************************************************
    define_unit_group Allies MAu1 MAu2 MAu3 MAu4 MAu5 MAu6 MAu7 MAu8 MAu9 MAu10 MAu11 MAu12 MAu13 MAu14 MAu15 MAu16 MAu17 MAu18 MAu19 MAu20 MAu21 MAu22 MAu23 MAu24 MAu25 MAu26 MAu27 MAu28 MAu29 MAu30 MAu31 MAu32 MAu33 MAu34 MAu35 MAu36 MAu37 MAu38 MAu39 MAu40

    define_unit_group Enemy Eu1 Eu2 Eu3 Eu4 Eu5 Eu6 Eu7 Eu8 Eu9 Eu10 Eu11 Eu12 Eu13 Eu14 Eu15 Eu16 Eu17 Eu18 Eu19 Eu20 Eu21 Eu22 Eu23 Eu24 Eu25 Eu26 Eu27 Eu28 Eu29 Eu30 Eu31 Eu32 Eu33 Eu34 Eu35 Eu36 Eu37 Eu38 Eu39 Eu40

    set_counter FaW_and_S 0
    end_if

    end_monitor

    ; *********************************************************************************************
    ; Initialize Battle Plans & Monitors
    ; *********************************************************************************************

    ; *********************************************************************************************
    ; AI Unit Monitors
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 10
    and I_BattleStarted
    and not I_BattleIsSiegeBattle
    and I_PercentageUnitKilled Eu1 > 5

    inc_counter AI_GRP 1

    ;AI Units Battle Objective
    ai_gta_add_objective 1 ATTACK_ENEMY_BATTLEGROUP 999
    ;AI Alliance Battle Objective
    ai_gta_plan_set 1 ATTACK_ALL

    end_monitor

    ; *********************************************************************************************
    ; AI Reactions Toward Attacks (Missile/Artillery/Charges)
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 20
    and I_BattleStarted
    and I_BattlePlayerArmyIsAttacker
    and not I_BattleIsSiegeBattle
    and I_PercentageOfArmyKilled 1 0 > 3

    inc_counter AI_GRP 1

    ;AI Units Battle Objective
    ai_gta_add_objective 1 ATTACK_ENEMY_BATTLEGROUP 999
    ;AI Alliance Battle Objective
    ai_gta_plan_set 1 ATTACK_ALL

    end_monitor

    ; *********************************************************************************************
    ; Normal Attack Plan
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 40
    and I_BattleStarted
    and I_ConflictType Normal
    and not I_BattlePlayerArmyIsAttacker

    log always AI Normal Attack
    ;AI Units Battle Objective
    ai_gta_add_objective 1 ATTACK_ENEMY_BATTLEGROUP 999
    ;AI Alliance Battle Objective
    ai_gta_plan_set 1 ATTACK_ALL

    end_monitor

    ; *********************************************************************************************
    ; Normal Defend Plan
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 50
    and I_BattleStarted
    and I_ConflictType Normal
    and I_BattlePlayerArmyIsAttacker

    if I_CompareCounter AI_GRP = 0
    ;AI Units Battle Objective Main Army
    log always AI Normal Defense
    ;AI Alliance Battle Objective Main Army
    ai_gta_plan_set 1 DEFEND_FEATURE
    end_if

    if I_CompareCounter AI_GRP > 0
    log always AI GRP Normal Defense
    ;AI Units Battle Objective
    ai_gta_add_objective 1 ATTACK_ENEMY_BATTLEGROUP 999
    ;AI Alliance Battle Objective
    ai_gta_plan_set 1 ATTACK_ALL
    end_if

    end_monitor

    ; *********************************************************************************************
    ; Assault Crossing
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 60
    and I_BattleStarted
    and I_BattleIsRiverBattle
    and not I_BattlePlayerArmyIsAttacker

    ;AI Alliance Battle Objective
    ai_gta_add_objective 1 ASSAULT_CROSSING 999
    ;AI Units Battle Objective
    ai_gta_plan_set 1 ATTACK_ALL

    end_monitor

    ; *********************************************************************************************
    ; Assault Settlement
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 70
    and I_BattleStarted
    and I_BattleIsSiegeBattle
    and not I_BattlePlayerArmyIsAttacker

    ;AI Alliance Battle Objective
    ai_gta_plan_set 1 ATTACK_SETTLEMENT

    end_monitor

    ; *********************************************************************************************
    ; Sally Out
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 80
    and I_BattleStarted
    and I_BattleIsSallyOutBattle
    and not I_BattlePlayerArmyIsAttacker

    ;AI Units Battle Objective
    ai_gta_add_objective 1 ATTACK_ENEMY_BATTLEGROUP 999
    ;AI Alliance Battle Objective
    ai_gta_plan_set 1 ATTACK_ALL

    end_monitor



    ; *********************************************************************************************
    ; Counters for export
    ; *********************************************************************************************
    ; !! declare and reset counters in 'Battle Starting' section !!
    monitor_conditions I_CompareCounter command_and_control = 100
    and I_BattleStarted

    ; --- testing for number of units with 'rehire_makedones' attribute in AI army - ie Phalangitai ---
    ; if I_BattleEnemyArmyNumberOfAttribute rehire_makedones > 0 ; at least one unit with this attribute was present in the enemy army
    ; set_counter capture_pike 1
    ; end_if

    ; --- testing for number of units with 'rehire_hoplite' attribute in AI army - ie Hoplitai, Etruscans, Liby-Phoenician Infantry or Babylonian Spearmen ---
    ; if I_BattleEnemyArmyNumberOfAttribute rehire_hoplite > 0 ; at least one unit with this attribute was present in the enemy army
    ; set_counter capture_hoplite 1
    ; end_if

    ; --- testing for battle size
    if I_BattleEnemyArmyNumberOfUnits > 7
    and I_BattleEnemyArmyNumberOfUnits < 11
    set_counter medium_battle 1 ; this was a medium sized battle
    end_if
    if I_BattleEnemyArmyNumberOfUnits > 10
    set_counter large_battle 1 ; this was a large sized battle
    end_if

    ; add more tests
    end_monitor

    ; *** DO NOT ADD BATTLE SCRIPT CODE BELOW THIS LINE!! ***
    while I_InBattle ; end of battle script
    end_while


    wait_monitors
    end_script
    Last edited by mekkermann; July 23, 2022 at 02:58 PM.

  14. #214
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Skynet AI

    Is there no file in the data directory I mentioned? Or is it dated 2016? The data directory I mentioned should contain a more up to date version.
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  15. #215

    Default Re: Skynet AI

    Under data\world\maps\campaign\imperial_campaign Bloodthirsty Skynet and normal Skynet have both this file in it.
    Spoiler Alert, click show to read: 
    ;See this post for more information and how to create a campaign script
    ;http://www.twcenter.net/forums/showt...ttle-Scripting

    ; *********************************************************************************************
    ; EBII Battle Scripts
    ; 22/8/2016
    ; z3n
    ; *********************************************************************************************

    ; *********************************************************************************************
    ; EBII Battle Script Counteres/Timers
    ; *********************************************************************************************

    declare_counter command_and_control
    declare_counter deploy_check
    declare_counter start_battle
    declare_counter FaW_and_S
    declare_counter Release_Labels
    declare_counter AI_GRP
    declare_counter AI_HTC
    declare_counter AI_reinforcements
    declare_counter AI_reinforcements_tc
    declare_timer AI_reinforcements_timer

    log always EBII Campaign Based Battle Scripts
    log always Activated

    ; *********************************************************************************************
    ; EBII Battle Script Frequency Check - sum of battle_wait = total seconds between repeats
    ; *********************************************************************************************

    monitor_conditions I_BattleStarted

    inc_counter command_and_control 1

    if I_CompareCounter command_and_control = 125
    set_counter command_and_control 0
    end_if

    end_monitor

    ; *********************************************************************************************
    ; Game Reloaded
    ; *********************************************************************************************

    monitor_event GameReloaded

    log always Game Reloaded
    set_counter deploy_check 0
    set_counter Release_Labels 0
    set_counter command_and_control 0
    set_counter AI_GRP 0
    set_counter AI_reinforcements 0
    set_counter AI_HTC 0
    set_counter AI_reinforcements_tc 0
    log always Battle Scripts Reset

    end_monitor

    ; *********************************************************************************************
    ; Battle Starting
    ; *********************************************************************************************

    monitor_event ScrollClosed ScrollClosed prebattle_scroll

    prepare_for_battle
    set_counter command_and_control 0
    set_counter Release_Labels 0
    set_counter AI_GRP 0
    set_counter AI_reinforcements 0
    set_counter AI_HTC 0
    set_counter deploy_check 0
    set_counter capture_pike 0
    set_counter capture_hoplite 0
    set_counter heavy_horse 0
    set_counter medium_battle 0
    set_counter large_battle 0
    set_counter AI_reinforcements_tc 0
    restart_timer AI_reinforcements_timer

    if I_CompareCounter deploy_check = 0
    log always Battle Loading
    end_if

    end_monitor

    ; *********************************************************************************************
    ; Battle Started
    ; *********************************************************************************************

    monitor_conditions I_BattleStarted

    inc_counter deploy_check 1

    if I_CompareCounter deploy_check = 1
    log always Battle Started
    set_counter start_battle 1
    end_if

    end_monitor

    ;;;;*************************************************************************************************
    ;;;; Create Labels
    ;;;;*************************************************************************************************

    monitor_conditions I_BattleStarted
    and I_CompareCounter start_battle = 1

    set_counter Release_Labels 1
    set_counter FaW_and_S 1

    if I_CompareCounter Release_Labels = 1
    set_counter start_battle 0
    end_if

    if I_CompareCounter deploy_check = 1
    ; *********************************************************************************************
    ; Main Army unit Labels
    ; *********************************************************************************************
    label_unit 0 0 0 MAu1
    label_unit 0 0 1 MAu2
    label_unit 0 0 2 MAu3
    label_unit 0 0 3 MAu4
    label_unit 0 0 4 MAu5
    label_unit 0 0 5 MAu6
    label_unit 0 0 6 MAu7
    label_unit 0 0 7 MAu8
    label_unit 0 0 8 MAu9
    label_unit 0 0 9 MAu10
    label_unit 0 0 10 MAu11
    label_unit 0 0 11 MAu12
    label_unit 0 0 12 MAu13
    label_unit 0 0 13 MAu14
    label_unit 0 0 14 MAu15
    label_unit 0 0 15 MAu16
    label_unit 0 0 16 MAu17
    label_unit 0 0 17 MAu18
    label_unit 0 0 18 MAu19
    label_unit 0 0 19 MAu20
    label_unit 0 0 20 MAu21
    label_unit 0 0 21 MAu22
    label_unit 0 0 22 MAu23
    label_unit 0 0 23 MAu24
    label_unit 0 0 24 MAu25
    label_unit 0 0 25 MAu26
    label_unit 0 0 26 MAu27
    label_unit 0 0 27 MAu28
    label_unit 0 0 28 MAu29
    label_unit 0 0 29 MAu30
    label_unit 0 0 30 MAu31
    label_unit 0 0 31 MAu32
    label_unit 0 0 32 MAu33
    label_unit 0 0 33 MAu34
    label_unit 0 0 34 MAu35
    label_unit 0 0 35 MAu36
    label_unit 0 0 36 MAu37
    label_unit 0 0 37 MAu38
    label_unit 0 0 38 MAu39
    label_unit 0 0 39 MAu40
    ; *********************************************************************************************
    ; Allied unit Labels
    ; *********************************************************************************************
    label_unit 1 0 0 Eu1
    label_unit 1 0 1 Eu2
    label_unit 1 0 2 Eu3
    label_unit 1 0 3 Eu4
    label_unit 1 0 4 Eu5
    label_unit 1 0 5 Eu6
    label_unit 1 0 6 Eu7
    label_unit 1 0 7 Eu8
    label_unit 1 0 8 Eu9
    label_unit 1 0 9 Eu10
    label_unit 1 0 10 Eu11
    label_unit 1 0 11 Eu12
    label_unit 1 0 12 Eu13
    label_unit 1 0 13 Eu14
    label_unit 1 0 14 Eu15
    label_unit 1 0 15 Eu16
    label_unit 1 0 16 Eu17
    label_unit 1 0 17 Eu18
    label_unit 1 0 18 Eu19
    label_unit 1 0 19 Eu20
    label_unit 1 0 20 Eu21
    label_unit 1 0 21 Eu22
    label_unit 1 0 22 Eu23
    label_unit 1 0 23 Eu24
    label_unit 1 0 24 Eu25
    label_unit 1 0 25 Eu26
    label_unit 1 0 26 Eu27
    label_unit 1 0 27 Eu28
    label_unit 1 0 28 Eu29
    label_unit 1 0 29 Eu30
    label_unit 1 0 30 Eu31
    label_unit 1 0 31 Eu32
    label_unit 1 0 32 Eu33
    label_unit 1 0 33 Eu34
    label_unit 1 0 34 Eu35
    label_unit 1 0 35 Eu36
    label_unit 1 0 36 Eu37
    label_unit 1 0 37 Eu38
    label_unit 1 0 38 Eu39
    label_unit 1 0 39 Eu40
    end_if

    end_monitor

    monitor_conditions I_BattleStarted
    and I_BattlePlayerArmyNumberOfAttribute general_unit > 0
    and I_BattleEnemyArmyNumberOfAttribute general_unit = 0

    if I_CompareCounter deploy_check = 1
    ; *********************************************************************************************
    ; Help The Captain - AI
    ; *********************************************************************************************
    unit_set_experience Eu1 6
    unit_set_experience Eu2 6
    unit_set_experience Eu3 6
    unit_set_experience Eu4 6
    unit_set_experience Eu5 6
    unit_set_experience Eu6 6
    unit_set_experience Eu7 6
    unit_set_experience Eu8 6
    unit_set_experience Eu9 6
    unit_set_experience Eu10 6
    unit_set_experience Eu11 6
    unit_set_experience Eu12 6
    unit_set_experience Eu13 6
    unit_set_experience Eu14 6
    unit_set_experience Eu15 6
    unit_set_experience Eu16 6
    unit_set_experience Eu17 6
    unit_set_experience Eu18 6
    unit_set_experience Eu19 6
    unit_set_experience Eu20 6
    unit_set_experience Eu21 6
    unit_set_experience Eu22 6
    unit_set_experience Eu23 6
    unit_set_experience Eu24 6
    unit_set_experience Eu25 6
    unit_set_experience Eu26 6
    unit_set_experience Eu27 6
    unit_set_experience Eu28 6
    unit_set_experience Eu29 6
    unit_set_experience Eu30 6
    unit_set_experience Eu31 6
    unit_set_experience Eu32 6
    unit_set_experience Eu33 6
    unit_set_experience Eu34 6
    unit_set_experience Eu35 6
    unit_set_experience Eu36 6
    unit_set_experience Eu37 6
    unit_set_experience Eu38 6
    unit_set_experience Eu39 6
    unit_set_experience Eu40 6
    end_if

    end_monitor

    monitor_conditions I_BattleStarted
    and I_CompareCounter Release_Labels = 1

    if I_CompareCounter deploy_check = 1
    ;Must release Main Army, internal army label is recalibrated upon arrival of AI reinforcements causing 1 (previously the main AI army) to become 0 and 1 to become the secondary AI army.
    release_unit MAu1
    release_unit MAu2
    release_unit MAu3
    release_unit MAu4
    release_unit MAu5
    release_unit MAu6
    release_unit MAu7
    release_unit MAu8
    release_unit MAu9
    release_unit MAu10
    release_unit MAu11
    release_unit MAu12
    release_unit MAu13
    release_unit MAu14
    release_unit MAu15
    release_unit MAu16
    release_unit MAu17
    release_unit MAu18
    release_unit MAu19
    release_unit MAu20
    release_unit MAu21
    release_unit MAu22
    release_unit MAu23
    release_unit MAu24
    release_unit MAu25
    release_unit MAu26
    release_unit MAu27
    release_unit MAu28
    release_unit MAu29
    release_unit MAu30
    release_unit MAu31
    release_unit MAu32
    release_unit MAu33
    release_unit MAu34
    release_unit MAu35
    release_unit MAu36
    release_unit MAu37
    release_unit MAu38
    release_unit MAu39
    release_unit MAu40
    release_unit Eu1
    release_unit Eu2
    release_unit Eu3
    release_unit Eu4
    release_unit Eu5
    release_unit Eu6
    release_unit Eu7
    release_unit Eu8
    release_unit Eu9
    release_unit Eu10
    release_unit Eu11
    release_unit Eu12
    release_unit Eu13
    release_unit Eu14
    release_unit Eu15
    release_unit Eu16
    release_unit Eu17
    release_unit Eu18
    release_unit Eu19
    release_unit Eu20
    release_unit Eu21
    release_unit Eu22
    release_unit Eu23
    release_unit Eu24
    release_unit Eu25
    release_unit Eu26
    release_unit Eu27
    release_unit Eu28
    release_unit Eu29
    release_unit Eu30
    release_unit Eu31
    release_unit Eu32
    release_unit Eu33
    release_unit Eu34
    release_unit Eu35
    release_unit Eu36
    release_unit Eu37
    release_unit Eu38
    release_unit Eu39
    release_unit Eu40
    end_if

    end_monitor

    monitor_conditions I_BattleStarted
    and I_CompareCounter deploy_check = 1

    set_counter Release_Labels 0

    if I_CompareCounter Release_Labels = 0
    ; *********************************************************************************************
    ; Group Labels
    ; *********************************************************************************************
    define_unit_group Allies MAu1 MAu2 MAu3 MAu4 MAu5 MAu6 MAu7 MAu8 MAu9 MAu10 MAu11 MAu12 MAu13 MAu14 MAu15 MAu16 MAu17 MAu18 MAu19 MAu20 MAu21 MAu22 MAu23 MAu24 MAu25 MAu26 MAu27 MAu28 MAu29 MAu30 MAu31 MAu32 MAu33 MAu34 MAu35 MAu36 MAu37 MAu38 MAu39 MAu40

    define_unit_group Enemy Eu1 Eu2 Eu3 Eu4 Eu5 Eu6 Eu7 Eu8 Eu9 Eu10 Eu11 Eu12 Eu13 Eu14 Eu15 Eu16 Eu17 Eu18 Eu19 Eu20 Eu21 Eu22 Eu23 Eu24 Eu25 Eu26 Eu27 Eu28 Eu29 Eu30 Eu31 Eu32 Eu33 Eu34 Eu35 Eu36 Eu37 Eu38 Eu39 Eu40

    set_counter FaW_and_S 0
    end_if

    end_monitor

    ; *********************************************************************************************
    ; Initialize Battle Plans & Monitors
    ; *********************************************************************************************

    ; *********************************************************************************************
    ; AI Unit Monitors
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 10
    and I_BattleStarted
    and not I_BattleIsSiegeBattle
    and I_PercentageUnitKilled Eu1 > 5

    inc_counter AI_GRP 1

    ;AI Units Battle Objective
    ai_gta_add_objective 1 ATTACK_ENEMY_BATTLEGROUP 999
    ;AI Alliance Battle Objective
    ai_gta_plan_set 1 ATTACK_ALL

    end_monitor

    ; *********************************************************************************************
    ; AI Reactions Toward Attacks (Missile/Artillery/Charges)
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 20
    and I_BattleStarted
    and I_BattlePlayerArmyIsAttacker
    and not I_BattleIsSiegeBattle
    and I_PercentageOfArmyKilled 1 0 > 3

    inc_counter AI_GRP 1

    ;AI Units Battle Objective
    ai_gta_add_objective 1 ATTACK_ENEMY_BATTLEGROUP 999
    ;AI Alliance Battle Objective
    ai_gta_plan_set 1 ATTACK_ALL

    end_monitor

    ; *********************************************************************************************
    ; Normal Attack Plan
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 40
    and I_BattleStarted
    and I_ConflictType Normal
    and not I_BattlePlayerArmyIsAttacker

    log always AI Normal Attack
    ;AI Units Battle Objective
    ai_gta_add_objective 1 ATTACK_ENEMY_BATTLEGROUP 999
    ;AI Alliance Battle Objective
    ai_gta_plan_set 1 ATTACK_ALL

    end_monitor

    ; *********************************************************************************************
    ; Normal Defend Plan
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 50
    and I_BattleStarted
    and I_ConflictType Normal
    and I_BattlePlayerArmyIsAttacker

    if I_CompareCounter AI_GRP = 0
    ;AI Units Battle Objective Main Army
    log always AI Normal Defense
    ;AI Alliance Battle Objective Main Army
    ai_gta_plan_set 1 DEFEND_FEATURE
    end_if

    if I_CompareCounter AI_GRP > 0
    log always AI GRP Normal Defense
    ;AI Units Battle Objective
    ai_gta_add_objective 1 ATTACK_ENEMY_BATTLEGROUP 999
    ;AI Alliance Battle Objective
    ai_gta_plan_set 1 ATTACK_ALL
    end_if

    end_monitor

    ; *********************************************************************************************
    ; Assault Crossing
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 60
    and I_BattleStarted
    and I_BattleIsRiverBattle
    and not I_BattlePlayerArmyIsAttacker

    ;AI Alliance Battle Objective
    ai_gta_add_objective 1 ASSAULT_CROSSING 999
    ;AI Units Battle Objective
    ai_gta_plan_set 1 ATTACK_ALL

    end_monitor

    ; *********************************************************************************************
    ; Assault Settlement
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 70
    and I_BattleStarted
    and I_BattleIsSiegeBattle
    and not I_BattlePlayerArmyIsAttacker

    ;AI Alliance Battle Objective
    ai_gta_plan_set 1 ATTACK_SETTLEMENT

    end_monitor

    ; *********************************************************************************************
    ; Sally Out
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 80
    and I_BattleStarted
    and I_BattleIsSallyOutBattle
    and not I_BattlePlayerArmyIsAttacker

    ;AI Units Battle Objective
    ai_gta_add_objective 1 ATTACK_ENEMY_BATTLEGROUP 999
    ;AI Alliance Battle Objective
    ai_gta_plan_set 1 ATTACK_ALL

    end_monitor



    It misses some declare counters at the beginning which give me error logs in the system.log file as mentioned as above. Thatīs why I added them. The counters for export seem to be not necessary for functionality so I left them out in my newer version, but it makes me feel safer with the "do not add battle script below this line" while I_InBattle ; end of battle script
    end_while. Instead of when it ends with just end_monitor. So it currently looks like this in my campaign_script
    Spoiler Alert, click show to read: 
    ;See this post for more information and how to create a campaign script
    ;http://www.twcenter.net/forums/showt...ttle-Scripting

    ; *********************************************************************************************
    ; EBII Battle Scripts
    ; 22/8/2016
    ; z3n
    ; *********************************************************************************************

    ; *********************************************************************************************
    ; EBII Battle Script Counteres/Timers
    ; *********************************************************************************************

    declare_counter command_and_control
    declare_counter deploy_check
    declare_counter start_battle
    declare_counter FaW_and_S
    declare_counter Release_Labels
    declare_counter AI_GRP
    declare_counter AI_HTC
    declare_counter AI_reinforcements
    declare_counter AI_reinforcements_tc
    declare_counter capture_pike
    declare_counter capture_hoplite
    declare_counter heavy_horse
    declare_counter medium_battle
    declare_counter large_battle
    declare_timer AI_reinforcements_timer

    log always EBII Campaign Based Battle Scripts
    log always Activated

    ; *********************************************************************************************
    ; EBII Battle Script Frequency Check - sum of battle_wait = total seconds between repeats
    ; *********************************************************************************************

    monitor_conditions I_BattleStarted

    inc_counter command_and_control 1

    if I_CompareCounter command_and_control = 125
    set_counter command_and_control 0
    end_if

    end_monitor

    ; *********************************************************************************************
    ; Game Reloaded
    ; *********************************************************************************************

    monitor_event GameReloaded

    log always Game Reloaded
    set_counter deploy_check 0
    set_counter Release_Labels 0
    set_counter command_and_control 0
    set_counter AI_GRP 0
    set_counter AI_reinforcements 0
    set_counter AI_HTC 0
    set_counter AI_reinforcements_tc 0
    log always Battle Scripts Reset

    end_monitor

    ; *********************************************************************************************
    ; Battle Starting
    ; *********************************************************************************************

    monitor_event ScrollClosed ScrollClosed prebattle_scroll

    prepare_for_battle
    set_counter command_and_control 0
    set_counter Release_Labels 0
    set_counter AI_GRP 0
    set_counter AI_reinforcements 0
    set_counter AI_HTC 0
    set_counter deploy_check 0
    set_counter capture_pike 0
    set_counter capture_hoplite 0
    set_counter heavy_horse 0
    set_counter medium_battle 0
    set_counter large_battle 0
    set_counter AI_reinforcements_tc 0
    restart_timer AI_reinforcements_timer

    if I_CompareCounter deploy_check = 0
    log always Battle Loading
    end_if

    end_monitor

    ; *********************************************************************************************
    ; Battle Started
    ; *********************************************************************************************

    monitor_conditions I_BattleStarted

    inc_counter deploy_check 1

    if I_CompareCounter deploy_check = 1
    log always Battle Started
    set_counter start_battle 1
    end_if

    end_monitor

    ;;;;*************************************************************************************************
    ;;;; Create Labels
    ;;;;*************************************************************************************************

    monitor_conditions I_BattleStarted
    and I_CompareCounter start_battle = 1

    set_counter Release_Labels 1
    set_counter FaW_and_S 1

    if I_CompareCounter Release_Labels = 1
    set_counter start_battle 0
    end_if

    if I_CompareCounter deploy_check = 1
    ; *********************************************************************************************
    ; Main Army unit Labels
    ; *********************************************************************************************
    label_unit 0 0 0 MAu1
    label_unit 0 0 1 MAu2
    label_unit 0 0 2 MAu3
    label_unit 0 0 3 MAu4
    label_unit 0 0 4 MAu5
    label_unit 0 0 5 MAu6
    label_unit 0 0 6 MAu7
    label_unit 0 0 7 MAu8
    label_unit 0 0 8 MAu9
    label_unit 0 0 9 MAu10
    label_unit 0 0 10 MAu11
    label_unit 0 0 11 MAu12
    label_unit 0 0 12 MAu13
    label_unit 0 0 13 MAu14
    label_unit 0 0 14 MAu15
    label_unit 0 0 15 MAu16
    label_unit 0 0 16 MAu17
    label_unit 0 0 17 MAu18
    label_unit 0 0 18 MAu19
    label_unit 0 0 19 MAu20
    label_unit 0 0 20 MAu21
    label_unit 0 0 21 MAu22
    label_unit 0 0 22 MAu23
    label_unit 0 0 23 MAu24
    label_unit 0 0 24 MAu25
    label_unit 0 0 25 MAu26
    label_unit 0 0 26 MAu27
    label_unit 0 0 27 MAu28
    label_unit 0 0 28 MAu29
    label_unit 0 0 29 MAu30
    label_unit 0 0 30 MAu31
    label_unit 0 0 31 MAu32
    label_unit 0 0 32 MAu33
    label_unit 0 0 33 MAu34
    label_unit 0 0 34 MAu35
    label_unit 0 0 35 MAu36
    label_unit 0 0 36 MAu37
    label_unit 0 0 37 MAu38
    label_unit 0 0 38 MAu39
    label_unit 0 0 39 MAu40
    ; *********************************************************************************************
    ; Allied unit Labels
    ; *********************************************************************************************
    label_unit 1 0 0 Eu1
    label_unit 1 0 1 Eu2
    label_unit 1 0 2 Eu3
    label_unit 1 0 3 Eu4
    label_unit 1 0 4 Eu5
    label_unit 1 0 5 Eu6
    label_unit 1 0 6 Eu7
    label_unit 1 0 7 Eu8
    label_unit 1 0 8 Eu9
    label_unit 1 0 9 Eu10
    label_unit 1 0 10 Eu11
    label_unit 1 0 11 Eu12
    label_unit 1 0 12 Eu13
    label_unit 1 0 13 Eu14
    label_unit 1 0 14 Eu15
    label_unit 1 0 15 Eu16
    label_unit 1 0 16 Eu17
    label_unit 1 0 17 Eu18
    label_unit 1 0 18 Eu19
    label_unit 1 0 19 Eu20
    label_unit 1 0 20 Eu21
    label_unit 1 0 21 Eu22
    label_unit 1 0 22 Eu23
    label_unit 1 0 23 Eu24
    label_unit 1 0 24 Eu25
    label_unit 1 0 25 Eu26
    label_unit 1 0 26 Eu27
    label_unit 1 0 27 Eu28
    label_unit 1 0 28 Eu29
    label_unit 1 0 29 Eu30
    label_unit 1 0 30 Eu31
    label_unit 1 0 31 Eu32
    label_unit 1 0 32 Eu33
    label_unit 1 0 33 Eu34
    label_unit 1 0 34 Eu35
    label_unit 1 0 35 Eu36
    label_unit 1 0 36 Eu37
    label_unit 1 0 37 Eu38
    label_unit 1 0 38 Eu39
    label_unit 1 0 39 Eu40
    end_if

    end_monitor

    monitor_conditions I_BattleStarted
    and I_BattlePlayerArmyNumberOfAttribute general_unit > 0
    and I_BattleEnemyArmyNumberOfAttribute general_unit = 0

    if I_CompareCounter deploy_check = 1
    ; *********************************************************************************************
    ; Help The Captain - AI
    ; *********************************************************************************************
    unit_set_experience Eu1 6
    unit_set_experience Eu2 6
    unit_set_experience Eu3 6
    unit_set_experience Eu4 6
    unit_set_experience Eu5 6
    unit_set_experience Eu6 6
    unit_set_experience Eu7 6
    unit_set_experience Eu8 6
    unit_set_experience Eu9 6
    unit_set_experience Eu10 6
    unit_set_experience Eu11 6
    unit_set_experience Eu12 6
    unit_set_experience Eu13 6
    unit_set_experience Eu14 6
    unit_set_experience Eu15 6
    unit_set_experience Eu16 6
    unit_set_experience Eu17 6
    unit_set_experience Eu18 6
    unit_set_experience Eu19 6
    unit_set_experience Eu20 6
    unit_set_experience Eu21 6
    unit_set_experience Eu22 6
    unit_set_experience Eu23 6
    unit_set_experience Eu24 6
    unit_set_experience Eu25 6
    unit_set_experience Eu26 6
    unit_set_experience Eu27 6
    unit_set_experience Eu28 6
    unit_set_experience Eu29 6
    unit_set_experience Eu30 6
    unit_set_experience Eu31 6
    unit_set_experience Eu32 6
    unit_set_experience Eu33 6
    unit_set_experience Eu34 6
    unit_set_experience Eu35 6
    unit_set_experience Eu36 6
    unit_set_experience Eu37 6
    unit_set_experience Eu38 6
    unit_set_experience Eu39 6
    unit_set_experience Eu40 6
    end_if

    end_monitor

    monitor_conditions I_BattleStarted
    and I_CompareCounter Release_Labels = 1

    if I_CompareCounter deploy_check = 1
    ;Must release Main Army, internal army label is recalibrated upon arrival of AI reinforcements causing 1 (previously the main AI army) to become 0 and 1 to become the secondary AI army.
    release_unit MAu1
    release_unit MAu2
    release_unit MAu3
    release_unit MAu4
    release_unit MAu5
    release_unit MAu6
    release_unit MAu7
    release_unit MAu8
    release_unit MAu9
    release_unit MAu10
    release_unit MAu11
    release_unit MAu12
    release_unit MAu13
    release_unit MAu14
    release_unit MAu15
    release_unit MAu16
    release_unit MAu17
    release_unit MAu18
    release_unit MAu19
    release_unit MAu20
    release_unit MAu21
    release_unit MAu22
    release_unit MAu23
    release_unit MAu24
    release_unit MAu25
    release_unit MAu26
    release_unit MAu27
    release_unit MAu28
    release_unit MAu29
    release_unit MAu30
    release_unit MAu31
    release_unit MAu32
    release_unit MAu33
    release_unit MAu34
    release_unit MAu35
    release_unit MAu36
    release_unit MAu37
    release_unit MAu38
    release_unit MAu39
    release_unit MAu40
    release_unit Eu1
    release_unit Eu2
    release_unit Eu3
    release_unit Eu4
    release_unit Eu5
    release_unit Eu6
    release_unit Eu7
    release_unit Eu8
    release_unit Eu9
    release_unit Eu10
    release_unit Eu11
    release_unit Eu12
    release_unit Eu13
    release_unit Eu14
    release_unit Eu15
    release_unit Eu16
    release_unit Eu17
    release_unit Eu18
    release_unit Eu19
    release_unit Eu20
    release_unit Eu21
    release_unit Eu22
    release_unit Eu23
    release_unit Eu24
    release_unit Eu25
    release_unit Eu26
    release_unit Eu27
    release_unit Eu28
    release_unit Eu29
    release_unit Eu30
    release_unit Eu31
    release_unit Eu32
    release_unit Eu33
    release_unit Eu34
    release_unit Eu35
    release_unit Eu36
    release_unit Eu37
    release_unit Eu38
    release_unit Eu39
    release_unit Eu40
    end_if

    end_monitor

    monitor_conditions I_BattleStarted
    and I_CompareCounter deploy_check = 1

    set_counter Release_Labels 0

    if I_CompareCounter Release_Labels = 0
    ; *********************************************************************************************
    ; Group Labels
    ; *********************************************************************************************
    define_unit_group Allies MAu1 MAu2 MAu3 MAu4 MAu5 MAu6 MAu7 MAu8 MAu9 MAu10 MAu11 MAu12 MAu13 MAu14 MAu15 MAu16 MAu17 MAu18 MAu19 MAu20 MAu21 MAu22 MAu23 MAu24 MAu25 MAu26 MAu27 MAu28 MAu29 MAu30 MAu31 MAu32 MAu33 MAu34 MAu35 MAu36 MAu37 MAu38 MAu39 MAu40

    define_unit_group Enemy Eu1 Eu2 Eu3 Eu4 Eu5 Eu6 Eu7 Eu8 Eu9 Eu10 Eu11 Eu12 Eu13 Eu14 Eu15 Eu16 Eu17 Eu18 Eu19 Eu20 Eu21 Eu22 Eu23 Eu24 Eu25 Eu26 Eu27 Eu28 Eu29 Eu30 Eu31 Eu32 Eu33 Eu34 Eu35 Eu36 Eu37 Eu38 Eu39 Eu40

    set_counter FaW_and_S 0
    end_if

    end_monitor

    ; *********************************************************************************************
    ; Initialize Battle Plans & Monitors
    ; *********************************************************************************************

    ; *********************************************************************************************
    ; AI Unit Monitors
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 10
    and I_BattleStarted
    and not I_BattleIsSiegeBattle
    and I_PercentageUnitKilled Eu1 > 5

    inc_counter AI_GRP 1

    ;AI Units Battle Objective
    ai_gta_add_objective 1 ATTACK_ENEMY_BATTLEGROUP 999
    ;AI Alliance Battle Objective
    ai_gta_plan_set 1 ATTACK_ALL

    end_monitor

    ; *********************************************************************************************
    ; AI Reactions Toward Attacks (Missile/Artillery/Charges)
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 20
    and I_BattleStarted
    and I_BattlePlayerArmyIsAttacker
    and not I_BattleIsSiegeBattle
    and I_PercentageOfArmyKilled 1 0 > 3

    inc_counter AI_GRP 1

    ;AI Units Battle Objective
    ai_gta_add_objective 1 ATTACK_ENEMY_BATTLEGROUP 999
    ;AI Alliance Battle Objective
    ai_gta_plan_set 1 ATTACK_ALL

    end_monitor

    ; *********************************************************************************************
    ; Normal Attack Plan
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 40
    and I_BattleStarted
    and I_ConflictType Normal
    and not I_BattlePlayerArmyIsAttacker

    log always AI Normal Attack
    ;AI Units Battle Objective
    ai_gta_add_objective 1 ATTACK_ENEMY_BATTLEGROUP 999
    ;AI Alliance Battle Objective
    ai_gta_plan_set 1 ATTACK_ALL

    end_monitor

    ; *********************************************************************************************
    ; Normal Defend Plan
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 50
    and I_BattleStarted
    and I_ConflictType Normal
    and I_BattlePlayerArmyIsAttacker

    if I_CompareCounter AI_GRP = 0
    ;AI Units Battle Objective Main Army
    log always AI Normal Defense
    ;AI Alliance Battle Objective Main Army
    ai_gta_plan_set 1 DEFEND_FEATURE
    end_if

    if I_CompareCounter AI_GRP > 0
    log always AI GRP Normal Defense
    ;AI Units Battle Objective
    ai_gta_add_objective 1 ATTACK_ENEMY_BATTLEGROUP 999
    ;AI Alliance Battle Objective
    ai_gta_plan_set 1 ATTACK_ALL
    end_if

    end_monitor

    ; *********************************************************************************************
    ; Assault Crossing
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 60
    and I_BattleStarted
    and I_BattleIsRiverBattle
    and not I_BattlePlayerArmyIsAttacker

    ;AI Alliance Battle Objective
    ai_gta_add_objective 1 ASSAULT_CROSSING 999
    ;AI Units Battle Objective
    ai_gta_plan_set 1 ATTACK_ALL

    end_monitor

    ; *********************************************************************************************
    ; Assault Settlement
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 70
    and I_BattleStarted
    and I_BattleIsSiegeBattle
    and not I_BattlePlayerArmyIsAttacker

    ;AI Alliance Battle Objective
    ai_gta_plan_set 1 ATTACK_SETTLEMENT

    end_monitor

    ; *********************************************************************************************
    ; Sally Out
    ; *********************************************************************************************

    monitor_conditions I_CompareCounter command_and_control = 80
    and I_BattleStarted
    and I_BattleIsSallyOutBattle
    and not I_BattlePlayerArmyIsAttacker

    ;AI Units Battle Objective
    ai_gta_add_objective 1 ATTACK_ENEMY_BATTLEGROUP 999
    ;AI Alliance Battle Objective
    ai_gta_plan_set 1 ATTACK_ALL

    end_monitor


    ; *** DO NOT ADD BATTLE SCRIPT CODE BELOW THIS LINE!! ***
    while I_InBattle ; end of battle script
    end_while


    wait_monitors
    end_script
    If the 22/8/2016 file is an outdated file (due to a corrupt download link or so) would you please consider Reuploading the file?

    Thank you very much
    Last edited by mekkermann; July 24, 2022 at 12:08 PM.

  16. #216
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Skynet AI

    Those counters don't actually matter, they're for EBII campaign mechanics. You can just ignore the warning errors.




    The file in that place is up to date, but I must have forgotten to change the date of the script in a long time.
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  17. #217

    Default Re: Skynet AI

    So I can safely delete the
    declare_counter capture_pike
    declare_counter capture_hoplite
    declare_counter heavy_horse
    declare_counter medium_battle
    declare_counter large_battle

    counters from the EBII Battle Script Counteres/Timers and Battle Starting sections? I have the feeling that the battle script sometimes restarts due to the errors ,which I like to avoid.
    Last edited by mekkermann; July 24, 2022 at 12:43 PM.

  18. #218
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Skynet AI

    Yeah, that's correct.


    You can remove the set_counters for them as well and anything else related.
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  19. #219

    Default Re: Skynet AI

    The download links aren't working


  20. #220
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Skynet AI

    I'm continuing my work around my BAI, have some videos from tester during internal testing. I'm placing it here because I compare performance with Skynet and Germanicus to see if there's any difference and is there any meaning to continue.
    So first video here is SkynetAI/Germanicus BAI in Bulat Steel 2.1.5. There are some copyright restrictions about soundtrack as I understand, so if video isn't available in your region use VPN.

    Second video is same battle with my TrueGeneral Beta Painless Steel, no restrictions from YouTube announced so no problems expected with it.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

Posting Permissions

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