Modmodding Q&A Thread

Italy is a normal civ.

Except that they spawn once in maybe 10 games before 1800 :mad:. Italy is always controlled by Byzantines, France, or Germany. And of course sometimes, Poland or Tibet.

Spoiler :
and in a youtien game, the Mayans
 
Most of us tend to be disappointed upon winning the game with a late-spawning civ and still get compared to Dan Quayle. However, I saw this page explaining the mechanics behind the scoring system and immediately thought of a way to compensate the latecomers.

So far, RFC and all derivative modmods still rely on the original scoring system in CvUtil.py, and none of them has edited it. Here's my attempt to correct said flaw:

Code:
#import the array containing the spawn dates of individual civs
import Consts as con 
import RFCUtils
utils = RFCUtils.RFCUtils()

Then, at getScoreComponent():

Code:
if bFinal and bVictory:
	[B]iHumanSpawnTurn = getTurnForYear(con.tBirth[utils.getHumanID()])[/B]
	fTurnRatio = float(gc.getGame().getGameTurn() [B]- iHumanSpawnTurn[/B]) / float(gc.getGame().getEstimateEndTurn() [B]- iHumanSpawnTurn[/B])
	if bExponential and (iInitial != 0):
		fRatio = iMax / iInitial
		iMax = iInitial * pow(fRatio, fTurnRatio)
	else:
		iMax = iInitial + fTurnRatio * (iMax - iInitial)

This, however, doesn't get into account starting with different scenarios. In the formula, is the scenario's starting year taken into account when calculating the score, or does it presume 3000 BC as Turn 1 at all times? The calculations could go wrong when playing as a civ that spawned way before the scenario started if scores from 3000 BC games are treated differently from 600 AD games.

Also, since this fix is intended for all RFC-based modmods, this does not take into account playing as reborn civs (Italy, Iran, Colombia and Mexico), which is a concept unique to DoC.
That looks good so far. Actually I'm not sure how it factors in the scenario start turn, and that appears to be a legitimate question for late starting scenarios in general.

I don't have the mod files on hand right now so I can't check.
 
How do I make all Mongol units start out with the morale promotion?
I done a lot of python/xml editing for a long time with... notepad. What do serious modders use?
 
Binary
 
How do I make all Mongol units start out with the morale promotion?
I done a lot of python/xml editing for a long time with... notepad. What do serious modders use?

That would involve editing (and recompiling) the DLL. The unique powers of Spain, Portugal, Korea and (formerly) England, which involved free promotions for their naval units, were programmed through it.
 
If you would do it elegantly, it would require editing and recompiling the DLL.

You could also give all Mongol LH a hidden trait which gives the morale promotion to each unit. This requires only XML.
 
How do I make all Mongol units start out with the morale promotion?
I done a lot of python/xml editing for a long time with... notepad. What do serious modders use?
I use Notepad++.

And merijn is right, your probably better off making a trait for this. The DLL solution is in CvUnit::init(), look for the Spanish UP.

A magnetized needle and a steady hand.
real_programmers.png
 
I'm suffering from the city ruins problem as Venice. However, it only lasts for ~7 turns then goes away. How do you fix it?
 
C++?

Yeah because it's just extremely frustrating if you've been modifying a very large amount of the RiseandFall.txt and you make one small typo and the whole script is broken and everyone spawns with stoneage techs and no events.

Same for editing the world map as well. I edit stuff on worldbuilder, delete the starting units, copy and paste the terrain files on Notepad to the originalfile. Of course this is extremely timeconsuming.
 
What are you asking with C++? Unless you like calling gcc manually, you should have an editor for that already. Visual Studio has syntax highlighting and error detection.
 
I'm having one or two problems with Venice, but I think it won't be to hard to fix them, I just need to be pointed in the right direction.

The stability display is messed up. The core territory displays properly, but it displays the Historical, Contested, and UHV territories as Roman territories. Where would I go to fix that?

Second, the Venice flag is just displaying Red in-game, but in the Civilopedia and other stuff, it displays normally. Is that because it has more than 2 colors?
 
Does your Venice replace Rome? Or Italy (and it in fact shows Italian tile stability in the tool tip)? If that is the case, you likely haven't changed their stability maps yet. CvRhyes.cpp in case you forgot.

Flags and buttons are two different things. Have you created a separate Venetian flag yet?
 
Does your Venice replace Rome? Or Italy (and it in fact shows Italian tile stability in the tool tip)? If that is the case, you likely haven't changed their stability maps yet. CvRhyes.cpp in case you forgot.

It replaces Rome, and displays the areas such as "Spain", "France", etc...

Flags and buttons are two different things. Have you created a separate Venetian flag yet?

I fixed the second one on my own.
 
It replaces Rome, and displays the areas such as "Spain", "France", etc...
The UHV tool tips are in Python\Screens\CvScreenInterface.py. I don't recall what the responsible method is called, but searching for iRome and just commenting out the following lines should work.

Searching for the iRome constant all over the mod files is probably a good idea in general, so you can see if the code that references it still makes sense now that it represents Venice.

I fixed the second one on my own.
Does that mean you've fixed that problem? Otherwise I don't know what you mean.
 
The UHV tool tips are in Python\Screens\CvScreenInterface.py. I don't recall what the responsible method is called, but searching for iRome and just commenting out the following lines should work.

Searching for the iRome constant all over the mod files is probably a good idea in general, so you can see if the code that references it still makes sense now that it represents Venice.

I've fixed nearly everything. The UHV goal areas don't display anymore, but the wrong territory still does.


Does that mean you've fixed that problem? Otherwise I don't know what you mean.

Yeah, not a problem anymore.
 
I've fixed nearly everything. The UHV goal areas don't display anymore, but the wrong territory still does.
Did you change their stability map in CvRhyes.cpp? Are you sure it compiled successfully?
 
Did you change their stability map in CvRhyes.cpp? Are you sure it compiled successfully?

No, I forgot about it and fixed it. Thanks!
 
Awesome.
 
Back
Top Bottom