Quick Modding Questions Thread

where do i find the py tool that came with the game?
 
1) I put all C2C terrain and map scripts and its work :D and put more terrain from Future mod and map scripts from Future mod and all work fine. If i want to put some another terrain in map script i must edit C2C_Fractal.py for example, I want put NEW_LUNAR_TERRAIN, what i must to do in C2C_Fractal.py?

2) I want to put new river (BTS river + My river). How is this possible?
 
2) what's the difference between the rivers?


it was mislabelled on my keyboard ¦ and | had swapped positions

o_O what?
...and you didn't change anything? Just the wrong key?

where do i find the py tool that came with the game?

Slight missunderstanding: There isn't.
When Refar said that Python is integrated, then he meant the game's ability to read the Python files. He did not mean that there is an editor included.
For the "normal" editor you would have to download Python (free, and not a big download) and install it. But it's essentially also only a fancy text editor, so you should not really expect anything special.

...and what do you want to do? I guess you have something which you need to have programmed.
 
There is a similar thread by tesb here (he looks for hills, but the basic problem is the same - alternate graphics for the same terrain) - He's probably right about this being a SDK job, and i have no idea, if there is maybe such a modcomp already around somewhere. Maybe together you have better chances to find something.
 
WOW I am quoted as a modding example!! I am practically a modder!!

You do it through this attached file(I think, it has been awhile since I did it and I can't exactly remember), you can find it in python/entrypoints

I attached mine so you can have a look, from about line 150 I think is where I made the changes. Most of it is trial and error, I think some lines don't affect anything, as far as I can tell..

GUI/HUD Tutorial
This is the where I started learning from, then it was a lot of digging around to learn the other bits.

Spoiler :
screen.addDDSGFC( "InterfaceTopLeftBackgroundWidget", 'Art/Interface/Screens/screen.tga', 258, 0, xResolution - 516, 189, WidgetTypes.WIDGET_GENERAL, -1, -1 )
screen.addDDSGFC( "InterfaceTopLeftBackgroundWidget", 'Art/Interface/Screens/screen.tga', 258, 0, xResolution - 516, 189, WidgetTypes.WIDGET_GENERAL, -1, -1 )
screen.addDDSGFC( "InterfaceCenterLeftBackgroundWidget", 'Art/Interface/Screens/screen.tga', 0, 0, 308, yResolution-149, WidgetTypes.WIDGET_GENERAL, -1, -1 )
screen.addDDSGFC( "InterfaceCenterRightBackgroundWidget", 'Art/Interface/Screens/screen.tga', xResolution - 298, 0, 298, yResolution-149, WidgetTypes.WIDGET_GENERAL, -1, -1 )
screen.addDDSGFC( "CityScreenTopWidget", 'Art/Interface/Screens/screen.tga', 0, -2, xResolution, 41, WidgetTypes.WIDGET_GENERAL, -1, -1 )
screen.addDDSGFC( "CityNameBackground", 'Art/Interface/Screens/screen.tga', 260, 31, xResolution - (260*2), 38, WidgetTypes.WIDGET_GENERAL, -1, -1 )
screen.addDDSGFC( "InterfaceCenterBackgroundWidget", 'Art/Interface/Screens/screen.tga', 276, yResolution - 143, xResolution - (276*2), 143, WidgetTypes.WIDGET_GENERAL, -1, -1 )
screen.addDDSGFC( "InterfaceLeftBackgroundWidget", 'Art/Interface/Screens/screen.tga', 0, yResolution - 178, 304, 178, WidgetTypes.WIDGET_GENERAL, -1, -1 )
screen.addDDSGFC( "InterfaceRightBackgroundWidget", 'Art/Interface/Screens/screen.tga', xResolution - 324, yResolution - 178, 324, 178, WidgetTypes.WIDGET_GENERAL, -1, -1 )
screen.addDDSGFC( "InterfaceTopCenter", 'Art/Interface/Screens/screen.tga', 237, -2, xResolution-(237*2), 60, WidgetTypes.WIDGET_GENERAL, -1, -1 )
screen.addDDSGFC( "InterfaceTopLeft", 'Art/Interface/Screens/screen.tga', 0, -2, 287, 60, WidgetTypes.WIDGET_GENERAL, -1, -1 )
screen.addDDSGFC( "InterfaceTopRight", 'Art/Interface/Screens/screen.tga', xResolution - 287, -2, 287, 60, WidgetTypes.WIDGET_GENERAL, -1, -1 )


That is what the code looks like for adding a picture to a part, like my computer screens in the city screen and civilopedia. Again it is a bit of trial and error as to what changes what. You will see the code more clearly in the file at around line 150-152 something like that..

The Tutorial should teach you where you need to go to change fonts and box colours.

If I remember rightly...
 

Attachments

  • CvMainInterface.rar
    20.8 KB · Views: 52




Ok so I got these two error messages, but I cannot understand why... I am fairly certain I understand what it is telling me, but I can find no issue with it...

All I have done is copied these from Civ to my K-mod based folder, I have not even modified the lines that it is referring to, and K-mod does not have it's own version, so it should have been referring to these files anyway, so it can't be a compatibility issue?!?

I am just thoroughly confused...anyone have any thoughts?

EDIT: Ok it seems to be an issue with the Civ4 bonus file, but I cannot find an up to date one, as in there is not one in the BTS folder, was it updated with warlords? I just can't figure out the issue, but if i use the standard Civ4 one it throws a fit and crashes...

Edit2: ok yes it seems to be a warlords updated version that I needed :)
 
