Thursday, April 12, 2012

argg!! Why is my AI not building air defense?? SC2

[:1]I am totally mad, I cannot figure this out, been trying different things
I want illumant to build some anti air guns, but...for the life of me I can't figure out why its not, here is the code in my ai, i have never seen it build even a single anti air cannon
defense is set to 0.30 of energy and mass expenditure, so there is allocation to spend, but..wtf??
SkirmishEngineerBlueprint {
AnnounceItem = false,
AnnounceFail = false,
BlueprintId = 'Air Defense - Less than 2 - React',
BuilderIds = {
'uul0002',
'uul0001',
'ucl0002',
'ucl0001',
'uil0002',
'uil0001',
},
Conditions = {
{
{ ConditionType = 'UnitBuildCheck', ConditionStringOne = 'uub0102', ConditionBool = true, },
{ ConditionType = 'EngineerBlueprintCanAfford', },
{ ConditionType = 'EngineerBlueprintPositionQuery', },
{ ConditionType = 'BaseUnitIdLessThan', ConditionIntegerOne = 2, ConditionStringOne = 'uub0102, ucb0102, uib0102', },
{ ConditionType = 'BaseFriendlyUnitsNearbyGreaterThan', ConditionIntegerOne = 0, ConditionCategoryStringOne = 'STRUCTURE', },
{ ConditionType = 'TestFlag', ConditionStringOne = 'AirUnitsSpotted' },
},
{
{ ConditionType = 'UnitBuildCheck', ConditionStringOne = 'ucb0102', ConditionBool = true, },
{ ConditionType = 'EngineerBlueprintCanAfford', },
{ ConditionType = 'EngineerBlueprintPositionQuery', },
{ ConditionType = 'BaseUnitIdLessThan', ConditionIntegerOne = 2, ConditionStringOne = 'uub0102, ucb0102, uib0102', },
{ ConditionType = 'BaseFriendlyUnitsNearbyGreaterThan', ConditionIntegerOne = 0, ConditionCategoryStringOne = 'STRUCTURE', },
{ ConditionType = 'TestFlag', ConditionStringOne = 'AirUnitsSpotted' },
},
{
{ ConditionType = 'UnitBuildCheck', ConditionStringOne = 'uib0102', ConditionBool = true, },
{ ConditionType = 'EngineerBlueprintCanAfford', },
{ ConditionType = 'EngineerBlueprintPositionQuery', },
{ ConditionType = 'BaseUnitIdLessThan', ConditionIntegerOne = 6, ConditionStringOne = 'uub0102, ucb0102, uib0102', },
{ ConditionType = 'BaseFriendlyUnitsNearbyGreaterThan', ConditionIntegerOne = 0, ConditionCategoryStringOne = 'STRUCTURE', },
{ ConditionType = 'TestFlag', ConditionStringOne = 'AirUnitsSpotted' },
},
},
ItemGroups = {
'Default Item Group',
'Rush Item Group',
},
PlatoonBehavior = 'EngineerBuild',
UnitToBuild = 'AirDefenseTower',
BuildLocation = 'Base',
BasePriority = 1050,
InstanceCount = 1,
BuildRelative = 'CenterPoint',
SkirmishResourceType = 'All',|||Several possibilities.
SkirmishResourceType = 'All',
means it isn't going to use your defense spending for it, it will just use anything. So that shouldn't be the issue.
One reason could be that because the AA tower costs more than many other things it isn't getting built. If a land defense turret has a similar priority it may be stealing it all away since its cheaper.
Easiest way to solve this is to change
AnnounceItem = false,
AnnounceFail = false,
to true.
Then use the F9 log and watch. It will show up in the log every time the AI checks it, and will tell you why it fails if it fails. If it never shows up as failing or passing, then the blueprint is broken and not being used. Sometimes it will pass, but never get built, which is a whole different issue.
You will of course need to enable the debug console to use the debug log but without it, modding the AI is not going to be fun :)|||I guess I should also ask if you uncommented it in the .bp file.
GPG has commented out the point defense and air defense less than 2 react, so you will need to delete the comment brackets. Hopefully you are not using notepad, as it doesn't automatically highlight things like this.

No comments:

Post a Comment