Better BAT AI

Oh Great Exalted Potentate :bowdown:

I tried to add my UU Frontiersman in place of the American Musketman and the UB "State Capitols" to the Better Bat AI and while it sees the buildings, it wont use them. Plus I get a class error for BuildingClass_American_State_Capitol, etc.

Also I can edit units (promotions) but I cant edit buildings

I havent tried to edit Civics yet...

thanks
 
Post some code, my young apprentice. Maybe I can help.

And welcome to the Dark Side. ;)
 
The roman, greek and persian warelephants all have a little graphic error in their attack animation, where the rider is hanging on the side instead of sitting on top. I think its one of the hurt animations but im not 100% on that. I tested all other civs elephants and they work fine.

I found in Assets\Modules\Varietas Delectat\XML\UnitArt\VD_CIV4ArtDefines_Unit.xml that they have in common that they all use the WarElephant.kfm. But there my little knowledge ends.
I tried replacing the WarElephant.kfm with other elephant.kfms but only managed to break the graphic completely. :rolleyes:

I know its only a tiny thing, but its bugging me nonetheless. :crazyeye:
 
Hi,
I would like to add some components which need SDK-Changes. Thanks for giving the source files of the 50-Civ-DLL.

Since I´m really a beginner, I first wanted to compile the dll without any change. Surprisingly the compiling run through without any error.

But when I start the debugging, I get several error messages which I can´t deal with. The game starts and I also can start a new game, so I don´t know if the error messages are important or not.

Several times I have the following error:
Code:
Assert Failed

File:  CvXMLLoadUtilitySet.cpp
Line:  1364
Expression:  bSuccess
Message:  

----------------------------------------------------------

What does this mean?

Then there are some ArtStyleTypes missing in the GlobalTypes.xml:
ARTSTYLE_MIDDLE_EAST
ARTSTYLE_ASIAN (but there is ASIA)
ARTSTYLE_EUROPEAN (but there is EUROPE)
ARTSTYLE_ARABIAN (but there is ARABIA)
ARTSTYLE_MEDITERRANEAN
ARTSTYLE_SOUTH_EAST_ASIAN (but there is SOUTH_EAST_ASIA)

I believe correcting the names and adding the Artstyles in the GlobalTypes.xml should do it right? EDIT: i´ve tried it, but in some places it´s f.e. EUROPE, somwhere else EUROPEAN. The same for ASIA and SOUTH_EAST_ASIA. I believe both is the same each time right? So it should be fixed so that only one spelling of each is used.

Perhaps you could help me with the errors I´ve still left.
 
And another one. Two civ that doesn´t exist are used as derivative civs

Lithuania for Poland and Maori for Polonesia. I think both should be just none.
 
The roman, greek and persian warelephants all have a little graphic error in their attack animation, where the rider is hanging on the side instead of sitting on top. I think its one of the hurt animations but im not 100% on that. I tested all other civs elephants and they work fine.

I found in Assets\Modules\Varietas Delectat\XML\UnitArt\VD_CIV4ArtDefines_Unit.xml that they have in common that they all use the WarElephant.kfm. But there my little knowledge ends.
I tried replacing the WarElephant.kfm with other elephant.kfms but only managed to break the graphic completely. :rolleyes:

I know its only a tiny thing, but its bugging me nonetheless. :crazyeye:
Thanks Cirgon. I'll look into it.

Hi,
I would like to add some components which need SDK-Changes. Thanks for giving the source files of the 50-Civ-DLL.

Since I´m really a beginner, I first wanted to compile the dll without any change. Surprisingly the compiling run through without any error.

But when I start the debugging, I get several error messages which I can´t deal with. The game starts and I also can start a new game, so I don´t know if the error messages are important or not.

Several times I have the following error:
Code:
Assert Failed

File:  CvXMLLoadUtilitySet.cpp
Line:  1364
Expression:  bSuccess
Message:  

----------------------------------------------------------

What does this mean?
When you get an FAssert, it means that something in the code has failed. In this case, it's bSuccess that is giving a bad value, or throwing an exception. You'll need to trace bSuccess to find out where it's going wrong.

Then there are some ArtStyleTypes missing in the GlobalTypes.xml:
ARTSTYLE_MIDDLE_EAST
ARTSTYLE_ASIAN (but there is ASIA)
ARTSTYLE_EUROPEAN (but there is EUROPE)
ARTSTYLE_ARABIAN (but there is ARABIA)
ARTSTYLE_MEDITERRANEAN
ARTSTYLE_SOUTH_EAST_ASIAN (but there is SOUTH_EAST_ASIA)

