Quick Modding Questions Thread

Changing names and icons is about it, I also need to change the Civilopedia entry to reflect the change

Does an example help? Because we have this small mod here, which only adds a religion.

If not: Names and civilopedia entries are in the XML\GameInfo\ReligionInfo.xml, and these are again references to entries in the XML\Text folder.
For the icons: There are 2 types.
The easy one is the button, which is also referenced in the ReligionInfo.xml. You will need a grey button (for the case the religion is not yet founded), which has to be in the same place, and needs to have the same name, with a _d attached (e.g. shinto.dds and shinto_d.dds).
The others are in the Assets\res\fonts\gamefont.tga. These symbols have to be in the same order like in the XML, first the religions, then the corporations.
Don't edit that file by hand, do it with this tool.

In case that's too fast, then post again (sorry, it's morning and I have to leave for work in a few minutes).

So changing the barbarians name would be just like changing any other civs name?

:yup:
 
Does an example help? Because we have this small mod here, which only adds a religion.

If not: Names and civilopedia entries are in the XML\GameInfo\ReligionInfo.xml, and these are again references to entries in the XML\Text folder.
For the icons: There are 2 types.
The easy one is the button, which is also referenced in the ReligionInfo.xml. You will need a grey button (for the case the religion is not yet founded), which has to be in the same place, and needs to have the same name, with a _d attached (e.g. shinto.dds and shinto_d.dds).
The others are in the Assets\res\fonts\gamefont.tga. These symbols have to be in the same order like in the XML, first the religions, then the corporations.
Don't edit that file by hand, do it with this tool.

In case that's too fast, then post again (sorry, it's morning and I have to leave for work in a few minutes).



:yup:

Okay so I think I have this all figured out, just one more thing. How do I make the background on the religion images transparent? I have a white background behind the images that I need to get rid of.
 
The alpha channel of the buttons have to be white, and you have to save them as DDS DXT3, then it should work.
If you have no clue what I'm talking about: Tutorials for buttons can be found here and here.

Okay I did that, didn't work. I still keep getting the white background even with a white alpha channel and saving as DDS DXT3 with DXTBmp. I tried it with a .png and a .bmp file and both still gave me a white background
 
*facepalm* sorry, dumbness from my side: The alpha channel needs to be transparent, which means totally black (DXTBmp will show that as white if you reopen the button, therefore that screwup).

Okay I made the alpha channel black, and now the image won't even appear in the game. I tried it with the same two image types and it doesn't work
 
Don't make the entire image's alpha channel black or it will all be transparent (and therefore be completely invisible). Just the parts you want to be transparent should have a black alpha channel, the rest should be white (you can maybe make a pixel here and there be gray if you want a blended edge or something).

(It is black = transparent and white = visible because it is actually the level of opacity. Black = 0 opacity and 0 opacity is the same as full transparency. White = 255 opacity and that is as opaque as you can get since it is an 8 bit unsigned integer that only goes up to 255 for each channel.)
 
Don't make the entire image's alpha channel black or it will all be transparent (and therefore be completely invisible). Just the parts you want to be transparent should have a black alpha channel, the rest should be white (you can maybe make a pixel here and there be gray if you want a blended edge or something).

(It is black = transparent and white = visible because it is actually the level of opacity. Black = 0 opacity and 0 opacity is the same as full transparency. White = 255 opacity and that is as opaque as you can get since it is an 8 bit unsigned integer that only goes up to 255 for each channel.)

Okay thank you, I managed to get the images to actually work.

Thanks both of you for your help
 
Hello,

how can i change the background picture (the globe) to my own creation?

Thank you.
greetings
MM
 
I don't know what's out there now but that's a really good idea in general I think! Why should your bombarding units be left out of the experience loop anyhow right? You've inspired a C2C project. Thanks Spi't!
hey guys just incase anyone wanted it, here is the code for range combat expeirience from Realism Invictus, if anyone ever takes this to the next level and makes the experience defineable in more detail, like wound and kill or anything like that I would love to know about it!

Unit.cpp
Spoiler :

Code:
	//set damage but don't update entity damage visibility
	pDefender->setDamage(iUnitDamage, getOwnerINLINE(), false);

