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

May 18, 2012, 05:14:06 AM

Author Topic: Anyone else having trouble with Factory TechLabs / Reactors?  (Read 647 times)

hd

  • Member
  • ***
  • Posts: 56
    • View Profile
Anyone else having trouble with Factory TechLabs / Reactors?
« 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.

DarkBlizz - Making Battle.net Magic -

Anyone else having trouble with Factory TechLabs / Reactors?
« on: March 26, 2010, 07:57:46 PM »

hd

  • Member
  • ***
  • Posts: 56
    • View Profile
Re: Anyone else having trouble with Factory TechLabs / Reactors?
« Reply #1 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.

Code: [Select]
    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.

Kernel64

  • Sr. Member
  • ****
  • Posts: 207
    • View Profile
Re: Anyone else having trouble with Factory TechLabs / Reactors?
« Reply #2 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?

hd

  • Member
  • ***
  • Posts: 56
    • View Profile
Re: Anyone else having trouble with Factory TechLabs / Reactors?
« Reply #3 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);

Kernel64

  • Sr. Member
  • ****
  • Posts: 207
    • View Profile
Re: Anyone else having trouble with Factory TechLabs / Reactors?
« Reply #4 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.

hd

  • Member
  • ***
  • Posts: 56
    • View Profile
Re: Anyone else having trouble with Factory TechLabs / Reactors?
« Reply #5 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.

Code: [Select]
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.

DarkBlizz - Making Battle.net Magic -

Re: Anyone else having trouble with Factory TechLabs / Reactors?
« Reply #5 on: March 27, 2010, 12:44:59 AM »