I believe correcting the names and adding the Artstyles in the GlobalTypes.xml should do it right? EDIT: i´ve tried it, but in some places it´s f.e. EUROPE, somwhere else EUROPEAN. The same for ASIA and SOUTH_EAST_ASIA. I believe both is the same each time right? So it should be fixed so that only one spelling of each is used.

Perhaps you could help me with the errors I´ve still left.
Different modders have used different methods of naming the ARTSTYLE tags. You need to be careful if you edit the XML that you don't delete the incorrect ARTSTYLE tags from an included mod.
And another one. Two civ that doesn´t exist are used as derivative civs

Lithuania for Poland and Maori for Polonesia. I think both should be just none.
I would remove any BXP packs that you have installed while you're working with or debugging the DLL. They aren't intended to be a part of the core BBATAI mod, and could cause errors.
 
Thanks.

Ok. I´ve just added the ArtStyles in the GlobalTypes.xml and now it seems to work. No error messages for that.

But what are "BXP packs"?
 
Thanks.

Ok. I´ve just added the ArtStyles in the GlobalTypes.xml and now it seems to work. No error messages for that.

But what are "BXP packs"?
I'm glad it worked. :)

When you said Polynesia and Poland I had assumed you were using two of the "BXP" expansion packs for BAT. (See the link in my sig) Are Poly and Poland part of something that you're merging in? In normal BBATAI, I don't think those tags should be there. If those two civs were pulled from another mod, they may have weird derivatives. It should be safe to say "none"


so now follow you I should install patch 3.19 or Better BAT AI 1.01 before:lol:when I install patch 3.19 and Better BAT AI 1.01 and load a mod is faulty http://nq2.upanh.com/b2.s30.d1/d75e4f892731a81438a88d450dba43a8_48891062.untitled.bmp:lol:

You cannot load Better BAT AI and another mod at the same time. It will be "faulty" as you say, and it won't work. You need patch 3.19 to play Better BAT AI.
 
:eek: You´re right. That was the first thing I added a few months ago and I´m so used to the 50 Civs, that I thougt it was already part of the Better BAT AI.

I couldn´t find the thread where I have the 16 civs from, but it wasn´t BXP. Thank you for your help.:thumbsup:
 
The roman, greek and persian warelephants all have a little graphic error in their attack animation, where the rider is hanging on the side instead of sitting on top. I think its one of the hurt animations but im not 100% on that. I tested all other civs elephants and they work fine.

Forum reading made me smarter and able to test some more.
Now i can tell you that hurta/b and diea/b in the Assets\art\Units\warelephant folder all cause those graphic error.

I removed them since other elephant units dont use them anyway if i understood that right, and the ones that do produce this glitch wich makes it pointless.
 
Forum reading made me smarter and able to test some more.
Now i can tell you that hurta/b and diea/b in the Assets\art\Units\warelephant folder all cause those graphic error.

I removed them since other elephant units dont use them anyway if i understood that right, and the ones that do produce this glitch wich makes it pointless.

Another tip o' the hat to Cirgon. Thank you! :)
 
Hi i had a question about installing the Better BAT AI mod. I'm not very technically inclined but, whenever i try to install it i always get stopped at the end because it asks me to find my "Better Bat AI folder". So i went and looked through my mods folder for my Civ4 and couldn't find a "Better Bat AI folder". I have the 3.19 Bts patch, do i need to install a diff mod(s) before i'm able to install this one? :confused:
 
Hi i had a question about installing the Better BAT AI mod. I'm not very technically inclined but, whenever i try to install it i always get stopped at the end because it asks me to find my "Better Bat AI folder". So i went and looked through my mods folder for my Civ4 and couldn't find a "Better Bat AI folder". I have the 3.19 Bts patch, do i need to install a diff mod(s) before i'm able to install this one? :confused:

You shouldn't have to find the Better BAT AI folder. It is created by the installer. You don't need to install anything else to make this install, you just have to run the BBATAI installer.

What version of Civ4 do you have? (Civ4 Gold edition, normal, Steam...)

Are you running the installer as administrator? Try that, it may help.
 
Thanks, you were right i didn't have to install anything else i kinda feel like an idiot for not noticing this earlier lol. Whenever i got to the choose components i thought everything would be pre-selected, but the default was "install in user folders" and not "install as mod". Quick click and it worked thanks :).
 
I'm happy that it worked for you. Enjoy. :)
 
It´s me again with another python error.:blush:

When I start a custom game, sometimes the error in the attached screenshot shows up (you can ignore the comments in the white boxes) and sometimes not. Even when I start a new game with just one Civ sometimes everything is ok, the other time with the same civ the error is there.

I´ve looked at the lines which where pointed out and it seems to have something to do with the PromotionGrouping.

Here are the referred files with the lines which were pointed out in red.