[COLOR="Red"]	// MOD - START - Ranged Combat Experience
	// Note: Ranged attacks provide the same amount of experience as a withdrawl
	changeExperience(GC.getDefineINT("EXPERIENCE_FROM_WITHDRAWL"), pDefender->maxXPValue(), true, pPlot->getOwnerINLINE() == getOwnerINLINE(), !pDefender->isAnimal());
	// MOD - END - Ranged Combat Experience[/COLOR]

	if (pPlot->isActiveVisible(false))
	{
		// Range strike entity mission
		CvMissionDefinition kDefiniton;
		kDefiniton.setMissionTime(GC.getMissionInfo(MISSION_RANGE_ATTACK).getTime() * gDLL->getSecsPerTurn());
		kDefiniton.setMissionType(MISSION_RANGE_ATTACK);
		kDefiniton.setPlot(pDefender->plot());
		kDefiniton.setUnit(BATTLE_UNIT_ATTACKER, this);
		kDefiniton.setUnit(BATTLE_UNIT_DEFENDER, pDefender);
		gDLL->getEntityIFace()->AddMission(&kDefiniton);
 
Hello,

how can i change the background picture (the globe) to my own creation?

Thank you.
greetings
MM

To something static (-> image)?
Go to the Next War folder.
Copy the folder Assets\Art\Interface\Main Menu to your mod (same folder structure of course).
Copy the file XML\Art\CIV4MainMenus.xml to your mod.
Go back to the Main Menu folder, and replace the Next_War_Main_Menu.dds with whatever image you want to have (in .dds format).


Where i can edit images for eras? I think on image, which appear on screen when you enter in that era.

I'm not sure where they are linked, but the images are .dds files, which are located in Art\movies\era, and follow the scheme Era00-Ancient.dds, Era01-Classical.dds, and so on (number +1 plus name of era).
Creating such a file at the right path in your mod will override the default files.
 
hey guys just incase anyone wanted it, here is the code for range combat expeirience from Realism Invictus, if anyone ever takes this to the next level and makes the experience defineable in more detail, like wound and kill or anything like that I would love to know about it!

Unit.cpp
Spoiler :

Code:
	//set damage but don't update entity damage visibility
	pDefender->setDamage(iUnitDamage, getOwnerINLINE(), false);

[COLOR="Red"]	// MOD - START - Ranged Combat Experience
	// Note: Ranged attacks provide the same amount of experience as a withdrawl
	changeExperience(GC.getDefineINT("EXPERIENCE_FROM_WITHDRAWL"), pDefender->maxXPValue(), true, pPlot->getOwnerINLINE() == getOwnerINLINE(), !pDefender->isAnimal());
	// MOD - END - Ranged Combat Experience[/COLOR]

	if (pPlot->isActiveVisible(false))
	{
		// Range strike entity mission
		CvMissionDefinition kDefiniton;
		kDefiniton.setMissionTime(GC.getMissionInfo(MISSION_RANGE_ATTACK).getTime() * gDLL->getSecsPerTurn());
		kDefiniton.setMissionType(MISSION_RANGE_ATTACK);
		kDefiniton.setPlot(pDefender->plot());
		kDefiniton.setUnit(BATTLE_UNIT_ATTACKER, this);
		kDefiniton.setUnit(BATTLE_UNIT_DEFENDER, pDefender);
		gDLL->getEntityIFace()->AddMission(&kDefiniton);

Well, I already took withdrawal experience to another level in C2C and it's now based on a base number (such as it is in your example) modified by the odds of withdrawal (more difficult withdrawal = more experience and vice versa).

Very simple really, just add this function:
Code:
int CvUnit::getExperiencefromWithdrawal(int iWithdrawalProbability)
{
	int iExpBase = GC.getDefineINT("EXPERIENCE_FROM_WITHDRAWL");

	int iInversePercentage = 100 - iWithdrawalProbability;

	int iExperienceTotal = (iExpBase * iInversePercentage)/100;

	return (std::max(1, iExperienceTotal));
}
And replace all other references to "GC.getDefineINT("EXPERIENCE_FROM_WITHDRAWL"):
with a call to getExperiencefromWithdrawal(oddsofwithdrawalvariable)

When I do decide to move on the quick project to enact some experience from bombard, I'd have to figure out what the 'odds' value would stem from (I believe there's an accuracy check for a lot of types of bombardment in our mod) but that method you showed is quite easily done, yes. Thanks for sharing that though... helps to see what other modders have come up with when going about a project.

There's a number of places in C2C that would utilize something along these lines, including Archery bombard. I'd also like to review and ponder whether it should be awarded for bombardment against city defenses, even though its an auto-hit procedure (maybe just 1 exp in such a case based on a Global value... but even that seems a bit much... I dunno yet.)
 
yeah, someone has made a bombard experience mod in the modcomps, but range combat is a big part of my fallout mod, as both guns and melee have to be vaible combat choices right the way through the game (just as in the fallout games) so getting experience from ranged attacks was a must! We experimented trying to modify the code to do a few more things, like not award exp if no damage was done, but we were unable to get the effect to change from it's starting form. (But this is a lot better than nothing so I am happy)
 
Top Bottom