Next War + BBATAI

openyourmind

Chieftain
Joined
Feb 22, 2016
Messages
51
Hi everybody, been busy merging these 2 great mods. Merged all units, buildings, techs etc. Having couple of problems. I will go by priority:
  1. Events
    Merged the 3 events from the mod (cyclones, sensors and slip), they seem to function, although I am not 100% sure.

    There is an event that makes resource deplete. Wondering how can I add that from python, what exactly to copy. JKP said it was part of DLL but I see none of that in mod, so this must have changed to python over the patches. In the attachments is the python folder as well as the events one.
  2. CTD's
    These are rare, and running 2 game instances probably had something to do with it, but how can I be sure it was a one time thing?
  3. http://imgur.com/a/1cfsZ
    (In case you don't see it, in BBATAI, Bio rocket has 0 strength in unit categories, but if you mouse over all is correct, as well as 1 move as opposed to 4 in Next War)
  4. Scrub
    This appeared in improvements after I merged the text files. Don't see it next war and doesn't seeм to do anything. Any ideas?

Thanks in advance for your answers
 

Attachments

Never mind the scrub. It won't do anything. It was a land type I was trying to add to BBATAI and it didn't work. The game will ignore it.
 
Not so Grasshopper...

2. The CTD's could be caused by the music files. There is a bug in one of the music XML files in BBATAI that I keep getting rid of but won't go away. It happens on return to main menu in the Escape menu. Is that what's happening?

3. I didn't even know there was a bio-rocket in BBATAI, but then I've had a few dozen glasses of wine tonight... It would be an XML tweak for you to get it the same in both versions.

4. I explained that one.

1. Not sure about this. I would have to look at the code...
 
Hey Lemon_Merchant, thanks for your response.

2. The CTD's could be caused by the music files. There is a bug in one of the music XML files in BBATAI that I keep getting rid of but won't go away. It happens on return to main menu in the Escape menu. Is that what's happening?

Yes! This is exactly that. There are bunch of other crashes happening usually on unit spawn, but they are unrelated to BBATAI and are totally my doing. :lol:

3. I didn't even know there was a bio-rocket in BBATAI, but then I've had a few dozen glasses of wine tonight... It would be an XML tweak for you to get it the same in both versions.

There wasn't, it was after I added it with merging. They both have same stats, in-game and pedia wise. Problem is with unit categories, I suspect this to be sevopedia issue although I cannot be sure.

1. Not sure about this. I would have to look at the code...

In Next War, there are couple of line that are used for this. Disregard my statement about DLL's, it's all in python (DLL was used to add it to game options in custom game, which was in a modmod).

The lines go as followed

Spoiler :
Code:
		if iGameTurn!=0:
			if iGameTurn%2 == 0:
				self.doCheckDepletion()
	def doCheckDepletion(self):
		self.doCheckWorkedResource("BONUS_ALUMINUM", "IMPROVEMENT_MINE", 880)
		self.doCheckWorkedResource("BONUS_ALUMINUM", "IMPROVEMENT_FORT", 880)
		self.doCheckWorkedResource("BONUS_BANANA", "IMPROVEMENT_PLANTATION", 1120)
		self.doCheckWorkedResource("BONUS_BANANA", "IMPROVEMENT_FORT", 1120)
		self.doCheckWorkedResource("BONUS_CLAM", "IMPROVEMENT_FISHING_BOATS", 880)
		self.doCheckWorkedResource("BONUS_COAL", "IMPROVEMENT_MINE", 880)
		self.doCheckWorkedResource("BONUS_COAL", "IMPROVEMENT_FORT", 880)
		self.doCheckWorkedResource("BONUS_COPPER", "IMPROVEMENT_MINE", 880)
		self.doCheckWorkedResource("BONUS_COPPER", "IMPROVEMENT_FORT", 880)
		self.doCheckWorkedResource("BONUS_CORN", "IMPROVEMENT_FARM", 1120)
		self.doCheckWorkedResource("BONUS_CORN", "IMPROVEMENT_FORT", 1120)
		self.doCheckWorkedResource("BONUS_COW", "IMPROVEMENT_PASTURE", 1120)
		self.doCheckWorkedResource("BONUS_COW", "IMPROVEMENT_FORT", 1120)
		self.doCheckWorkedResource("BONUS_CRAB", "IMPROVEMENT_FISHING_BOATS", 1120)
		self.doCheckWorkedResource("BONUS_DEER", "IMPROVEMENT_CAMP", 780)
		self.doCheckWorkedResource("BONUS_DEER", "IMPROVEMENT_FORT", 780)
		self.doCheckWorkedResource("BONUS_DYE", "IMPROVEMENT_PLANTATION", 1120)
		self.doCheckWorkedResource("BONUS_DYE", "IMPROVEMENT_FORT", 1120)
		self.doCheckWorkedResource("BONUS_FISH", "IMPROVEMENT_FISHING_BOATS", 880)
		self.doCheckWorkedResource("BONUS_FUR", "IMPROVEMENT_CAMP", 560)
		self.doCheckWorkedResource("BONUS_FUR", "IMPROVEMENT_FORT", 560)
		self.doCheckWorkedResource("BONUS_GEMS", "IMPROVEMENT_MINE", 1120)
		self.doCheckWorkedResource("BONUS_GEMS", "IMPROVEMENT_FORT", 1120)
		self.doCheckWorkedResource("BONUS_GOLD", "IMPROVEMENT_MINE", 880)
		self.doCheckWorkedResource("BONUS_GOLD", "IMPROVEMENT_FORT", 880)
		self.doCheckWorkedResource("BONUS_HORSE", "IMPROVEMENT_PASTURE", 1120)
		self.doCheckWorkedResource("BONUS_HORSE", "IMPROVEMENT_FORT", 1120)
		self.doCheckWorkedResource("BONUS_IRON", "IMPROVEMENT_MINE", 880)
		self.doCheckWorkedResource("BONUS_IRON", "IMPROVEMENT_FORT", 880)
		self.doCheckWorkedResource("BONUS_IVORY", "IMPROVEMENT_CAMP", 560)
		self.doCheckWorkedResource("BONUS_IVORY", "IMPROVEMENT_FORT", 560)
		self.doCheckWorkedResource("BONUS_MARBLE", "IMPROVEMENT_QUARRY", 750)
		self.doCheckWorkedResource("BONUS_MARBLE", "IMPROVEMENT_FORT", 750)
		self.doCheckWorkedResource("BONUS_OIL", "IMPROVEMENT_WELL", 880)
		self.doCheckWorkedResource("BONUS_OIL", "IMPROVEMENT_FORT", 880)
		self.doCheckWorkedResource("BONUS_OIL", "IMPROVEMENT_OFFSHORE_PLATFORM", 880)
		self.doCheckWorkedResource("BONUS_PIG", "IMPROVEMENT_PASTURE", 1120)
		self.doCheckWorkedResource("BONUS_PIG", "IMPROVEMENT_FORT", 1120)
		self.doCheckWorkedResource("BONUS_RICE", "IMPROVEMENT_FARM", 1120)
		self.doCheckWorkedResource("BONUS_RICE", "IMPROVEMENT_FORT", 1120)
		self.doCheckWorkedResource("BONUS_SILK", "IMPROVEMENT_PLANTATION", 1120)
		self.doCheckWorkedResource("BONUS_SILK", "IMPROVEMENT_FORT", 1120)
		self.doCheckWorkedResource("BONUS_SILVER", "IMPROVEMENT_MINE", 880)
		self.doCheckWorkedResource("BONUS_SILVER", "IMPROVEMENT_FORT", 880)
		self.doCheckWorkedResource("BONUS_SPICES", "IMPROVEMENT_PLANTATION", 1120)
		self.doCheckWorkedResource("BONUS_SPICES", "IMPROVEMENT_FORT", 1120)
		self.doCheckWorkedResource("BONUS_STONE", "IMPROVEMENT_QUARRY", 750)
		self.doCheckWorkedResource("BONUS_STONE", "IMPROVEMENT_FORT", 750)
		self.doCheckWorkedResource("BONUS_SUGAR", "IMPROVEMENT_PLANTATION", 1120)
		self.doCheckWorkedResource("BONUS_SUGAR", "IMPROVEMENT_FORT", 1120)
		self.doCheckWorkedResource("BONUS_URANIUM", "IMPROVEMENT_MINE", 880)
		self.doCheckWorkedResource("BONUS_URANIUM", "IMPROVEMENT_FORT", 880)
		self.doCheckWorkedResource("BONUS_WHALE", "IMPROVEMENT_WHALING_BOATS", 560)
		self.doCheckWorkedResource("BONUS_WHEAT", "IMPROVEMENT_FARM", 1120)
		self.doCheckWorkedResource("BONUS_WHEAT", "IMPROVEMENT_FORT", 1120)
		self.doCheckWorkedResource("BONUS_WINE", "IMPROVEMENT_WINERY", 1120)
		self.doCheckWorkedResource("BONUS_WINE", "IMPROVEMENT_FORT", 1120)

	def doCheckWorkedResource(self, bonus, improvement, randomInt):
            
		iBonus = CvUtil.findInfoTypeNum(gc.getBonusInfo, gc.getNumBonusInfos(), bonus)
        
		if (iBonus == -1):
			return
        
		lValidPlots = self.getPlotListbyBonus(iBonus)
        
		if len(lValidPlots) == 0:
			return
                
##If you have the requisite improvement (incl. fort) or if the plot is being worked by a City, continue.
                        
			for plot in lValidPlots:
				P = False
                
				if plot.getImprovementType() == CvUtil.findInfoTypeNum(gc.getImprovementInfo, gc.getNumImprovementInfos(), improvement):
					P = True
				elif plot.isCity():
					P = True

				if P == True:
					if self.getRandomNumber(randomInt) == 0:
                    
						pBonusInfo = gc.getBonusInfo(iBonus)
                    
						plot.setBonusType(-1)
                    
						szTitle = localText.getText("TEXT_KEY_NEXT_WAR_RESOURCE_DEPLETED_TITLE", ())# (pBonusInfo.getDescription(), plotgetX(), plot.getY()))
                        #szText = localText.getText("TEXT_KEY_NEXT_WAR_RESOURCE_DEPLETED", (pBonusInfo.getDescription(), plot.getX(), plot.getY()))
                        #Not sure what the above commented out code for (debugging?) -- it was commented out in PM's original NextWar code.  JKP1187
                        
						CyInterface().addMessage(plot.getOwner(), False, gc.getEVENT_MESSAGE_TIME(), szTitle, "AS2D_DISCOVERBONUS", InterfaceMessageTypes.MESSAGE_TYPE_MINOR_EVENT, pBonusInfo.getButton(), gc.getInfoTypeForString("COLOR_GREEN"), plot.getX(), plot.getY(), True, True)		
				else:
					return
				

### Below are additional functions necessary to the activity of the resource depl'n code:

	def getPlotListbyBonus(self, iBonus):
		lPlots = []
		totalPlots = gc.getMap().numPlots()
		
		for i in range(totalPlots):
			plot = gc.getMap().plotByIndex(i)
			iOwner = plot.getOwner()
			if (iOwner != -1):
				if plot.getBonusType(gc.getPlayer(iOwner).getTeam()) == iBonus:
					lPlots.append(plot)
		return lPlots

	def getRandomNumber(self, int):
		return gc.getGame().getSorenRandNum(int, "Next War")

Big problem comes when trying to add this. I have no knowledge of this, but eventmanager stops being read even after simply adding this (guess he doesn't like something in text)

Also, while testing the merge I found new issues which seem to have its legs growing from BUG
  1. No interface when game loads
  2. When game does have interface, the tech screen is.."damaged". I cannot pinpoint exactly why it does that, but from observation, if I mess with the events or python, this happens. It's also unscrollable.
    http://imgur.com/gfA4PVa

Searching the forums this seems to be customassets issue in My documents, but I will have a closer look later and be sure, since none of that happens in unmodified BBATAI.
 
Have you enabled Python exceptions in the ini file? That will help pinpoint where the error is happening.

The no interface thing is common if you've tinkered with XML and/or Python and have an error. Same with the broken tech screen. It means that something has broken in the load up and CvScreenInterface cannot load properly.

Enable Python exception logging and post the results, and I'll see if I can help.
:)
 
Have you enabled Python exceptions in the ini file? That will help pinpoint where the error is happening.

The no interface thing is common if you've tinkered with XML and/or Python and have an error. Same with the broken tech screen. It means that something has broken in the load up and CvScreenInterface cannot load properly.

Enable Python exception logging and post the results, and I'll see if I can help.
:)

