How to make minor modifications?

Magma_Dragoon

Reploid
Joined
May 10, 2008
Messages
2,354
I would like to change the SP civic to give a food/production/commerce bonus to all cities for each food/production/luxury resource I control. Can I do this by modifying the rules file or will this require more complex coding?
 
I meant the global defines XML file, yes.
 
I meant the global defines XML file, yes.

I wouldn't call that a 'rules file', but whatever. No, it couldn't be done in GlobalDefines.xml. GlobalDefines is for rules changes, this sounds like a change of an instance, the State Property civic. That means it would require a. a change in CIV4CivicInfos and some SDK or b. some python, although that would be messy, it it's possible at all (I'm not the python expert here. Refer all but the most basic python questions to Baldyr, The_J or another python expert).
 
I have no idea how to mod, am unfamiliar with the games SDK and really just want to make communism better so I can beat up those capitalist pigs as comrade Stalin. Q.Q
Btw, I am a computer programmer by trade :D, and I am pretty good with Java, so if the SDK uses C++ I should be able to get a handle on it.
 
If you just wanted the plot bonus to change with civic I would look in the modiki under terrains in the bonus infos file. It would be doable with just XML.

If you wanted bonuses in a city based on the existence of resources (yes/no) then you could do it with a building that was restricted to the civic. Again doable in XML.

It may be possible to do what you ask by defining a new corporation again just XML. However I have not messed with corporations so I don't know.

The problem comes with giving the building/corporation to all cities if you change to the civic and removing them if you change from the civic. That will require some coding.
 
It may be possible to do what you ask by defining a new corporation again just XML. However I have not messed with corporations so I don't know.

State property disables corporations, so that's a no go. Really, I think that this would be best done in SDK(Which is written in C++), which you could do because you're a professional.
 
:dunno:Maybe I'll just increase tile yield by 1 across the board, except ice and barren desert. Looks like the python code is totally undocumented, and I will probably spend more time making communism act like sushi+mining inc than I will spend enjoying the novelty of powerhouse Stalin.
Btw, if anyone could tell me exactly which files I should be editing to have civics affect tile yield I'd be much obliged.
 
Oh, that's way more useful than what I thought it was. One of those critters from xxxHoLiC.
 
Breakthrough! Seems all I need to to is create a function in CvCity.cpp, and prototype it in CvCity.h, and copy+paste some code from functions setting bonus yields from corporations.
:goodjob:
Edit: Plus some other stuff! Will begin work in earnest over the 3 day weekend. Time to crack open that book on C/C++ gathering dust in my room.
 
So here's the deal:

I love the uber cities I can make with Sid's Sushi + Mining Inc. I also like the terra map script, which gives so much sea food I'd be crazy not to use them. However, as an aspiring dictator and dedicated socialist, use of the "free" market civic is anathema. So I have decided to restore SP to it's rightful place as the best economic civic option in the game. I say, equal share for everyone!
(Idea for mod name, ESfE)

For each grain/seafood +x :food: per city
For each copper/iron/coal +y :hammers: per city
For each gold/silver/gems +z :commerce: per city

Of course, it will be smaller than what corporations would yield, but it's free.

My first idea was to modify SP itself to give these bonuses.
Today I thought about maybe trying to make it a pseudo-corporation that is allowed to run only under SP.
Another idea would be to make it a religion that is founded by communism tech, but it implements the yield modifying methods used by corporations, or give it a "temple" (☭ party office?) that does the same. (Tomb of Lenin as shrine? No idea how to do graphical stuff.)
 
Assuming you want it to affect all the player's cities, you'll need to spread the corporation (in code) to all cities, change the effect of HQ to have no effect or remove HQ altogether, and make sure it cannot be spread (no executives?).

I guess you can, but in my opinion it's a hack. (Think of how it'll look on the civilopedia, for example).

If you intend to edit the C++ code anyway, I suggest doing it properly. But others might disagree with me :dunno:

All this is of course unless you want to add stuff like Lenin's tomb for the sake of variety.

My suggestion is to add this info to civic info. Your XML could look for example, like this (or any other structure that makes sense to you):
PHP:
<YieldsBonuses>
	<YieldsBonus>
		<BonusType>BONUS_WHEAT</BonusType>
		<Yields>
			<iYieldBonus>50</iYieldBonus>
			<iYieldBonus>0</iYieldBonus>
			<iYieldBonus>0</iYieldBonus>
		</Yields>
	</YieldsBonus>
	<YieldsBonus>
		<BonusType>BONUS_IRON</BonusType>
		<Yields>
			<iYieldBonus>0</iYieldBonus>
			<iYieldBonus>100</iYieldBonus>
			<iYieldBonus>0</iYieldBonus>
		</Yields>
	</YieldsBonus>
</YieldsBonuses>

(100 means a whole yield, 50 means 0.5 yield, same as in corporations)

Then you need to add code that reads this XML and uses this data.
This might take some work though.
 
Sorry, not enough time + lost interest. :cringe:
I have gotten a better understanding of how the game works though. Too bad I didn't think of doing this when I was unemployed and had plenty of free time.
(sorry for wasting your time Lord Asaf :bowdown:)
Maybe I'll make this a civ5 mod once I buy it, I hear maritime city states are op.
 
Back
Top Bottom