It appears you have not registered with our community. To register please click here ...

May 18, 2012, 05:13:35 AM

Author Topic: AISetStock vs AISetStockUnitNext  (Read 729 times)

Javadocs

  • New Member
  • *
  • Posts: 1
    • View Profile
AISetStock vs AISetStockUnitNext
« on: March 27, 2010, 02:45:06 PM »
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?

DarkBlizz - Making Battle.net Magic -

AISetStock vs AISetStockUnitNext
« on: March 27, 2010, 02:45:06 PM »

Kernel64

  • Sr. Member
  • ****
  • Posts: 207
    • View Profile
Re: AISetStock vs AISetStockUnitNext
« Reply #1 on: March 27, 2010, 08:10:48 PM »
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

  • Member
  • ***
  • Posts: 78
    • View Profile
Re: AISetStock vs AISetStockUnitNext
« Reply #2 on: March 28, 2010, 04:03:04 AM »
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.

DarkBlizz - Making Battle.net Magic -

Re: AISetStock vs AISetStockUnitNext
« Reply #2 on: March 28, 2010, 04:03:04 AM »