Thanks a lot for telling me this, I didn't know that. Seems even adding simply units does this. This is basically running mod with

  • Techs
  • Units
  • Buildings
  • Promotions
  • Improvements
Please, help me. I await eagerly your response, as I am out of ideas and close to giving up.
 

Attachments

Please zip the contents of your Assets\XML and Assets\Python and Assets\Contrib and Assets\Modules (only the stuff for NextWar here), plus the relevant graphics files for NextWar and send them to the address I'll send you in PM.

Make the files small. Break it up to small files about 5 MB each if you can so they get through in email.
 
Well, I had a a quick looksee into the problems, and you've made a few boo boos, but no big thing. Can you send me the original Nextwar files you were trying to merge in, please?

This will take me a couple of days, if not a week, so be patient, k? :)
 
Well, I had a a quick looksee into the problems, and you've made a few boo boos, but no big thing. Can you send me the original Nextwar files you were trying to merge in, please?

This will take me a couple of days, if not a week, so be patient, k? :)

Thanks a lot, sent. Can you please tell me what did I do wrong? everything went by instructions, copiedeverything from existing files and in game all looks like its working, why does this happen??
 
From what I can see, you copied NextWar files over top of the BBATAI files without merging them, and introduced a whole lot of XML errors into the game. I can't get the game to run with the files you sent unless I clean up the XML errors first. There are also python errors because needed code has been replaced with NextWar code, and/or not merged properly.

