DarkBlizz

Game On => Land of AI => STARCRAFT II: WINGS OF LIBERTY => AI Development => Topic started by: hd on March 26, 2010, 07:57:46 PM

Title: Anyone else having trouble with Factory TechLabs / Reactors?
Post by: hd on March 26, 2010, 07:57:46 PM
I cannot, for the life of me, seem to get these built by the AI.

I'm using:
AISetStock(player, 1, c_TB_FactoryTechLab);
AISetStock(player, 1, c_TB_FactoryReactor);

They never build, ever.
Title: Re: Anyone else having trouble with Factory TechLabs / Reactors?
Post by: hd on March 26, 2010, 11:57:45 PM
For some reason, the following if statement is always evaluating to false, even when a factory has been completed.

    if (AITechCount(player, c_TB_Factory, c_techCountCompleteOnly) > 0 && AITechCount(player, c_TB_FactoryTechLab, c_techCountInProgressOrBetter) < 1)
    {
        TriggerDebugOutput(1, StringToText("Blah"), true);
        AISetStock(player, 1, c_TB_FactoryTechLab);
    }


Even though it's a direct copy from the Barracks techlab code (obviously with barracks replaced with factory) which works just fine.
Title: Re: Anyone else having trouble with Factory TechLabs / Reactors?
Post by: Kernel64 on March 27, 2010, 12:07:03 AM
Is there any other techlabs processing on another structure like a barracks?

I'm guessing it's possible that barracks techlabs may make the second condition false, so maybe that's where the problem is?
Title: Re: Anyone else having trouble with Factory TechLabs / Reactors?
Post by: hd on March 27, 2010, 12:16:32 AM
I was just about to post that apparently c_TB_FactoryTechLab in AITechCount counts ALL tech labs, regardless of what they're attached to. Which is very, very annoying. Even removing the second condition won't build one if there's already a tech lab using AISetStock(player, 1, c_TB_FactoryTechLab);
Title: Re: Anyone else having trouble with Factory TechLabs / Reactors?
Post by: Kernel64 on March 27, 2010, 12:22:50 AM
Well, if that's the case, at least it's good that we can specify where the techlab goes. Be it for a rax or factory. At least we can work with it, and count techlabs vs rax+fac. But then again, that's where issues come pumping in.

I don't know. Haven't done terrans yet.
Title: Re: Anyone else having trouble with Factory TechLabs / Reactors?
Post by: hd on March 27, 2010, 12:44:59 AM
So I've discovered a few things...

TechTreeUnitCount(player, unit or building, const) will return the correct number of tech labs or reactors, so if used in conjunction with AISetStock, you can have it build the correct amount automatically as demonstrated below.

AISetStock(player, 1 + TechTreeUnitCount(player, c_TB_BarracksReactor, c_techCountInProgressOrBetter), c_TB_FactoryReactor);

This will build 1 Factory Reactor regardless of how many Barracks Reactors you have.