In my mod I've changed CivicPercentAnger for State Property and now the whole world is communistic! As in vanilla only one civic has the bonus (Emancipation), AI was programmed to value the bonus way too high (value of the CivicPercentAnger itself is 5000+, while value of the whole second best option is usually less than 900). In CvPlayerAI.cpp I've found two instances of CivicPercentAnger:
Spoiler :
Code:
iValue += (getCivicPercentAnger(eCivic) / 10);
Code:
	if (kCivic.getCivicPercentAnger() != 0)
	{
		int iNumOtherCities = GC.getGameINLINE().getNumCities() - getNumCities();
		iValue += (30 * getNumCities() * getCivicPercentAnger(eCivic, true)) / kCivic.getCivicPercentAnger();
		
		int iTargetGameTurn = 2 * getNumCities() * GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGrowthPercent();
		iTargetGameTurn /= GC.getGame().countCivPlayersEverAlive();
		iTargetGameTurn += GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGrowthPercent() * 30;
		
		iTargetGameTurn /= 100;
		iTargetGameTurn = std::max(10, iTargetGameTurn);
		
		int iElapsedTurns = GC.getGame().getElapsedGameTurns();

		if (iElapsedTurns > iTargetGameTurn)
		{
			iValue += (std::min(iTargetGameTurn, iElapsedTurns - iTargetGameTurn) * (iNumOtherCities * kCivic.getCivicPercentAnger())) / (15 * iTargetGameTurn);
		}
	}
I would appreciate it, if someone would offer a solution and (what is more important for me) tell me why there are two instances. I would like to make the formula simpler, but I don't want to omit anything important.
 
Does anyone now how to define unit action button art. Such as Fortify.

Civ4CommandInfos.xml controls the references to Commands and Civ4MissionInfos.xml controls references to Missions. In particular, Fortify is a mission.
 
Civ4CommandInfos.xml controls the references to Commands and Civ4MissionInfos.xml controls references to Missions. In particular, Fortify is a mission.

Where is the 'go to' button definiton found? I think I have found all the others but me thinks this one is hiding! :)
 
I have no idea, but I'd say that it's probably MISSION_MOVE_TO in the MissionInfos.xml.
Since there's no button given, I'd try to add the missing parts (see lower in the file, other missions have more entries; they are all optional) and change the button in there.

I would like to make peaceful vassalization a lot harder. Where can I find a piece of code which determines AI behaviour about that?

LeaderheadInfos.xml, values for VassalRefuseAttitudeThreshold, iVassalPowerModifier and iFreedomAppreciation.
 
It's all in the modiki ;).
And since I thought that the value for 2 was for 3, and didn't know 2, I had to look it now up myself :blush:.
#1 Civ will not become a vassal, unless attitude is the one mentioned in the file or better
#2 The resistance a leader has against becoming a vassal
(and #3 is only for colonies)
 
It's Units\Civ4BuildInfos.xml - i think technically what you unlock are worker jobs, not the improvements themself.
 
right have i just lost my senses?

i just added a new building, but it is not appearing, i have added it to building and buildingclass files the art is defined, and the text is defined.....Have I just completely forgotten a step somewhere???

EDIT: AHA! Found it i had accidentally double copied the infos closing line for the whole file so it was defined after the end of the file!
 
Top Bottom