Star Trek Mod II: The Wrath of Mod

Good question JELEEN. It would be kind of nice to know however, even with the current issues.
 
In FFP the city's "base yield rate" is overridden in the Python. Because of this, things like specialists that change the base yield rate end up being ignored. When a specialist is added to a city it modifies the various yield rates as appropriate for its type, but the changes are then wiped out by the Python which sets it to what it wants it to be every turn.

This should not affect anything that is a commerce (credits, research, influence, espionage), just the yields (food, production, and commerce).

You can fix this by adjusting the Python to take the specialists into account.

In FinalFrontierEvents.py there is a function called updatePlotYield. At the end of this function is a loop over the 3 yield types where it sets the base yield rate for each. Inside that loop you could add the yield from specialists for that yield type by looping over all the specialist types, multiplying the number of free specialists of that type by the amount of yield they give for that player.

OK, so this is (I think - not tested) the code for the adjusted loop, new code in bold dark red text:
Code:
				for iYieldLoop in range(3):
					[B][COLOR="DarkRed"]// G-E: Add in the effects of free specialists
					for iSpecialist in range(gc.getNumSpecialistInfos()):
						aiSystemYield[iYieldLoop] += pPlayer.specialistYield (iSpecialist, iYieldLoop) * pCity.getFreeSpecialistCount(iSpecialist)[/COLOR][/B]

					pCity.setBaseYieldRate(iYieldLoop, aiSystemYield[iYieldLoop])
					printd("  Setting City Base Yield %d to %d" %(iYieldLoop, aiSystemYield[iYieldLoop]))

That should get the free specialists adding their yields into the totals. It should also cover any settled great people since they should also be in the list of specialist types. Give it a try and let me know.

I gave it a try pasting the red lines in that place in the file and ended up with this



No solar system, no planets, crazy high score and the warning on the top of the screen.
Sorry it took so long to get back, I uh kinda forgot to check here after a while.
 
The "//" to start the comment should be "#". (Oops, wrong language.)

changed to the hashtag and got the same thing, this is what I have in that text block.

Code:
if (iOwner != -1):
			if (pPlot.getFeatureType() == self.iFeatureIDSolarSystem):
			
				pPlayer = gc.getPlayer(iOwner)
				pSystem = getSystemAt(pPlot.getX(), pPlot.getY()) #FFPBUG
				aiSystemYield = [0,0,0]
				iLunarBase = gc.getCivilizationInfo(pPlayer.getCivilizationType()).getCivilizationBuildings(gc.getInfoTypeForString("BUILDINGCLASS_LUNAR_BASE")) # This civ's lunar base
				printd("Updating Yield for %s" %(pCity.getName()))

				#Final Frontier Plus:
				#	These numbers are calculated in the DLL for buildings, traits, trait/trade routes, and trade routes
				#	I originally wanted to set this value there and then just add the planet stuff here, but that didn't work because of the Forge...
				if pCity.getFoodOverride() != 0:
					aiSystemYield[0] += pCity.getFoodOverride()
				if pCity.getProductionOverride() != 0:
					aiSystemYield[1] += pCity.getProductionOverride()
				if pCity.getGoldOverride() != 0:
					aiSystemYield[2] += pCity.getGoldOverride()
					
				printd("	Food override = %d" % (aiSystemYield[0]))
				printd("	Production override = %d" % (aiSystemYield[1]))
				printd("	Commerce override = %d" % (aiSystemYield[2]))
				
				#Planet yield stuff, does have to be done manually (unlike everything else...)
				for iPlanetLoop in range(pSystem.getNumPlanets()):
					pPlanet = pSystem.getPlanetByIndex(iPlanetLoop)
					printd("  Planet at Ring ID %d" %(pPlanet.getOrbitRing()))
					for iYieldLoop in range(3):					
						if ((iYieldLoop == 0) and pPlanet.isHasBuilding(iLunarBase)): # CP - 0 == food; lunar base adjustment
							iPop = min((pPlanet.getPopulationLimit(iOwner) - 1), pPlanet.getPopulation())
						else:
							iPop = pPlanet.getPopulation()
						iValue = (pPlanet.getTotalYield(iOwner, iYieldLoop) * iPop)
						aiSystemYield[iYieldLoop] += iValue
						printd("    Yield %d Value: %d" %(iYieldLoop, iValue))
					
				for iYieldLoop in range(3):
					# G-E: Add in the effects of free specialists
					for iSpecialist in range(gc.getNumSpecialistInfos()):
						aiSystemYield[iYieldLoop] += pPlayer.specialistYield (iSpecialist, iYieldLoop) * pCity.getFreeSpecialistCount(iSpecialist)

					pCity.setBaseYieldRate(iYieldLoop, aiSystemYield[iYieldLoop])
					printd("  Setting City Base Yield %d to %d" %(iYieldLoop, aiSystemYield[iYieldLoop]))
 
I didn't even notice that the error was not in that code - I just assumed the error was the one I knew about in the code I posted.

It is talking about an error occurring in calculateScore, which is in FinalFrontierGameUtils.py.

