Quick Modding Questions Thread

Thanks for that. I'll do some experiments on what frequency will suit.
 
In M:TW, when spies completed missions successfully they gained experience and their next mission was easier. Is this possible to do ? or will it require a DLL change to give spies an experience value.
 
NECROMANCY!!! :lol::satan::evil:

In "void CvPlayer::foundReligion(ReligionTypes eReligion, ReligionTypes eSlotReligion, bool bAward)", what do eSlotReligion and bAward do?
 
NECROMANCY!!! :lol::satan::evil:

In "void CvPlayer::foundReligion(ReligionTypes eReligion, ReligionTypes eSlotReligion, bool bAward)", what do eSlotReligion and bAward do?

bAward means whether the player receives the free units defined in the religion info.

For the slot religion see here.
 
So it would work to just make it the same as eReligion? If your mod had no choose religions option?
 
Hi all,

I am thinking of adding legendary Heros, such as King Arthur and so on, basically greatly upgraded versions of particular units, in this case for example it would be a swordsman.

I was wondering if anyone could tell me how I could make this happen, I considdered making them great people, as one would imagine, but I want to make it so only one can ever exist, if this is possible.

Then I thought about making it a free unit when a tech is discovered, but that is very very dodgy, as there is no way of knowing if you will get the tech before someone else.

If anyone could help me I would be much apreciative.
 
Anything along these lines would of course be possible. You might need to know programming though. Do you know any?
 
Sadly I am only competant with editing XML, what sort of coding would I need to learn and how hard is it?

Thanks
 
Programming is not as easy as some XML editing, but not as hard as you'd think it is. You might get away with learning some Python scripting - otherwise its "real" C++ coding.

You should be able to do a lot with XML modding though. Someone else should be able to guide you.
 
I believe I have thought of a work around, if its possible to have civ specific 'random events' whereby the unit could be created in the capital after a certain event, such as discovery of a tech or a certain number of turns.

Eg,

Elizabeth discovers monarchy, kicking off the event which creates the unit in the capital, but not for the other civs.
 
There are some mods that have buildable "Legands", which are similar to your heros.

Programming is not as easy as some XML editing, but not as hard as you'd think it is. You might get away with learning some Python scripting - otherwise its "real" C++ coding.

C++ isn't actually that hard. It would be fairly easy to add some tags to CvUnitInfo to make your "Heros", but that would require C++.

You really should learn programming. Baldyr's right, it isn't that hard. I recommend reading 'Head First Programming'. Then look at one of the many tutorials on this forum.

For C++, start by reading 'Head First Java'. Java is almost indistinguishable from C++, so Java knowledge is really helpful. After that, xienwolf's tutorial on SDK is really good.

Some good code for your 'Heros' would look like this. (At the end of unitinfos)
Code:
<bHero>1</bHero>
<Civilizations>
   <Civilization><CIVILIZATION_ENGLAND</Civilization>
</Civilizations>
<Event>EVENT_HEROARTHUR</Event>
The Event would be a C++ callable only event that would trigger the creation of Arthur. If would be defined in EventInfos.
 
Is it possible to use some of the "Colonisation" graphics and artworks like buildings and terrain (maybe not units) etc, into Civ 4 BTS. This may add a little more flavour to my mod.
 
one maybe quick to answer question by me:

i want to add a build requirement that only a certain trait can build a building / unit.

how to do it?

e.g. only aggressive can build barracks.

i must admit i havent had any experience with dll-Editing so far and hope it's only 2 or 3 lines of change :D
 
Restricting a building to require a trait doesn't need DLL modifications, you can do it in Python.
Advantage: a lot easier to do unless you are already set up to make DLL modifications
Disadvantage: can slow down the game (probably very little in this case)

In CvGameUtils.py the CvGameUtils class has a method called cannotConstruct. This callback is used to disallow the production of a building that the normal checks indicate can be built. In there you can check to see if the building being tested is the barracks and if it is then you can check to see if the player has the desired trait - if not you return True to make the building unbuildable.

Something like this (untested):
Code:
	def cannotConstruct(self,argsList):
		pCity = argsList[0]
		eBuilding = argsList[1]
		bContinue = argsList[2]
		bTestVisible = argsList[3]
		bIgnoreCost = argsList[4]
		
		if eBuilding == gc.getInfoTypeForString('BUILDING_BARRACKS'):
			if not gc.getPlayer(pCity.getOwner()).hasTrait(gc.getInfoTypeForString('TRAIT_AGGRESSIVE')):
				return True
		
		return False
You also have to make sure that this callback is enabled. In PythonCallbackDefines.xml the value for USE_CANNOT_CONSTRUCT_CALLBACK should be set to 1.

Additional advice: don't change the original files. You are modifying things so make a mod.
 
:goodjob:
very nice.
thank you.

about the degree of slowing things down:

i want to add a new trait that allows for building additional buildings.
i thought about 6-10 new buildings and only this trait should be able to build these buildings.
any idea of how costly this would be?

yay!
 
There might be a Python callback for that, canBuild or something. The proper way, of course would be to make it in SDK and add some new tags.

Code:
<UniqueBuildings>
    <UniqueBuilding>BUILDING_MYBUILDING</UniqueBuilding>
</UniqueBuildings>
 
I am having some troubles with my Schema. I am getting two files not loading, neither of them ones I touched. From this, I concluded that the problem must lie in their schema file, which I had modified. I found a few errors, but I still can't find the problem. The errors go:
Failed Loading XML fule xml\GameInfo/CIV4PlayerOptionInfos.xml.
LoadXML call failed for GameInfo/CIV4PlayerOptionInfos.xml.

Failed Loading XML file xml\GameInfo/CIV4GraphicOptionInfos.xml.

LoadXML call failed for GameInfo/CIV4GraphicOptionInfos.xml.

Anyone have any help for me?
 
Back
Top Bottom