AISetStock vs AISetStockUnitNext

Started by Javadocs, March 27, 2010, 02:45:06 PM

Previous topic - Next topic

Javadocs

Is there a difference between these functions? I've looked at SC2Mapster and they don't have a page for AISetStockUnitNext. Is one better than the other in certain situations, or something?

Kernel64

void AISetStockUnitNext (int player, int count, string aliasUnitType, bool when);

this stock will only be stocked given bool is true.

Say you give When as:

(AITechCount(player, c_ZU_Queen, c_techCountCompleteOnly) > 1) == true

whatever aliasUnitType you put up there will only be stocked once our when here is true.

It's like a setstock with an if.

You can have say:

AISetStockUnitNext (player, 2, c_TB_Armory, AIHasRes(player, 500, 100) );

which will stock an armory when the AI gets >= 500 minerals and 100 gas.

Astazha

I can't give you the exact details because I'm reformatting my computer but the last argument of AISetStockUnitNext has 2 values

one is something like c_stockIdle and the other is something like c_stockAlways.  I'm going from memory here.

The idle one, which I think is the false value, doesn't tell it to not stock that item yet, but rather to build up to it only with idle production capacity.  In the testing I've done with Zerg, if you tell it to build a bunch of drones with the c_stockIdle function and nothing else is going on it will start building Drones 1 at a time, not building a new one until the last one is finished (presumably to not use up all the larva since it's only supposed to be using "idle" production capacity.)

I think there's some other difference between this and AISetStock, but I'm not entirely clear on what it is.  I stopped doing detailed testing on these because I intend to try to work without them.