Modder's Guide to Final Frontier Plus

I noticed that when merging CvFinalFrontierEvents.py that you don't have python code for trade route yields and specialist yields. Is the trade route yield stuff handled anywhere? I presume that I should keep the specialist yield, as Final Frontier doesn't use specialists.

Also, Starbase culture still seems to be done via python.

onGameUpdate doesn't seem to have any code in the mod platform version and only exists now for the Astral Gate victory condition. Since I don't use that, can I remove the function and disable the onUpdate python callback (I assume it is for this function)?

It looks like some planetary resources code and wormholes code got added into the mod platform version toward the end of the file.

EDIT: Just remembered what I forgot to put in here: I also noticed that most of the new XML tags don't have text associated with them yet. I assume this is intended, not a sign that I did something wrong?
 
I noticed that when merging CvFinalFrontierEvents.py that you don't have python code for trade route yields and specialist yields. Is the trade route yield stuff handled anywhere? I presume that I should keep the specialist yield, as Final Frontier doesn't use specialists.

Trade routes are done by the DLL, specialists aren't because I don't have any yet.

Also, Starbase culture still seems to be done via python.

Yes, unfortunately. I merged the culture on starbase creation, but I'm not (entirely) sure how to make it so that starbases built first get culture preference.

onGameUpdate doesn't seem to have any code in the mod platform version and only exists now for the Astral Gate victory condition. Since I don't use that, can I remove the function and disable the onUpdate python callback (I assume it is for this function)?

Yes, you can.

It looks like some planetary resources code and wormholes code got added into the mod platform version toward the end of the file.

It's okay (at least, I think it is), and can stay.

The Planetary Resources function is just that- a function- called by an actual callback. It does nothing if nothing is calling it. I left it there for the same reason I left all the Starbase AI code- to make it easier to add back Planetary Resources, since it's a really big function.

Same for Wormholes- it's only code in the Tutorial class, a boolean and accessors, that aren't actually used by anything else. It might make the size of the array pickled to script data bigger, but that's about all. (Plus it makes it easier for me, when I update Wormholes to work with Star Trek 4.0.)
 
Nice. As of right now, Star Trek is playable again (still need to merge CvAI, though). It certainly seems faster!

EDIT: Just noticed that I got a message "Civilization X has been killed" for every civilization not in my game after merging. Also, leaders with the 10x gold trait start with 110 gold rather than 100.
 
Nice. As of right now, Star Trek is playable again (still need to merge CvAI, though). It certainly seems faster!

EDIT: Just noticed that I got a message "Civilization X has been killed" for every civilization not in my game after merging. Also, leaders with the 10x gold trait start with 110 gold rather than 100.

Hmm. I see the gold problem, I'm using changeGold() in CvPlayer::initFreeState(), rather than setGold(). Since the actual code is:

Code:
changeGold(getGold() * kTraitInfo.getStartingGoldMultiplier());

If you have the XML set to give all civs starting gold of 10, this will add 10 * getStartingGoldMultiplier() to 10.

Change CvPlayer::initFreeState() to use setGold to fix this.

The other message is weird. Doesn't happen in Final Frontier Plus, so I'd say it's related either to Python or DLL merging issues (probably DLL), but I'm not sure what could cause it.
 
Got a python exception after merging the construction ship AI in CvAI:
Traceback (most recent call last):

File "CvGameInterface", line 185, in AI_unitUpdate

File "CvGameUtils", line 348, in AI_unitUpdate

File "CvAI", line 1100, in doConstructionShipAI

TypeError: iteration over non-sequence
ERR: Python function AI_unitUpdate failed, module CvGameInterface

This is line 1392 in the version of the file you posted with the sensor station AI.
 
Oops.

If you remove the len() function around self.stations, changing this:

Code:
		for iBuild in len(self.stations):

To this:

Code:
		for iBuild in self.stations:

