Do you guys know how to make multiple waves? Like, two main attack waves, one for main attack and the other for back door drops?
Or is this even possible?
How do we control attack waves?
Or is this even possible?
How do we control attack waves?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote
if (RCountUnit(c_ZU_Drone, 9, 10, 0, 1, 0, 1, player) == true) {
ZEnsureFood(18, 9, c_townOne, player);
ZEnsureWorker(13, 10, c_townOne, player);
ZEnsureTech(1, c_ZB_SpawningPool, 10, c_townOne, c_nearCloseDropoff, player);
}
Quote
if (RCountUnit(c_ZU_Drone, 9, 10, 0, 1, 0, 1, player) == true) {
ZEnsureFood(18, 9, c_townOne, player);
ZEnsureTech(1, c_ZB_SpawningPool, 10, c_townOne, c_nearCloseDropoff, player);
if (RCountUnit(c_ZB_SpawningPool, 0, 1, 1, 1, 0, 0, player) == true) {
ZEnsureWorker(13, 3, c_townOne, player);
}
}
Quote
order SpawnLarva (int player, unit aiUnit) {
order ord;
unitgroup hatcheries;
unitgroup larvas;
int larvaCount;
// Only cast if idle.
//
if (UnitOrder(aiUnit, 0) != null) {
return null;
}
ord = AICreateOrder(player, c_AB_SpawnMutantLarva, 0);
if (!UnitOrderIsValid(aiUnit, ord)) {
return null;
}
larvas = AIFindUnits(player,
c_ZU_Larva,
UnitGetPosition(aiUnit),
15,
c_noMaxCount)
;
// Don't cast if we already own at least 10 larva
//
larvaCount = UnitGroupCount(larvas, c_unitCountAll);
//TechTreeBehaviorCount(player, c_BF_MutantLarvaTimer, c_techCountQueuedOrBetter) * 4
//+ TechTreeUnitCount(player, c_ZU_Larva, c_techCountQueuedOrBetter)
//;
if (larvaCount >= 10) {
return null;
}
hatcheries = AIFindUnits(player,
c_ZB_Hatchery_Alias,
UnitGetPosition(aiUnit),
15,
c_noMaxCount)
;
return AIUnitGroupGetValidOrder(hatcheries, ord, aiUnit, c_backwards);
}
Quote
if (type == c_ZU_Queen) {
//AIWaveAddUnitPriority(AIWaveGet(player, c_waveHome), u, c_prioWavePeon);c_prioWaveIdle doesn't work
return;
}
Quote
bool CountUnit(string UCheck, int Complete, int Progressing, int Queued, int Tplayer);
bool RCountUnit(string UCheck, int MinComplete, int MaxComplete, int MinProgressing, int MaxProgressing, int MinQueued, int MaxQueued, int Tplayer);
void FCountUnit(string UCheck, int MinComplete, int MaxComplete, int MinProgressing, int MaxProgressing, int MinQueued, int MaxQueued, bool CFeedback, bool PFeedback, bool QFeedback, int Tplayer);
int TotalUnit(string UCheck, int Tplayer);
void ZEnsureFood(int FoodLvL, int TPriority, int TownWhere, int Tplayer);
void ZEnsureWorker(int UCount, int TPriority, int TownWhere, int Tplayer); //, string PreConUnit, int PreConCount);
void ZEnsureTech(int UCount, string UTech, int TPriority, int TownWhere, int BFlag, int Tplayer);
void ZEnsureUnit(int UCount, string UTech, int TPriority, int TownWhere, int Tplayer);
string WeAreThrough(int Tplayer, string ThroughState);
string WeAreAt(int Tplayer);
Quote
//--------------------------------------------------------------------------------------------------
// Checks and returns true if it is so. Within range this time.
//--------------------------------------------------------------------------------------------------
bool RCountUnit(string UCheck, int MinComplete, int MaxComplete, int MinProgressing, int MaxProgressing, int MinQueued, int MaxQueued, int Tplayer)
{
if( (AITechCount(Tplayer, UCheck, c_techCountCompleteOnly) >= MinComplete) &&
(AITechCount(Tplayer, UCheck, c_techCountCompleteOnly) <= MaxComplete) &&
(AITechCount(Tplayer, UCheck, c_techCountInProgressOnly) >= MinProgressing) &&
(AITechCount(Tplayer, UCheck, c_techCountInProgressOnly) <= MaxProgressing) &&
(AITechCount(Tplayer, UCheck, c_techCountQueuedOnly) >= MinQueued) &&
(AITechCount(Tplayer, UCheck, c_techCountQueuedOnly) <= MaxQueued) ){
return true;
}
else { return false; }
}
//--------------------------------------------------------------------------------------------------
// Checks and returns true if it is so. Range Specific bool setting.
//--------------------------------------------------------------------------------------------------
void FCountUnit(string UCheck, int MinComplete, int MaxComplete, int MinProgressing, int MaxProgressing, int MinQueued, int MaxQueued, bool CFeedback, bool PFeedback, bool QFeedback, int Tplayer)
{
if( (AITechCount(Tplayer, UCheck, c_techCountCompleteOnly) >= MinComplete) &&
(AITechCount(Tplayer, UCheck, c_techCountCompleteOnly) <= MaxComplete) ){
CFeedback = true;
}
else { CFeedback = false; }
if( (AITechCount(Tplayer, UCheck, c_techCountInProgressOnly) >= MinProgressing) &&
(AITechCount(Tplayer, UCheck, c_techCountInProgressOnly) <= MaxProgressing) ){
PFeedback = true;
}
else { PFeedback = false; }
if( (AITechCount(Tplayer, UCheck, c_techCountQueuedOnly) >= MinQueued) &&
(AITechCount(Tplayer, UCheck, c_techCountQueuedOnly) <= MaxQueued) ){
QFeedback = true;
}
else { QFeedback = false; }
}
//--------------------------------------------------------------------------------------------------
// Counts the specified unit all including in progress and queued
//--------------------------------------------------------------------------------------------------
int TotalUnit(string UCheck, int Tplayer){
int a = 0;
a = (AITechCount(Tplayer, UCheck, c_techCountInProgressOnly) +
AITechCount(Tplayer, UCheck, c_techCountQueuedOnly) +
AITechCount(Tplayer, UCheck, c_techCountCompleteOnly));
return a;
}
//--------------------------------------------------------------------------------------------------
// Checks the total number of food if low, add one Ovie
//--------------------------------------------------------------------------------------------------
void ZEnsureFood(int FoodLvL, int TPriority, int TownWhere, int Tplayer){
int TotalFood = 0;
TotalFood = (( AITechCount(Tplayer, c_ZU_Overlord, c_techCountInProgressOnly) +
AITechCount(Tplayer, c_ZU_Overlord, c_techCountQueuedOnly) +
AITechCount(Tplayer, c_ZU_Overlord, c_techCountCompleteOnly) ) * 8 );
// adds hatchery count
TotalFood = TotalFood + (( AITechCount(Tplayer, c_ZB_Hatchery, c_techCountInProgressOnly) +
AITechCount(Tplayer, c_ZB_Hatchery, c_techCountQueuedOnly) +
AITechCount(Tplayer, c_ZB_Hatchery, c_techCountCompleteOnly) ) * 2);
// add lair count
TotalFood = TotalFood + (( AITechCount(Tplayer, c_ZB_Lair, c_techCountInProgressOnly) +
AITechCount(Tplayer, c_ZB_Lair, c_techCountQueuedOnly) +
AITechCount(Tplayer, c_ZB_Lair, c_techCountCompleteOnly) ) * 2);
// add hive count
TotalFood = TotalFood + (( AITechCount(Tplayer, c_ZB_Hive, c_techCountInProgressOnly) +
AITechCount(Tplayer, c_ZB_Hive, c_techCountQueuedOnly) +
AITechCount(Tplayer, c_ZB_Hive, c_techCountCompleteOnly) ) * 2);
// add overseers
TotalFood = TotalFood + (( AITechCount(Tplayer, c_ZU_Overseer, c_techCountInProgressOnly) +
AITechCount(Tplayer, c_ZU_Overseer, c_techCountQueuedOnly) +
AITechCount(Tplayer, c_ZU_Overseer, c_techCountCompleteOnly) ) * 8 );
if ( TotalFood < FoodLvL ){
AITrain (Tplayer, TPriority, TownWhere, c_ZU_Overlord, 1);
}
}
//--------------------------------------------------------------------------------------------------
// Checks the total number of worker and trains one if less
//--------------------------------------------------------------------------------------------------
void ZEnsureWorker(int UCount, int TPriority, int TownWhere, int Tplayer){ //, string PreConUnit, int PreConCount){
int TotalWorker = 0;
TotalWorker = ( AITechCount(Tplayer, c_ZU_Drone, c_techCountInProgressOnly) +
AITechCount(Tplayer, c_ZU_Drone, c_techCountQueuedOnly) +
AITechCount(Tplayer, c_ZU_Drone, c_techCountCompleteOnly) );
// blocked, since even if AI queues pool first, it morphs drones. It must be: cheaper goes first
// if (PreConUnit != "None") {
// if ( ( TotalWorker < UCount ) && (TotalUnit(PreConUnit, Tplayer)==PreConCount) ){
// AITrain (Tplayer, TPriority, TownWhere, c_ZU_Drone, 1);
// }
// }
// else {
if ( TotalWorker < UCount ) {
AITrain (Tplayer, TPriority, TownWhere, c_ZU_Drone, 1);
}
// }
}
//--------------------------------------------------------------------------------------------------
// Checks the total number of a certain tech and build 1 of it if low
//--------------------------------------------------------------------------------------------------
void ZEnsureTech(int UCount, string UTech, int TPriority, int TownWhere, int BFlag, int Tplayer){
int TotalTech = 0;
TotalTech = ( AITechCount(Tplayer, UTech, c_techCountInProgressOnly) +
AITechCount(Tplayer, UTech, c_techCountQueuedOnly) +
AITechCount(Tplayer, UTech, c_techCountCompleteOnly) );
if ( TotalTech < UCount ){
AIBuild (Tplayer, TPriority, TownWhere, UTech, 1, BFlag);
}
}
void ZEnsureUnit(int UCount, string UTech, int TPriority, int TownWhere, int Tplayer){
int TotalTech = 0;
TotalTech = ( AITechCount(Tplayer, UTech, c_techCountInProgressOnly) +
AITechCount(Tplayer, UTech, c_techCountQueuedOnly) +
AITechCount(Tplayer, UTech, c_techCountCompleteOnly) );
if ( TotalTech < UCount ){
AITrain (Tplayer, TPriority, TownWhere, UTech, UCount);
}
}
//---returns strings that describe states
string WeAreThrough(int Tplayer, string ThroughState){
if( ThroughState == "GameStart") {
if( (TotalUnit(c_ZB_Hatchery, Tplayer) == 1) &&
((TotalUnit(c_ZU_Overlord, Tplayer) >= 1) && (TotalUnit(c_ZU_Overlord, Tplayer) <= 2)) &&
((TotalUnit(c_ZU_Drone, Tplayer) >= 10) && (TotalUnit(c_ZU_Drone, Tplayer) <= 13)) &&
(TotalUnit(c_ZB_SpawningPool, Tplayer) < 1) ) {
return "DoneGameStart";
}
else {
return "NotDoneGameStart";
}
}
else if( ThroughState == "Block1") {
if( (TotalUnit(c_ZB_Hatchery, Tplayer) == 1) &&
((TotalUnit(c_ZU_Overlord, Tplayer) >= 2) && (TotalUnit(c_ZU_Overlord, Tplayer) <= 3)) &&
((TotalUnit(c_ZU_Drone, Tplayer) >= 13) && (TotalUnit(c_ZU_Drone, Tplayer) <= 16)) &&
(TotalUnit(c_ZB_SpawningPool, Tplayer) == 1) ) {
return "DoneBlock1";
}
else {
return "NotDoneBlock1";
}
}
else {
return "Error";
}
}
//---returns strings that describe states
string WeAreAt(int Tplayer){
if( (TotalUnit(c_ZB_Hatchery, Tplayer) == 1) &&
(TotalUnit(c_ZU_Overlord, Tplayer) <= 1) &&
(TotalUnit(c_ZU_Drone, Tplayer) <= 10) &&
(TotalUnit(c_ZB_SpawningPool, Tplayer) < 1) ) {
return "GameStart";
}
if( (TotalUnit(c_ZB_Hatchery, Tplayer) == 1) &&
(TotalUnit(c_ZU_Overlord, Tplayer) == 2) &&
(TotalUnit(c_ZU_Drone, Tplayer) == 13) &&
(TotalUnit(c_ZB_SpawningPool, Tplayer) == 1) ) {
return "Block1";
}
else {
return "NoWhere";
}
}
Quote
AISetDifficulty(player, c_diffNormalVision, false);
AIClearStock(player);
//this makes AI automate resourcing like gas structs
AIDefaultEconomy(player, c_ZB_Hatchery_Alias, null, c_ZU_Overlord_Alias, c_ZU_Drone, 45, c_stockIdle);
//debug WeAreAt-------------------------------------------------
UIDisplayMessage(PlayerGroupAll(), 1, StringToText(WeAreAt(player)));
//queue debug:--------------------------------------------------
IQU = AITechCount(player, c_ZU_Drone, c_techCountQueuedOnly);
SQU = IntToString(IQU);
UIDisplayMessage(PlayerGroupAll(), 3, StringToText(SQU + " Drones"));
IQU = AITechCount(player, c_ZB_SpawningPool, c_techCountQueuedOnly);
SQU = IntToString(IQU);
UIDisplayMessage(PlayerGroupAll(), 3, StringToText(SQU + " Pool"));
//--------------------------------------------------------------
if ( (WeAreAt(player) == "GameStart") &&
(WeAreThrough(player, "GameStart") == "NotDoneGameStart") ){
//note: this thing works by queueing things. Train that is.
//ZEnsureWorker(10, 10, c_townOne, player);
AISetStock( player, 10, c_ZU_Drone );
}
if( WeAreThrough(player, "GameStart") == "DoneGameStart" ) {
//choose next block here
}
// >>> BLOCK 1: [OVIE.2, +3 DRONES, +POOL] process start ______________________________
// drones: complete 9-10, inprogress 0-1, queued 0-1
if (RCountUnit(c_ZU_Drone, 9, 10, 0, 1, 0, 1, player) == true) {
ZEnsureFood(18, 9, c_townOne, player);
ZEnsureTech(1, c_ZB_SpawningPool, 10, c_townOne, c_nearCloseDropoff, player);
ZEnsureWorker(13, 10, c_townOne, player);
}
// >>> OVIE.2, +3 DRONES, +POOL process end __________________________________________
// we have 0 pool built, 1 inprogress, 0 queued
//note: setstock doesn't come up in queue
if (RCountUnit(c_ZB_SpawningPool, 0, 0, 1, 1, 0, 0, player) == true) {
//ZEnsureWorker(13, 3, c_townOne, player);
AISetStock( player, 16, c_ZU_Drone );
ZEnsureTech(1, c_ZB_Extractor, 10, c_townOne, c_onVespeneGas, player);
//AISetStock( player, 1, c_ZB_Extractor );
}
if (RCountUnit(c_ZU_Drone, 15, 16, 0, 1, 0, 1, player) == true) {
//AISetStock( player, 16, c_ZU_Drone );
ZEnsureUnit(1, c_ZU_Queen, 10, c_townOne, player);
ZEnsureFood(26, 1, c_townOne, player);
}
// >>> BLOCK (undefined): [OVIE.2, +POOL, +3 DRONES] process start ______________________________
// drones: complete 9-10, inprogress 0-1, queued 0-1
// if (RCountUnit(c_ZU_Drone, 9, 10, 0, 1, 0, 1, player) == true) {
// ZEnsureFood(18, 9, c_townOne, player);
// ZEnsureTech(1, c_ZB_SpawningPool, 10, c_townOne, c_nearCloseDropoff, player);
// }
// if (RCountUnit(c_ZB_SpawningPool, 0, 1, 1, 1, 0, 0, player) == true) {
// ZEnsureWorker(13, 3, c_townOne, player);
// }
// >>> OVIE.2, +POOL, +3 DRONES process end __________________________________________
if (AIEnableVeryEasyStockOpen(player, c_ZU_Drone)) {
return;
}
Quote
//begin: Bane Defense
AISetStock( player, 1, c_ZB_Hatchery_Alias );
AISetStock( player, 10, c_ZU_Drone );
AISetStock( player, 2, c_ZU_Overlord );
AISetStock( player, 1, c_ZB_SpawningPool );
if ( AITechCount(player, c_ZB_SpawningPool, c_techCountQueuedOrBetter ) == 1 ) { //we've started pool
AISetStock( player, 12, c_ZU_Drone );
AISetStock( player, 1, c_ZB_Extractor );
AISetStock( player, 15, c_ZU_Drone );
}
if ( (AITechCount(player, c_ZU_Drone, c_techCountInProgressOrBetter ) >= 13) &&
(AITechCount(player, c_ZU_Drone, c_techCountInProgressOrBetter ) <= 16) &&
(AIHasRes (player, 150, 0) == true) )
{
AISetStock( player, 1, c_ZU_Queen );
AISetStock( player, 3, c_ZU_Overlord );
AISetStock( player, 12, c_ZU_Zergling );
AISetStock( player, 1, c_ZB_BanelingNest );
AISetStock( player, 16, c_ZU_Drone );
}
if ( (AITechCount(player, c_ZU_Zergling, c_techCountInProgressOrBetter ) >= 4) &&
(AITechCount(player, c_ZU_Zergling, c_techCountInProgressOrBetter ) <= 12) &&
(AIHasRes (player, 250, 0) == true) )
{
AIDefaultExpansion(player, c_ZB_Hatchery_Alias, 12000, 6000, c_expandDefault);
}
if ( (AITechCount(player, c_ZB_BanelingNest, c_techCountCompleteOnly ) == 1) ) {
AISetStock( player, 6, c_ZU_Zergling );
AISetStock( player, 8, c_ZU_Baneling );
}
if ( (AITechCount(player, c_ZB_Hatchery, c_techCountInProgressOrBetter ) == 2) &&
(AITechCount(player, c_ZU_Drone, c_techCountCompleteOnly ) <= 18) &&
(AIGetTime() < 300) )
{
AISetStock( player, 8, c_ZU_Zergling );
AISetStock( player, 8, c_ZU_Baneling );
AISetStock( player, 10, c_ZU_Zergling );
}