Do you have Python error pop-up enabled? Or error logging? If you have the pop-ups you should be getting at least one each time that error happens - this can be handy to have. If you have error logging enabled then there should be a PythonErr.log file in the My Games/Beyond the Sword/Logs folder with the text of the Python errors in it. Either of these could point to to the line (give or take 1) of Python that has the problem.

The calculateScore function prints some things into PythonDbg.log. You can check to see what, if anything, is making it into there. The last thing that function does before returning the score is some printing and there are several others. If any of that output is missing you know that the error happened after the last thign printed but before or during the first line of output that is missing.
 
I didn't even notice that the error was not in that code - I just assumed the error was the one I knew about in the code I posted.

It is talking about an error occurring in calculateScore, which is in FinalFrontierGameUtils.py.

Do you have Python error pop-up enabled? Or error logging? If you have the pop-ups you should be getting at least one each time that error happens - this can be handy to have. If you have error logging enabled then there should be a PythonErr.log file in the My Games/Beyond the Sword/Logs folder with the text of the Python errors in it. Either of these could point to to the line (give or take 1) of Python that has the problem.

The calculateScore function prints some things into PythonDbg.log. You can check to see what, if anything, is making it into there. The last thing that function does before returning the score is some printing and there are several others. If any of that output is missing you know that the error happened after the last thign printed but before or during the first line of output that is missing.

There is the error file from Python, I have the feeling I found the error though and will PM you.

*Update!*
So I fixed the slight file extension problem and it did start up quite right with the added code and I will see what happens with the Hammers as I play again.
 

Attachments

  • PythonErr.txt
    8.3 KB · Views: 201
Well it seems that addition got the bonus influence from the Engineering core going and the bonuses from the specialists to apply properly now, so cheers man!
 
Hey guys! So Sorry I've been Awol For I think almost a year now. Yes, It is true. I would say I cannot continue on this anymore as much as I'd really like too. I'm working full time on a game right now called Word Wrecker.

But all the work on it is there between the two Beta Builds (4g and 3h) which is all open sourced and available here.

http://www.legendarypower.com/stm2.html

If anyone wants to pick up the mantle and do a Star Trek Mod III (may I suggest "the search for mod" as a title?), Please do! Thanks everyone who has been playing it!
 
As a big fan of Birth of the Federation, i specially bought civ4 on steam to be able to play this.
I am however unable to capture any cities.
Killing the defending ships is no problem, but actually moving a ship on the city tile and capturing does not work.
Is there some ruleset to this that I am missing?
 
As a big fan of Birth of the Federation, i specially bought civ4 on steam to be able to play this.
I am however unable to capture any cities.
Killing the defending ships is no problem, but actually moving a ship on the city tile and capturing does not work.
Is there some ruleset to this that I am missing?

I think it is a setting, that if selected you can only capture cities with planetary assault craft. What that counts as in this mod without explicit planetary assault craft, but the option is still there and I have wondered what happens if you select it.
 
I have a question of anyone is still watching this and may know.. how do I get cloaked enemy units out of my cities? How are they allowed in, is there a building that can get them out?
 
@Knighthawk - Did you ever get an answer for your question?

I have one of my own: I'm trying to increase the map size for 'Huge'; I've changed the GridWidth and GridHeight in Civ4WorldInfo.xml to 64 and 40 respectively (keeping that oh-so-necessary 8:5 ratio) but there has been no change at all in map sizes generated. What's going on with that?
 
so knighthawke i see you found a fix for the event bug and specialist thing. could you please post what you did so others can fix it? this mod desnt seem to hae been updated with your input yet so it would be nice to have a fix.
 
so knighthawke i see you found a fix for the event bug and specialist thing. could you please post what you did so others can fix it? this mod desnt seem to hae been updated with your input yet so it would be nice to have a fix.

And message me with any bug fixes too, I'll add them to the official release.

Btw, thanks for playing this mod guys, I'm hoping when civ6 comes out to do a new star trek mod for that. :)
 
This Mod is a must HAVE ! Is there anything new ? May a final coming out ?
 
So... When's the next release ?
 
And message me with any bug fixes too, I'll add them to the official release.

Btw, thanks for playing this mod guys, I'm hoping when civ6 comes out to do a new star trek mod for that. :)
I missed that, I got the itch to play it again, if I can recreate it I will post it here. I will need to play with the game and find the errors again. I know one problem was I saved a file under the wrong extension after fixing something. Sorry for the slight delay.
 
so Knighthawke i see you found a fix for the event bug and specialist thing. could you please post what you did so others can fix it? this mod desnt seem to have been updated with your input yet so it would be nice to have a fix.
The code provided in the first post provided by God-Emperor added into that file fixes the issue, Use notepad ++ and make sure to change the // into a #, don't add in the BBcode for the color, make sure the existing line in that range below is still there and unchanged.

My initial mistake was using the wrong program and changing the file extension.

It didn't fix the heads of the specialists being in the wrong place, but they function.
 
Top Bottom