Jump to content


Photo

How can the AI know how many HQ it has?


2 replies to this topic

#1 Kaiser Soze

Kaiser Soze
  • Members
  • 16 posts

Posted 14 January 2007 - 10:45 AM

Hi,
the tittle says it all.
I want the AI to know how many HQ it has. I've reading your file, but you seem to count only if the AI has a HQ, not the exact number.

Thanks in advance.
Kaiser Soze

#2 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 14 January 2007 - 02:40 PM

Check buildbasestrategy.ai

	-- Get building ID
	iID = cpu_manager.stats:GetBuildingID(sBuildingName)

	-- Check how many instances of this building exist
	local iInstances = 0
	for oBuildChannel in build_manager:GetBuildChannelAIs() do
		if (oBuildChannel:GetBlueprintID() == iID) then
			iInstances = iInstances + 1
		end
	end

You may want to add one if a build plan already exists but the build wan't started/finished yet.

#3 Kaiser Soze

Kaiser Soze
  • Members
  • 16 posts

Posted 14 January 2007 - 03:26 PM

Thanks



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users