Fear not, we'll get it working. :)
 
Shameless poke to see if this has been updated and functioning properly. OP hasn't been edited to suggest that, so leery of whipping into a Marathon game to find out.
 
Shameless poke to see if this has been updated and functioning properly. OP hasn't been edited to suggest that, so leery of whipping into a Marathon game to find out.

Personally, I would love for this to work. However, as Next War had scripts, seems BBATAI does not like them so much.

If you want, you could easily add basic stuff like I did with units buildings and such. You will have the next war units buildings and all under BBATAI.

My problems arose when trying to get the scripts working which if I remember correctly, made sure you could not build different kinds of shielding (one replaces the other through scripts) as well as creating ruins with city shielding different from other ruins.

As Lemon_Merchant hasn't taken a look at that, and with my limited knowledge, the whole thing is at stand still.
 
I haven't looked at it because you disappeared for three months and I wasn't sure if you were still interested in doing it.

If you are, please PM me.
 
Well, I didn't know what to do and didn't receive any mail from you after that so I figured you changed your mind or something.

Anyway sent you a PM. Thanks for taking interest in this. I still don't know what to do though :D
 
Ok doing this all over again, very slowly this time to stop when I see any error.

Added next war techs. So far nothing bad. Next update is probably saturday.
 
Better BAT AI is a mod based on BUG this means it does not have a CvEventManager.py or CvGameUtils.py and you have to program changes differently. How to do this is described on the BUG documentation but I have noticed the Orion Veteran and I have totally different ways of achieving this end.

Step 1 involves comparing the Next War mod's CvEventManager.py with the BtS CvEventManager.py to find out the differences. These differences will be extracted out into a new bit of python and then we tell BUG about the code and when it is used. Same goes for the CvGamesUtils.py. I have stuff on early this morning but I'll have a look and see if I can come up with something after that.
 
I have extracted the NextWar python into BUG style module for the event manager and game utils but I have done something wrong somewhere. Probably in the config XML and I just can't see it.

Look at the XML files in the config folder inside the zip and compare them to those in the folder in the BBATAI mod, perhaps you will see what it is that I have done wrong.

It is not loading the info about the NextWar python and is crashing with an XML error but I am not getting any errors in the logs that I can see.

I will have another look later:scan:
 
Alright man thanks, I will take a look in the evening. Although I doubt that will see anything
 
Back
Top Bottom