Username
Password
//--------------------------------------------------------------------------------------------------//AIAirThreat(int player) by turdburgler (REACTIVE)//will return true if the AI knows of a significant air threat//--------------------------------------------------------------------------------------------------int AIAirThreat(int player){ int a = 0; int totalAirUnits = 0; //loop players and check if they has mad air while(a != 4) { if(a != player) { totalAirUnits = totalAirUnits + AIKnownUnitCount(player, a, c_TU_Battlecruiser) * 3; totalAirUnits = totalAirUnits + AIKnownUnitCount(player, a, c_TU_Raven); totalAirUnits = totalAirUnits + AIKnownUnitCount(player, a, c_TU_Banshee); totalAirUnits = totalAirUnits + AIKnownUnitCount(player, a, c_PU_VoidRay) * 2; totalAirUnits = totalAirUnits + AIKnownUnitCount(player, a, c_PU_Carrier) * 4; totalAirUnits = totalAirUnits + AIKnownUnitCount(player, a, c_ZU_Mutalisk); } a = a + 1; } return totalAirUnits;}
Does Grab include structures currently under construction? How about AIKnownUnitCount?
Cool.I'm currently needing a function that returns the free available food supply with two conditions:Now -- the number of free resource from hatch/lair/Hive + ovies already completed.Soon -- Now + number of ovies in queue or already in production.I'm using this to test a script that will only spawn lings when necessary, and depending on the number of what target it needs to counter and the counter value for ling vs that specific target in question.Also, one question, will two while blocks run simultaneously?Say,while(A) { do(x)...}while(!B) { do(y)...}Will do(x) and do(y) run simultaneously?
Cool.I'm currently needing a function that returns the free available food supply with two conditions:
int used = PlayerGetPropertyInt(player, c_playerPropSuppliesUsed); int created = PlayerGetPropertyInt(player, c_playerPropSuppliesMade); //current supply // queued supply count: if (PlayerRace(player) == "Zerg") { created = TechTreeUnitCount(player, c_ZU_Overlord, c_techCountQueuedOrBetter) * 8 + TechTreeUnitCount(player, c_ZU_Overseer, c_techCountQueuedOrBetter) * 8; created += TechTreeUnitCount(player, c_ZB_Hatchery, c_techCountQueuedOrBetter) * 2 + TechTreeUnitCount(player, c_ZB_Lair, c_techCountQueuedOrBetter) * 2 + TechTreeUnitCount(player, c_ZB_Hive, c_techCountQueuedOrBetter) * 2; } else if (PlayerRace(player) == "Prot") { created = TechTreeUnitCount(player, c_PB_Pylon, c_techCountQueuedOrBetter) * 8 + TechTreeUnitCount(player, c_PB_Nexus, c_techCountQueuedOrBetter) * 10; } else if (PlayerRace(player) == "Terr") { created = TechTreeUnitCount(player, c_TB_SupplyDepot, c_techCountQueuedOrBetter) * 8 + TechTreeUnitCount(player, c_TB_CommandCenter, c_techCountQueuedOrBetter) * 11; created += TechTreeUnitCount(player, c_TB_OrbitalCommand, c_techCountQueuedOrBetter) * 11 + TechTreeUnitCount(player, c_TB_PlanetaryFortress, c_techCountQueuedOrBetter) * 11; created += TechTreeUnitCount(player, "SupplyDepotLowered", c_techCountQueuedOrBetter) * 8; // Alias doesn't seem to work right here... }
Also, one question, will two while blocks run simultaneously?Say,while(A) { do(x)...}while(!B) { do(y)...}Will do(x) and do(y) run simultaneously?
//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 ); }
It does. My above post is really not refined nor exactly useful (sort of inductive). They're vague concepts still, as I'm yet trying to get a handle on the whats that gets swapped around within the first 5mins of the game.Anyway, I'll post what I find.