A.I Script Question

Started by mediavieja, March 11, 2010, 11:50:23 PM

Previous topic - Next topic

mediavieja

Hi, im new to all this AI thing but im starting to figure it out, right now im trying to make some improvements on the defense capabilities of the AI, but there are a few commands that i still cant figure it out completely how they work, so if anyone can gimme a hand here it would be really nice :) so far iv been able to make the AI very defensive but when she builds the defenses they are too far from the entrance of the place and too disperse around the base, so that's what im trying to fix, anyways these are the commands im trying to figure out:

const int c_avoidChokePoint         = 0x00020000;
whats a ChokePoint? and whats that 0x00020000 the distance?

AISetStockUnitNext( player, 3, c_PU_Stalker, c_stockAlways );
AISetStockUnitNext( player, 3, c_PB_Pylon, c_stockAlways  );
and what does the c_stockAlways do on both, does that means that with that command i only have to use it once on the script and from that on i wont have to repeat it again cause the AI will always have 3 pylons or stalkers and whenever she doesnt she will build them?

thx in advance :)

DarkZeros

This is not the right place, you hould post in the Development Forum.

Anyway i'll anwser your question:
C_StockAlways makes the AI build that unit till it reaches the number of units indicated. But the AI builds the units with some priorities, so that will probably don't work for your purpose.

I recomend you the AIBuild() call. You can select there the "town" (where the unit will be build), the amount, the priority, and the position, near the resources, or near the chokepoint. Look in AI.galaxy for the parameters of the call.
You will need to check first if the top amount of units has been reached in the queue, because if you don't it will build forever :P

mediavieja

thx for ur answer :) but whats a ChokePoint?

DarkZeros

You've got all your answers in BuilAI.galaxy

Thouse flags can be passed to the AIBuild() so it will build the structure depending on your preferences.
Choke point, is a point out of the base where usually is the place were the combat take place, the perfect point for a terran sensor tower:     
Quoteif (objType == c_TB_SensorTower) {
        return c_nearChokePoint;
    }