BugInit line 93:
Code:
def callInits():
	"""Calls all of the stored init functions in the order they were added."""
	BugUtil.debug("BugInit - calling init functions...")
	while g_initQueue:
		name, func = g_initQueue.pop(0)
		try:
			[COLOR="Red"]func()[/COLOR]
		except:
			BugUtil.trace("BugInit - init '%s' failed" % name)

CvScreensInterface line 1185:
Code:
# BUG - Options - start
def init():
	createDomesticAdvisor()
	createFinanceAdvisor()
	[COLOR="Red"]createMilitaryAdvisor()[/COLOR]
	createCivilopedia()
	createTechSplash()
# BUG - Options - end

CvScreensInterface line 160:
Code:
# BUG - Military Advisor - start
militaryAdvisor = None
def createMilitaryAdvisor():
	"""Creates the correct Military Advisor based on an option."""
	global militaryAdvisor
	if militaryAdvisor is None:
		if (AdvisorOpt.isBUG_MA()):
			import CvBUGMilitaryAdvisor
			[COLOR="Red"]militaryAdvisor = CvBUGMilitaryAdvisor.CvMilitaryAdvisor(MILITARY_ADVISOR)[/COLOR]
		else:
			import CvMilitaryAdvisor
			militaryAdvisor = CvMilitaryAdvisor.CvMilitaryAdvisor(MILITARY_ADVISOR)
		HandleInputMap[MILITARY_ADVISOR] = militaryAdvisor

CvBUGMilitaryAdvisor line 87:
Code:
	def __init__(self, screenId):
		self.screenId = screenId
		self.SCREEN_NAME = "MilitaryScreen-BUG"

		self.UNIT_LOC_TAB_ID = "MilitaryUnitLocTabWidget-BUG"
		self.SIT_REP_TAB_ID = "MilitarySitRepTabWidget-BUG"
		self.STRAT_ADV_TAB_ID = "MilitaryStratAdvTabWidget-BUG"

		self.X_GROUP_LIST = 20
		self.Y_GROUP_LIST = 190
		self.W_GROUP_LIST = 280
		
		self.X_MAP = 20
		self.Y_MAP = 220      # 190
		self.W_MAP = 580
		self.H_MAP_MAX = 470  # 500
		self.MAP_MARGIN = 20

		self.X_TEXT = 625
		self.Y_TEXT = 190
		self.W_TEXT = 380
		self.H_TEXT = 500
						
		self.X_LEADERS = 20
		self.Y_LEADERS = 80
		self.W_LEADERS = 985
		self.H_LEADERS = 90
		self.LEADER_BUTTON_SIZE = 64
		self.LEADER_MARGIN = 12

		self.LEADER_COLUMNS = int(self.W_LEADERS / (self.LEADER_BUTTON_SIZE + self.LEADER_MARGIN))

		[COLOR="Red"]self.grouper = UnitGrouper.StandardGrouper()[/COLOR]
		self.selectedLeaders = set()
		self.selectedGroups = set()
		self.selectedUnits = set()
		self.groupingKeys = ["loc", "type"]

UnitGrouper line 299:
Code:
class StandardGrouper(Grouper):
	def __init__(self):
		Grouper.__init__(self)
		
		self._addGrouping(UnitTypeGrouping())
		self._addGrouping(UnitCombatGrouping())
		self._addGrouping(LevelGrouping())
		[COLOR="Red"]self._addGrouping(PromotionGrouping())[/COLOR]
		self._addGrouping(LocationGrouping())
		self._addGrouping(OrderGrouping())

UnitGrouper line 166:
Code:
class PromotionGrouping(Grouping):
	"""
	Groups units by their promotions.
	Ex: Combat 1, Cover, Tactics
	"""
	def __init__(self):
		Grouping.__init__(self, "promo", "TXT_KEY_UNIT_GROUPER_PROMOTION_GROUPING")
		
		self.NONE = 0
		self.NO_PROMOS = (0,)
		self._addGroup(Group(self, self.NONE, "TXT_KEY_UNIT_GROUPER_PROMOTION_GROUP_NONE"))
		for i in range(gc.getNumPromotionInfos()):
			info = gc.getPromotionInfo(i)
			if info:
				[COLOR="Red"]self._addGroup(Group(self, i + 1, '<img=%s size=16></img> %s' % [/COLOR]
							          [COLOR="Orange"](info.getButton(), info.getDescription())))[/COLOR]

I´ve no idea where the failure is and how I could fix it. The only thing that looks strange for me is that "(info.getButton(), info.getDescription())))" in the last code (I made it orange) is so far left although it seems the last bracket closes the one behind "self._addGroup" in the line above (line 166). Could that be the problem?
 

Attachments

  • FehlermeldungGerry.jpg
    FehlermeldungGerry.jpg
    427.6 KB · Views: 291
Top Bottom