Research causes crash :(

Help - Resources - AI Scripting - Grafting - Plugins - Modding Projects
Count.Dracula
Posts: 21
Joined: Mon Sep 28, 2009 11:51 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Research causes crash :(

Postby Count.Dracula » Sat Oct 24, 2009 2:07 am

This is my AI script for Protoss. It sometimes crashes the game while it's base is under severe attack during game time 20-40 minutes (Protoss AI vs. Protoss AI) After a few hours of debugging, I located that the research part was responsible for this crash. Some researches are done in the building part, and I used a time_jump command to avoid possible conflicts. However, I couldn't make any further progress... It seems there is no way that the research could crash the game, as 95%-100% researches would be already done at the point the game crashed... Could anyone help me out? Thanks in advance!
Here is the error message:
[attachment=2098:Snap4.jpg]



CODE
; ASC3 File generated by JSL
;
; Script name : Protoss Expansion Custom Level

script_name Protoss Expansion Custom Level
script_id PMCx

; === STARTUP SETTINGS ===

start_town
defaultbuild_off
default_min 0
farms_timing
transports_off

; === DEFINE MAX PER UNIT ===
define_max 64 probe
define_max 36 zealot
define_max 24 dragoon
define_max 12 reaver
define_max 24 scout
define_max 6 shuttle
define_max 18 carrier
define_max 6 observer
define_max 24 corsair
define_max 32 high_templar
define_max 6 dark_archon
define_max 10 archon
define_max 6 arbiter
define_max 32 dark_templar
define_max 18 hero_artanis
define_max 24 hero_raszagal
define_max 24 hero_archon
define_max 18 hero_aldaris

; === COMPUTER PLAYER SPECIAl OPERATION ===
multirun unit_creation_timer
wait 1
multirun hero_generation_timer
wait 1
multirun c_showmethemoney

; === START BUILDING ===
build 1 nexus 150
wait_build 1 nexus
build 4 probe 130
wait_build 4 probe
build 1 assimilator 80
build 8 probe 80
wait_buildstart 8 probe
build 1 pylon 80
wait_buildstart 1 pylon
build 2 pylon 80
wait_buildstart 2 pylon
build 3 pylon 80
wait_buildstart 3 pylon
build 4 pylon 80
multirun initial_gateway
wait_buildstart 1 gateway
multirun initial_forge
wait_build 1 gateway
multirun initial_cyberneticscore
wait 1
multirun initial_shieldbattery
wait 1
multirun initial_cannon
wait 1
multirun startdefenseblock
wait 1
multirun cheating_check
build 12 probe 80
wait_buildstart 12 probe
build 5 pylon 80
wait_buildstart 5 pylon
build 16 probe 80
wait_buildstart 16 probe
multirun mid_gateway
build 6 pylon 80
wait_buildstart 6 pylon
build 7 pylon 80
wait_buildstart 7 pylon
multirun final_gateway
build 8 pylon 80
wait_buildstart 8 pylon
build 20 probe 80
wait_buildstart 20 probe
multirun robotics1
wait 1
multirun robotics2
wait 1
multirun robotics3
expand 1 subbase1
build 9 pylon 80
wait_buildstart 9 pylon
multirun middle_cannon
build 10 pylon 80
wait_buildstart 10 pylon
expand 2 subbase2
build 11 pylon 80
wait_buildstart 11 pylon
multirun fleet
build 12 pylon 80
wait_buildstart 12 pylon
build 24 probe 80
wait_buildstart 24 probe
multirun arbiter
wait 1
multirun final_shieldbattery
expand 3 subbase3
multirun finaldefenseblock
build 13 pylon 80
wait_buildstart 13 pylon
build 14 pylon 80
wait_buildstart 14 pylon
build 15 pylon 80
wait_buildstart 15 pylon
multirun final_cannon
wait 1
multirun expandX_timer
goto repeatmain_prebreak

; === REPEAT MASS ATTACK LOOP ===
:repeatmain_prebreak
wait 1500
goto repeatmain

:repeatmain
time_jump 40 repeatfinal_preparation
send_suicide 0
multirun m_bigattackcheck
wait 1500
goto repeatmain

:repeatfinal_preparation
clear_combatdata
goto repeatfinal

:repeatfinal
multirun m_bigattackcheck
wait 4500
send_suicide 0
goto repeatfinal

; ### BUILD SCRIPT PARTS ###

; >> GATEWAY SCRIPT PART
:initial_gateway
wait_build 1 pylon
build 1 gateway 80
wait_buildstart 1 gateway
build 2 gateway 80
wait_buildstart 2 gateway
build 3 gateway 80
wait_buildstart 3 gateway
build 4 gateway 80
goto m_rushcheck

:mid_gateway
wait_build 1 cybernetics_core
build 1 citadel_of_adun 80
wait_build 1 citadel_of_adun
multirun rebuild_citadel_of_adun_check
wait 1
multirun r_templarupgrades1
build 1 templar_archives 80
wait_build 1 templar_archives
multirun rebuild_templar_archives_check
wait 1
multirun m_rushcheck
place_guard high_templar 2
place_guard high_templar 1
place_guard high_templar 0
place_guard hero_archon 1
place_guard hero_archon 0
stop

:final_gateway
wait_build 1 templar_archives
multirun r_templarupgrades2
place_guard dark_archon 1
place_guard dark_archon 0
train 4 dark_templar
train 6 archon
train 4 high_templar
stop

; >> FORGE SCRIPT PART
:initial_forge
wait_build 1 pylon
build 1 forge 80
wait_buildstart 1 forge
build 2 forge 80
wait_build 2 forge
multirun rebuild_forge_check
goto r_groundupgrades1

; >> SHIELD_BATTERY PART
:initial_shieldbattery
wait_build 1 gateway
wait_build 3 pylon
build 2 shield_battery 80
stop

:final_shieldbattery
wait_build 1 gateway
build 3 shield_battery 80
wait_buildstart 3 shield_battery
build 4 shield_battery 80
stop

; >> CYBERNETICS_CORE PART
:initial_cyberneticscore
wait_build 1 gateway
wait_build 2 pylon
build 1 cybernetics_core 80
wait_buildstart 1 cybernetics_core
build 2 cybernetics_core 80
wait_build 2 cybernetics_core
multirun rebuild_cybernetics_core_check
wait 1
multirun m_rushcheck
wait 1
goto r_cyberupgrades

; >> PHOTON_CANNON PART
:initial_cannon
wait_build 1 forge
build 1 photon_cannon 80
wait_buildstart 1 photon_cannon
build 2 photon_cannon 80
wait_buildstart 2 photon_cannon
build 3 photon_cannon 80
stop

:middle_cannon
wait_build 1 forge
build 4 photon_cannon 80
wait_buildstart 4 photon_cannon
build 5 photon_cannon 80
wait_buildstart 5 photon_cannon
build 6 photon_cannon 80
wait_build 6 photon_cannon
build 7 photon_cannon 80
wait_buildstart 7 photon_cannon
build 8 photon_cannon 80
stop

:final_cannon
wait_build 1 forge
build 9 photon_cannon 80
wait_buildstart 9 photon_cannon
build 10 photon_cannon 80
wait_buildstart 10 photon_cannon
build 16 pylon 80
wait_buildstart 16 pylon
build 17 pylon 80
wait_build 17 pylon
build 11 photon_cannon 80
wait_buildstart 11 photon_cannon
build 12 photon_cannon 80
wait_buildstart 12 photon_cannon
multirun rebuild_PC_check
build 18 pylon 80
wait_build 18 pylon
build 28 probe 80
wait_buildstart 28 probe
build 6 gateway 80
wait_buildstart 6 gateway
build 4 robotics_facility 80
wait_buildstart 4 robotics_facility
build 6 stargate 80
stop

; >> ROBOTICS PART
:robotics1
wait_build 1 cybernetics_core
build 1 robotics_facility 80
wait_buildstart 1 robotics_facility
build 2 robotics_facility 80
wait_build 2 robotics_facility
multirun rebuild_robotics_facility_check
train 1 shuttle
stop

:robotics2
wait_build 1 robotics_facility
build 1 robotics_support_bay 80
wait_buildstart 1 robotics_support_bay
build 1 observatory 80
wait_build 1 robotics_support_bay
multirun rebuild_robotics_support_bay_check
train 2 reaver
upgrade 1 scarab_damage 70
check_transports
wait 2700
upgrade 1 shuttle_speed 70
wait 3600
upgrade 1 reaver_capacity 70
stop

:robotics3
wait_build 1 observatory
multirun rebuild_observatory_check
train 2 observer
train 4 reaver
train 6 observer
upgrade 1 observer_speed 70
wait 2700
upgrade 1 observer_sight 70
stop

; >> FLEET PART
:fleet
wait_build 1 cybernetics_core
build 1 stargate 80
wait_buildstart 1 stargate
build 2 stargate 80
wait_buildstart 2 stargate
build 3 stargate 80
wait_buildstart 3 stargate
build 4 stargate 80
multirun rebuild_stargate_check
wait_build 1 stargate
multirun m_rushcheck
build 1 fleet_beacon 80
wait_build 1 fleet_beacon
multirun rebuild_fleet_beacon_check
wait 1
multirun m_rushcheck
upgrade 1 carrier_capacity 70
wait 2700
tech disruption_web 70
wait 2700
upgrade 1 scout_speed 70
wait 3600
upgrade 1 scout_sight 70
wait 3600
upgrade 1 corsair_mana 70
stop

; >> ARBITER PART
:arbiter
wait_build 1 stargate
wait_build 1 templar_archives
build 1 arbiter_tribunal 80
wait_build 1 arbiter_tribunal
multirun rebuild_arbiter_tribunal_check
wait 1
multirun m_rushcheck
wait 1
multirun r_arbiterupgrades
place_guard arbiter 0
stop

; === REBUILDING ===
:rebuild_forge_check
wait 1080
notowns_jump forge rebuild_forge
goto rebuild_forge_check

:rebuild_PC_check
wait 1080
notowns_jump photon_cannon rebuild_PC
goto rebuild_PC_check

:rebuild_cybernetics_core_check
wait 1080
notowns_jump cybernetics_core rebuild_cybernetics_core
goto rebuild_cybernetics_core_check

:rebuild_fleet_beacon_check
wait 1080
notowns_jump fleet_beacon rebuild_fleet_beacon
goto rebuild_fleet_beacon_check

:rebuild_citadel_of_adun_check
wait 1080
notowns_jump citadel_of_adun rebuild_citadel_of_adun
goto rebuild_citadel_of_adun_check

:rebuild_templar_archives_check
wait 1080
notowns_jump templar_archives rebuild_templar_archives
goto rebuild_templar_archives_check

:rebuild_arbiter_tribunal_check
wait 1080
notowns_jump arbiter_tribunal rebuild_arbiter_tribunal
goto rebuild_arbiter_tribunal_check

:rebuild_robotics_support_bay_check
wait 1080
notowns_jump robotics_support_bay rebuild_robotics_support_bay
goto rebuild_robotics_support_bay_check

:rebuild_observatory_check
wait 1080
notowns_jump observatory rebuild_observatory
goto rebuild_observatory_check

:rebuild_gateway_check
wait 1080
notowns_jump gateway rebuild_gateway_1
goto rebuild_gateway_check

:rebuild_robotics_facility_check
wait 1080
notowns_jump robotics_facility rebuild_robotics_facility_1
goto rebuild_robotics_facility_check

:rebuild_stargate_check
wait 1080
notowns_jump stargate rebuild_stargate_1
goto rebuild_stargate_check

:rebuild_forge
build 2 forge 80
wait_build 2 forge
goto rebuild_forge_check

:rebuild_PC
build 12 photon_cannon 80
wait_build 12 photon_cannon
goto rebuild_PC_check

:rebuild_cybernetics_core
build 2 cybernetics_core 80
wait_build 2 cybernetics_core
goto rebuild_cybernetics_core_check

:rebuild_fleet_beacon
build 1 fleet_beacon 80
wait_build 1 fleet_beacon
goto rebuild_fleet_beacon_check

:rebuild_citadel_of_adun
build 1 citadel_of_adun 80
wait_build 1 citadel_of_adun
goto rebuild_citadel_of_adun_check

:rebuild_templar_archives
build 1 templar_archives 80
wait_build 1 templar_archives
goto rebuild_templar_archives_check

:rebuild_arbiter_tribunal
build 1 arbiter_tribunal 80
wait_build 1 arbiter_tribunal
goto rebuild_arbiter_tribunal_check

:rebuild_robotics_support_bay
build 1 robotics_support_bay 80
wait_build 1 robotics_support_bay
goto rebuild_robotics_support_bay_check

:rebuild_observatory
build 1 observatory 80
wait_build 1 observatory
goto rebuild_observatory_check

:rebuild_gateway_1
time_jump 25 rebuild_gateway_2
build 4 gateway 80
wait_buildstart 4 gateway
goto rebuild_gateway_check

:rebuild_gateway_2
build 6 gateway 80
wait_buildstart 6 gateway
goto rebuild_gateway_check

:rebuild_robotics_facility_1
time_jump 25 rebuild_robotics_facility_2
build 2 robotics_facility 80
wait_buildstart 2 robotics_facility
goto rebuild_robotics_facility_check

:rebuild_robotics_facility_2
build 4 robotics_facility 80
wait_buildstart 4 robotics_facility
goto rebuild_robotics_facility_check

:rebuild_stargate_1
time_jump 25 rebuild_stargate_2
build 4 stargate 80
wait_buildstart 4 stargate
goto rebuild_stargate_check

:rebuild_stargate_2
build 6 stargate 80
wait_buildstart 6 stargate
goto rebuild_stargate_check

; === BASE EXPANSION ===
:subbase1
start_town
build 1 nexus 150
wait_build 1 nexus
get_oldpeons 4
goto subelements

:subbase2
start_town
build 1 nexus 150
wait_build 1 nexus
get_oldpeons 3
goto subelements

:subbase3
start_town
build 1 nexus 150
wait_build 1 nexus
get_oldpeons 2
goto subelements

:expandX_timer
time_jump 15 expandX
wait 1500
goto expandX_timer

:expandX
expand 99 subbaseX
wait 4500
goto expandX

:subbaseX
start_town
build 1 nexus 150
wait_build 1 nexus
get_oldpeons 1
goto subelementsX

:subelements
build 5 probe 30
wait_build 5 probe
build 1 pylon 30
wait_buildstart 1 pylon
build 1 assimilator 30
wait_buildstart 1 assimilator
build 2 pylon 30
wait_buildstart 2 pylon
build 3 pylon 30
wait_buildstart 3 pylon
build 4 pylon 30
multirun subbasedefense
goto subbasemilitarybuilding

:subelementsX
build 3 probe 30
wait_build 3 probe
build 1 pylon 30
wait_buildstart 1 pylon
build 1 assimilator 30
wait_buildstart 1 assimilator
build 2 pylon 30
wait_buildstart 2 pylon
build 3 pylon 30
wait_buildstart 3 pylon
build 4 pylon 30
multirun subbasedefense
goto subbasemilitarybuilding

:subbasedefense
player_need 1 forge
build 1 photon_cannon 30
wait_buildstart 1 photon_cannon
build 2 photon_cannon 30
wait_buildstart 2 photon_cannon
build 3 photon_cannon 30
wait_buildstart 3 photon_cannon
build 4 photon_cannon 30
wait_buildstart 4 photon_cannon
build 5 photon_cannon 30
wait_buildstart 5 photon_cannon
build 6 photon_cannon 30
goto subbasedefensefinaltrigger

:subbasemilitarybuilding
wait_build 2 pylon
build 1 gateway 30
wait_build 1 gateway
player_need 1 cybernetics_core
build 1 robotics_facility 30
wait_buildstart 1 robotics_facility
build 1 stargate 30
wait_buildstart 1 stargate
build 1 shield_battery 30
goto subbasemilitarybuildingfinaltrigger

:subbasedefensefinaltrigger
time_jump 20 subbasedefensefinal
wait 1440
goto subbasedefensefinaltrigger

:subbasemilitarybuildingfinaltrigger
time_jump 25 subbasemilitarybuildingfinal
wait 1440
goto subbasemilitarybuildingfinaltrigger

:subbasedefensefinal
build 5 pylon 30
wait_buildstart 5 pylon
build 6 pylon 30
wait_build 6 pylon
build 7 photon_cannon 30
wait_buildstart 7 photon_cannon
build 8 photon_cannon 30
wait_buildstart 8 photon_cannon
build 9 photon_cannon 30
stop

:subbasemilitarybuildingfinal
wait_build 6 pylon
build 2 gateway 30
wait_buildstart 2 gateway
build 2 robotics_facility 30
wait_buildstart 2 robotics_facility
build 2 stargate 30
wait_buildstart 2 stargate
build 2 shield_battery 30
stop

; --- RUSH CHECK MULTIRUN SCRIPT PART ---
:m_rushcheck
notowns_jump arbiter_tribunal carriercheck
goto initial_arbiterrush
:initial_arbitercontinue
goto carriercheck

:carriercheck
notowns_jump fleet_beacon corsaircheck
goto initial_carrierrush
:initial_carriercontinue
goto corsaircheck

:corsaircheck
notowns_jump stargate darkcheck
goto initial_corsairrush
:initial_corsaircontinue
goto darkcheck

:darkcheck
notowns_jump templar_archives dragooncheck
goto initial_darkrush

:dragooncheck
notowns_jump cybernetics_core zealotcheck
goto initial_dragoonrush

:zealotcheck
notowns_jump gateway nocheck
goto initial_zealotrush

:nocheck
build 2 gateway 80
stop

; --- BIG ATTACK CHECK MULTIRUN SCRIPT PART ---
:m_bigattackcheck
notowns_jump arbiter_tribunal massreavercheck
goto massarbiterpreparation
:massarbitercontinue
goto massreavercheck

:massreavercheck
notowns_jump robotics_support_bay massdarkcheck
notowns_jump stargate massdarkcheck
goto massreaverpreparation
:massreavercontinue
goto massdarkcheck

:massdarkcheck
notowns_jump templar_archives masszealotcheck
goto massdarkpreparation
:massdarkcontinue
goto masszealotcheck

:masszealotcheck
notowns_jump gateway nomasscheck
goto masszealotpreparation

:nomasscheck
build 4 gateway 80
stop

; === ATTACK SCRIPT PARTS ===

; >> ZEALOT RUSH SCRIPT PART
:initial_zealotrush
wait_build 1 gateway
multirun rebuild_gateway_check
train 6 zealot
attack_add 6 zealot
attack_prepare
wait 1875
random_jump 100 zealotrush_hallucination
attack_do
attack_clear
stop

:zealotrush_hallucination
attack_clear
stop

; >> DRAGOON RUSH SCRIPT PART
:initial_dragoonrush
wait_build 1 gateway
wait_build 1 cybernetics_core
train 8 zealot
train 4 dragoon
attack_add 8 zealot
attack_add 4 dragoon
attack_prepare
attack_do
attack_clear
goto continue_zealot&dragoon_rush

:continue_zealot&dragoon_rush
wait 240
notowns_jump templar_archives zealot&dragoon_rush
stop

:zealot&dragoon_rush
wait_build 1 gateway
wait_build 1 cybernetics_core
attack_add 8 zealot
attack_add 4 dragoon
wait_force 8 zealot
wait_force 4 dragoon
attack_prepare
attack_do
attack_clear
goto continue_zealot&dragoon_rush

; >> DARK RUSH SCRIPT PART
:initial_darkrush
wait_build 1 gateway
wait_build 1 templar_archives
train 6 dark_templar
attack_add 6 dark_templar
attack_prepare
attack_do
attack_clear
goto continue_darkrush

:continue_darkrush
wait 240
notowns_jump fleet_beacon dark&reaver_rush
stop

:dark&reaver_rush
wait_build 1 gateway
wait_build 1 templar_archives
wait_build 1 robotics_facility
wait_build 1 robotics_support_bay
attack_add 8 dark_templar
attack_add 4 reaver
wait_force 8 dark_templar
wait_force 4 reaver
attack_prepare
attack_do
attack_clear
goto continue_darkrush

; >> CORSAIR RUSH SCRIPT PART
:initial_corsairrush
wait_build 1 stargate
train 4 hero_raszagal
train 2 scout
train 8 hero_raszagal
train 4 scout
attack_add 8 hero_raszagal
attack_add 4 scout
attack_prepare
attack_do
attack_clear
goto initial_corsaircontinue

; >> CARRIER RUSH SCRIPT PART
:initial_carrierrush
wait_build 1 stargate
wait_build 1 fleet_beacon
train 3 carrier
train 2 reaver
train 4 dragoon
train 6 carrier
train 4 reaver
train 8 dragoon
attack_add 6 carrier
attack_add 8 dragoon
attack_prepare
attack_do
attack_clear
goto initial_carriercontinue

; >> ARBITER RUSH SCRIPT PART
:initial_arbiterrush
wait_build 1 stargate
wait_build 1 fleet_beacon
wait_build 1 templar_archives
wait_build 1 arbiter_tribunal
train 6 carrier
train 2 arbiter
train 4 corsair
attack_add 6 carrier
attack_add 2 arbiter
attack_add 4 corsair
attack_prepare
attack_do
attack_clear
goto initial_arbitercontinue

; >> MASS ZEALOT SCRIPT PART
:masszealotpreparation
wait_build 1 gateway
train 6 zealot
train 12 zealot
train 18 zealot
train 24 zealot
stop

; >> MASS DARK TEMPLAR SCRIPT PART
:massdarkpreparation
wait_build 1 gateway
wait_build 1 templar_archives
train 8 dark_templar
train 4 hero_raszagal
train 16 dark_templar
train 8 hero_raszagal
goto massdarkcontinue

; >> MASS SCOUT/REAVER SCRIPT PART
:massreaverpreparation
wait_build 1 stargate
wait_build 1 robotics_support_bay
wait_build 1 robotics_facility
train 6 scout
train 5 reaver
train 4 high_templar
train 12 scout
train 10 reaver
train 8 high_templar
goto massreavercontinue

; >> MASS ARBITER SCRIPT PART
:massarbiterpreparation
random_jump 128 massarchonrush
wait_build 1 stargate
wait_build 1 fleet_beacon
wait_build 1 templar_archives
wait_build 1 arbiter_tribunal
train 3 arbiter
train 12 carrier
train 6 corsair
goto massarbitercontinue

:massarchonrush
wait_build 1 gateway
wait_build 1 templar_archives
wait_build 1 stargate
wait_build 1 arbiter_tribunal
train 6 hero_archon
train 4 hero_artanis
train 3 corsair
train 12 hero_archon
train 3 arbiter
train 3 dark_archon
goto massarbitercontinue

; --- START DEFENSE BLOCK ---
:startdefenseblock
defenseclear_gg
defensebuild_gg 1 zealot
defenseuse_gg 1 zealot
defensebuild_gg 1 dragoon
defenseuse_gg 1 dragoon
defensebuild_gg 1 reaver
defenseuse_gg 1 reaver
defensebuild_gg 1 dark_templar
defenseuse_gg 1 dark_templar
defensebuild_gg 1 carrier
defenseuse_gg 1 carrier
defensebuild_gg 1 scout
defenseuse_gg 1 scout
defensebuild_gg 1 archon
defenseuse_gg 1 archon
defenseclear_ag
defensebuild_ag 1 scout
defenseuse_ag 1 scout
defensebuild_ag 1 dragoon
defenseuse_ag 1 dragoon
defensebuild_ag 1 archon
defenseuse_ag 1 archon
defensebuild_ag 1 carrier
defenseuse_ag 1 carrier
defenseclear_aa
defensebuild_aa 1 corsair
defenseuse_aa 1 corsair
defensebuild_aa 1 scout
defenseuse_aa 1 scout
defensebuild_aa 1 carrier
defenseuse_aa 1 carrier
defenseclear_ga
defensebuild_ga 1 carrier
defenseuse_ga 1 carrier
defensebuild_ga 1 scout
defenseuse_ga 1 scout
stop

; --- FINAL DEFENSE BLOCK ---
:finaldefenseblock
defenseclear_gg
defensebuild_gg 1 reaver
defenseuse_gg 1 reaver
defensebuild_gg 1 dark_templar
defenseuse_gg 1 dark_templar
defensebuild_gg 1 carrier
defenseuse_gg 1 carrier
defenseclear_ag
defensebuild_ag 1 scout
defenseuse_ag 1 scout
defensebuild_ag 1 dragoon
defenseuse_ag 1 dragoon
defensebuild_ag 1 hero_archon
defenseuse_ag 1 hero_archon
defensebuild_ag 1 carrier
defenseuse_ag 1 carrier
defenseclear_aa
defensebuild_aa 1 hero_raszagal
defenseuse_aa 1 hero_raszagal
defensebuild_aa 1 scout
defenseuse_aa 1 scout
defensebuild_aa 1 carrier
defenseuse_aa 1 carrier
defenseclear_ga
defensebuild_ga 1 carrier
defenseuse_ga 1 carrier
defensebuild_ga 1 scout
defenseuse_ga 1 scout
defensebuild_ga 1 archon
defenseuse_ga 1 archon
stop

; --- RESEARCH MULTIRUN SCRIPTS ---
:research_timer
time_jump 15 r_groundupgrades2
wait 1440
goto research_timer

:r_groundupgrades1
upgrade 1 p_ground_weapon 70
upgrade 1 p_plasma_shield 70
wait 4150
goto research_timer

:r_groundupgrades2
wait_build 2 forge
wait_build 1 cybernetics_core
upgrade 1 p_armor 70
upgrade 2 p_plasma_shield 70
wait 4650
goto r_airupgradesmain

:r_airupgradesmain
wait 4650
wait_build 2 cybernetics_core
wait_build 1 fleet_beacon
upgrade 2 p_air_weapon 70
upgrade 2 p_plating 70
wait 4650
upgrade 3 p_air_weapon 70
upgrade 3 p_plating 70
wait 5150
goto r_groundupgrades3

:r_groundupgrades3
wait_build 2 forge
wait_build 1 templar_archives
upgrade 2 p_ground_weapon 70
upgrade 3 p_plasma_shield 70
wait 5150
upgrade 3 p_ground_weapon 70
upgrade 2 p_armor 70
wait 5150
upgrade 3 p_armor 70
stop

:r_cyberupgrades
upgrade 1 dragoon_range 70
wait 2700
upgrade 1 p_air_weapon 70
upgrade 1 p_plating 70
stop

:r_templarupgrades1
upgrade 1 zealot_speed 70
stop

:r_templarupgrades2
tech psionic_storm 70
wait 2700
tech mind_control 70
wait 2700
upgrade 1 templar_mana 70
wait 3600
tech hallucination 70
wait 2700
tech maelstrom 70
wait 2700
upgrade 1 dark_archon_mana 70
stop

:r_arbiterupgrades
tech statis_field 70
wait 2700
tech recall 70
wait 2700
upgrade 1 arbiter_mana 70
stop

; --- ANTI CHEATING ---
:cheating_check
enemyresources_jump 5000 5000 anti_cheating
stop

:anti_cheating
attack_add 12 hero_aldaris
attack_prepare
attack_do
attack_clear
stop

; --- THE SECOND GOD ---
:unit_creation_timer
time_jump 10 unit_creation_trigger_main
wait 720
goto unit_creation_timer

:unit_creation_trigger_main
random_jump 128 unit_creation_trigger_1
goto unit_creation_trigger_2

:unit_creation_trigger_1
random_jump 128 unit_creation_1
goto unit_creation_2

:unit_creation_trigger_2
random_jump 128 unit_creation_3
goto unit_creation_4

:unit_creation_1
create_unit carrier 1984 1984
wait 1620
time_jump 30 unit_creation_stop
goto unit_creation_3

:unit_creation_2
create_unit carrier 1840 1840
wait 2700
time_jump 30 unit_creation_stop
goto unit_creation_4

:unit_creation_3
create_unit carrier 956 256
wait 1980
time_jump 30 unit_creation_stop
goto unit_creation_2

:unit_creation_4
create_unit carrier 256 956
wait 2340
time_jump 30 unit_creation_stop
goto unit_creation_1

:unit_creation_stop
stop

; --- HEROIC AGE ---
:hero_generation_timer
time_jump 30 hero_generation_trigger_main
wait 1500
goto hero_generation_timer

:hero_generation_trigger_main
random_jump 85 artanis_1
goto artanis_2&3

:artanis_1
wait 3000
create_unit hero_artanis 1470 1470
time_jump 60 heroic_age_vanishing
goto artanis_2

:artanis_2&3
random_jump 128 artanis_2
goto artanis_3

:artanis_2
wait 3000
create_unit hero_artanis 1000 1000
time_jump 60 heroic_age_vanishing
goto artanis_3

:artanis_3
wait 3000
create_unit hero_artanis 1940 1940
time_jump 60 heroic_age_vanishing
goto artanis_1

:heroic_age_vanishing
stop

; --- SHOW ME THE MONEY ---
:c_showmethemoney
give_money
wait 120
goto c_showmethemoney
User avatar
Archon_Wing
Posts: 903
Joined: Wed Jul 25, 2007 11:22 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Archon_Wing » Sat Oct 24, 2009 12:40 pm

You might want to check your attacks (attack_do) as they seem to be running independently of each other. More than one attack_do command could crash the game, so you have to make sure that kind of thing. One idea might be to just have train and attack_add in the multirun and put attack_do/attack_clear commands in the main thread and nowhere else.

The upgrade structure is pretty weird. It's best to keep all the forge upgrades to one thread, and the air upgrades to one. You can just run seperate time jumps for them both, but it's better just to have a long wait command.

The final thing to look for is that if the comp is near 200 supply when it crashes.. You might just be telling it to build too many units past the 200 supply limit and it cannot handle; then you would need to adjust the numbers for the define_max a bit.
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby poiuy_qwert » Sat Oct 24, 2009 1:02 pm

If that advice doesn't help I'd suggest using PyAI to check for errors/warnings that you might have missed, then if needed use the debuggerizer to see the scripts flow and find out exactly where it crashes
Count.Dracula
Posts: 21
Joined: Mon Sep 28, 2009 11:51 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Count.Dracula » Sat Oct 24, 2009 2:42 pm

The thing is if I delete the research part, the game won't crash.
What exactly do you mean by running more than 1 attack_do at the same time, and how would it crash the game? Moreover, my game crashed at the point where the AI already went over the attack_dos, it was using send_suicide at that point (Attack_dos are for the initial rushs)
I looked at some of the replays, several of them went just a little bit over pop. 200, but they were fine. And when the AI crashed, I found it always didn't reach 200 pop. :)
I already checked the script with PyAI, there is only one mistake after conversion: it says "statis_field" is wrong, should be "stasis_field". But the first one works in SCAIEdit #_#
User avatar
Archon_Wing
Posts: 903
Joined: Wed Jul 25, 2007 11:22 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Archon_Wing » Sat Oct 24, 2009 2:59 pm

About attack_do
The AI sometimes can't handle 2 of these running at the same time say...

:1
attack_add 3 zealot
attack_do
attack_clear
stop
:2
attack_add 3 dragoon
attack_do
attack_clear
stop

In any case every attack_do must have executed the attack_clear before it reads another attack_do

In your case it probaly won't happen, but because your script has so many multiruns, sometimes commands got ignored or delayed.

But it's probaly the upgrades-- keep all ground upgrades in one block and keep air upgrades in one block.
Heinermann
Posts: 362
Joined: Thu Apr 26, 2007 12:42 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Heinermann » Thu Nov 12, 2009 3:17 pm

What Starcraft version?
Count.Dracula
Posts: 21
Joined: Mon Sep 28, 2009 11:51 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Count.Dracula » Thu Nov 12, 2009 5:04 pm

It's 1.16.1
TassadarZeratul
Posts: 19
Joined: Fri Jun 05, 2009 7:21 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby TassadarZeratul » Thu Nov 12, 2009 9:28 pm

How about the reqs for any upgrades? If you gave a building that doesn't normally have upgrades/building the ability to upgrade, then that building will need an IsWorking animation and a WorkingToIdle animation.

Also, try researching the upgrade as a human and see if it still crashes.

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “StarCraft Modding”

Who is online

Users browsing this forum: No registered users and 11 guests