It should work. (You can't iterate over an integer...)
 
Hi all
I'm slowly but surely merging FF+ and the Babylon 5 mod together but have come up with a few questions that i need answered before i can continue.

1. There are an awful lot of new buildings within FF+ some of which don't fit into the B5 mod, namely the buildings related to the Values. Will i be causing problems for myself if i delete them?

2. At present FF/FF+ supports the following UnitCombatInfos -Recon, Squadron, Light Ship, Capital Ship, Carrier Ship, Starbase and Missile. I would like to add some new UnitCombatInfo's but am concerned that in doing so the custom DLL you have created won't support the ones i want to add. Will there be any conflicts with the DLL if i add, for example Defence, Frigate, Destroyer and Cruiser as UnitCombatInfos?

3.I'm still having a problem with Promotions, in that some units cannot gain some types of Promotions. I thought at first this was down to the UnitCombat choices however adding all UnitCombatType's to any ship seems to make no difference. Adding a PreReqPromotion makes no difference as they still can't take the promotion i want the ship to have. I have been able to add some promotions to units based on the information here Part upgrades mod but this doesn't resolve the problem for all of the promotions. Any suggestions?
 
1. There are an awful lot of new buildings within FF+ some of which don't fit into the B5 mod, namely the buildings related to the Values. Will i be causing problems for myself if i delete them?
I don't think so. As far as I can recall, removing them should have no side effects. (The shrines are the only new value buildings - the regular value related buildings, like the Survival Dome or Stellar Market, are from regular FF.)

2. At present FF/FF+ supports the following UnitCombatInfos -Recon, Squadron, Light Ship, Capital Ship, Carrier Ship, Starbase and Missile. I would like to add some new UnitCombatInfo's but am concerned that in doing so the custom DLL you have created won't support the ones i want to add. Will there be any conflicts with the DLL if i add, for example Defence, Frigate, Destroyer and Cruiser as UnitCombatInfos?
Adding some should not be a problem. Aside from all the places in the XML that they are mentioned that would need to be fixed, I don't think removing any of them would be a problem either - for example, the starbase border effect is done via the bStarbase tag, not the unitcombat. On the other hand those messages that say things like "you have built your first X" could start showing up incorrectly, so you'd have to check the Python as well as the XML when removing one.

3.I'm still having a problem with Promotions, in that some units cannot gain some types of Promotions. I thought at first this was down to the UnitCombat choices however adding all UnitCombatType's to any ship seems to make no difference. Adding a PreReqPromotion makes no difference as they still can't take the promotion i want the ship to have. I have been able to add some promotions to units based on the information here Part upgrades mod but this doesn't resolve the problem for all of the promotions. Any suggestions?

There are probably more limitations and strange things and such than I mentioned. I don't think I actually know them all, but I do know one that wasn't mentioned in the other thread. For example, there is a defined maximum interception chance (in GlobalDefines.xml, MAX_INTERCEPTION_PROBABILITY) that is normally 100. If a promotion would push a unit to have an interception chance over the maximum then evidently it can't take the promotion even though it may show it as available for the unit in the civilopedia (unlike for a promotion that adds collateral damage, which doesn't show up in the civilopedia, for a unit of a unitcombat that is allowed to take it, if the unit can't cause collateral damage). Final Frontier Plus has a problem with this (that nobody has mentioned - maybe nobody has noticed yet). The Q-Squadron unit runs into it since that unit starts with a 75% chance and Interception I gives +10% for 85% and then Interception II would give +20% which would put it at 105% so a Q-Squadron can't take the Interception II promotion even though it shows up as one of its possible promotions in the civilopedia. If I had known that this was the case I would have given it a 70% base interception (like the omega fighter has), but I didn't notice it myself until after my extra content was merged in and haven't remembered to post about it until now.
 
This sounds like you may not be setting "self.bUpdateDisplay = true" everywhere that it should be in CvFinalFrontierEvents.py.

It sets this to False in the __init__ function, then True at the end of onBeginGameTurn() and loadSystemsFromPlots(). These should both be done in your version of the file.

This is used in the onUpdate() event handler to determine if it should call updateSystemsDisplay().

It also directly calls updateSystemsDisplay() near the end of onGameStart(), which is why it doesn't bother to set bUpdateDisplay there. This should also be done in your version.

The updateSystemDisplay() calls the updateDisplay() for the system, as defined in CvSolarSystem.py. This is also used in this file at the end of the createRandomSystem function.

The reason that pulling up the city screen makes the system show is that in the CvMainInterface.py file there is a call to FinalFrontier.updateNeededSystemsDisplay(), and a line that says "pSystem.setNeedsUpdate(true)" which makes that system be updated by the updateNeededSystemsDisplay().
 
Hi God-Emperor and TC01
I have added some new UnitCombatInfo's, namely, Defence, Frigate, Destroyer and Cruiser. I've also done a little work on promotions, but nothing drastic.
Upon loading the game to test it i get an error message as shown below. This is having a knock on effect to other parts of the XML loading process and until i can resolve it i'm going have to revert back to Light Ships or try something else. I'd rather try and resolve the issue as i don't like being beaten by a problem.

Any suggestions?
 
It looks like you have incorrect data in your promotions XML. In particular, it looks like you have switched what goes in the UnitCombatMods and the UnitCombats somewhere (well, line 3160).

The UnitCombatMods sections (which are the modifiers applied when fighting units of the listed unitcombats) have iUnitCombatMod tags, like so:
Code:
			<UnitCombatMods>
				<UnitCombatMod>
					<UnitCombatType>UNITCOMBAT_LIGHT_SHIP</UnitCombatType>
					[B]<iUnitCombatMod>20</iUnitCombatMod>[/B]
				</UnitCombatMod>
			</UnitCombatMods>
The UnitCombats sections (which list what unitcombats can get the promotion) have bUnitCombat tags, like so:
Code:
			<UnitCombats>
				<UnitCombat>
					<UnitCombatType>UNITCOMBAT_RECON</UnitCombatType>
					[B]<bUnitCombat>1</bUnitCombat>[/B]
				</UnitCombat>
				[I]etc...[/I]
The error is saying you have an iUnitCombatMod where it is expecting a bUnitCombat.
 
Thanks God-Emperor, once you told me what the nature of the problem was i managed to track it down to a line a lot further down. i had put </UnitCombatMods/> at the end of a section instead of </UnitCombatMods>. Line 3160 was actually the last good bit before it encountered the problem.
 
This sounds like you may not be setting "self.bUpdateDisplay = true" everywhere that it should be in CvFinalFrontierEvents.py.

It sets this to False in the __init__ function, then True at the end of onBeginGameTurn() and loadSystemsFromPlots(). These should both be done in your version of the file.

This is used in the onUpdate() event handler to determine if it should call updateSystemsDisplay().

It also directly calls updateSystemsDisplay() near the end of onGameStart(), which is why it doesn't bother to set bUpdateDisplay there. This should also be done in your version.

The updateSystemDisplay() calls the updateDisplay() for the system, as defined in CvSolarSystem.py. This is also used in this file at the end of the createRandomSystem function.

The reason that pulling up the city screen makes the system show is that in the CvMainInterface.py file there is a call to FinalFrontier.updateNeededSystemsDisplay(), and a line that says "pSystem.setNeedsUpdate(true)" which makes that system be updated by the updateNeededSystemsDisplay().

That would explain it - I didn't know that onGameUpdate and onUpdate were two different things, so I had disabled the onUpdate callback as I don't use the Astral Gate victory condition (which is the only thing in onGameUpdate).
 
Hi all
Whilst i appreciate all the work you've done to improve FF, could you please tell me where you moved the Barbarian Experience Cap to, it used to e in the XML Global Defines file but now it isn't. Please tell me where it is as the B5 Mod relies on Ships Crews gaining experience(Prestige) from combat rather than technology improving the ships weapons (that comes with Superior ship designs).
Please help.
 
Final Frontier Plus doesn't use a GlobalDefines.xml, it uses a GlobalDefinesAlt.xml which is loaded after the regular global defines so the settings in it override the regular GlobalDefine values that is gets from BtS.

Currently it is not changing the BARBARIAN_MAX_XP_VALUE value. If you add one to GlobalDefinesAlt it will override the value of 10 that is picked up from the regular BtS GlobalDefines.

The value of MAX_EXPERIENCE_AFTER_UPGRADE is currently being changed from the usual 10 to a new value of 15 in GlobalDefinesAlt. You might want to change that too.
 
I'm sure it's still there, but Final Frontier Plus only includes defines that have been changed from the BtS default, so you'll have to copy it in.
Yeah, just as you said Jeelen, thanks.

The value of MAX_EXPERIENCE_AFTER_UPGRADE is currently being changed from the usual 10 to a new value of 15 in GlobalDefinesAlt. You might want to change that too.
I'll be doing that next, thanks for that.

I've come across a small problem when going into the city screen, pictures attached. Python errors 2 is the first error, you have to clear it 15 times before you get to see the Python error 2 and once this is cleared the error messages come back every time you either click to build or change planets. It's bound to be something i've done but as i'm useless with Python i don't know where to begin to start and correct the problem.
 
The first one looks like someething specific to B5, but the second one is from FFP.

BUILDING_PBS is a unique unit version of the commercial satellites. You need to search the Python for it and remove the reference (or keep the building and give it to someone, possibly with some other name than the Public Broadcasting System)

It appears in 3 places in FFP (I thought this would be removed from the mod platform version, but haven't checked).

In CvSolarSystem.py in updateDisplay:
Code:
					# Commercial Satellites or PBS (UB for Brotherhood)
					iCommercialSatellites = gc.getInfoTypeForString('BUILDING_COMMERCIAL_SATELLITES')
					iPBS = gc.getInfoTypeForString('BUILDING_PBS')
					if (pPlanet.isHasBuilding(iCommercialSatellites) or pPlanet.isHasBuilding(iPBS)):

and in CvMainInterface.py in addPlanetCustomization:
Code:
			# Commercial Satellites or PBS (UB for Brotherhood)
			iCommercialSatellites = CvUtil.findInfoTypeNum(gc.getBuildingInfo,gc.getNumBuildingInfos(),'BUILDING_COMMERCIAL_SATELLITES')
			iPBS = CvUtil.findInfoTypeNum(gc.getBuildingInfo,gc.getNumBuildingInfos(),'BUILDING_PBS')
			if (pPlanet.isHasBuilding(iCommercialSatellites) or pPlanet.isHasBuilding(iPBS)):

and in CvPlanetInfoScreen.py in addPlanetCustomization:
Code:
			# Commercial Satellites or PBS (UB for Brotherhood)
			iCommercialSatellites = CvUtil.findInfoTypeNum(gc.getBuildingInfo,gc.getNumBuildingInfos(),'BUILDING_COMMERCIAL_SATELLITES')
			iPBS = CvUtil.findInfoTypeNum(gc.getBuildingInfo,gc.getNumBuildingInfos(),'BUILDING_PBS')
			if (pPlanet.isHasBuilding(iCommercialSatellites) or pPlanet.isHasBuilding(iPBS)):

What it is doing in all 3 places is identical, although in the first one it uses the superior gc.getInfoTypeForString() instead of CvUtil.findInfoTypeNum(). This is in the code that checks to see if it should add the graphics for the orbiting satellites to the planet.

You should be able to chenge all of these to be this (give or take the correct indentation):
Code:
					# Commercial Satellites
					iCommercialSatellites = gc.getInfoTypeForString('BUILDING_COMMERCIAL_SATELLITES')
					if pPlanet.isHasBuilding(iCommercialSatellites):
 
Following on from your previous response, i've corrected what needed correcting but i now get the error shown below when changing planets in the city screen. I managed to find only one of the three files mentioned and even then didn't really understand what i was looking for. Any ideas?
 
Back
Top Bottom