City State Diplomacy Mod (Updated)

I've also updated the penalty for bullying and revoking protection to set your influence to -60. Doesn't matter what your influence is at beforehand, if you revoke your protection or bully, your influence will drop to -60 immediately.

Do AI focused on hostile interactions with CS know this and act accordingly?
 
Do AI focused on hostile interactions with CS know this and act accordingly?

It should – the only rule for issuing protection is if the civ currently has a protective stance with the minor, which is affected by a multitude of things including war, resources, proximity, and grand strategy.
G
 
I was thinking about the production and science boni to factories and here's my take on it:
- provides +2 hammers / beakers in first four cities along with a +10% production bonus (similar to the Tradition code for 10% growth in those cities), perhaps without the bonus production in Capital (if possible),
- provides +1 hammer / beaker in all other cities along with a +5% production bonus.

Aside from that:
If possible, a civ that didn't reach a Silver medal (tier 2 reward) could also receive +2/+10%, or even +4/+10% production in all cities for 30 turns. If not possible, then all civs should receive this bonus (maybe a bit lower for higher tiers - that production got you something else).

Why:
- production is the single most important reason we have "once behind, stays behind" issues - production in cities that were found late, or on locations that are not particularly good, suffer because they still develop in the same way they were developing since ancient era - including the fact that we have 1 population, no buildings, and little to no production / food - after they are improved, the situation gets better in later eras, but it's still far from "Settlers->Colonists->Pioneers" we had in civ4 RoM which made the issue a lot, lot less serious - founding cities in later eras still forces you to build watermills, workshops, monuments, libraries, all that simple stuff, wasting a ton of time and cutting you on national wonders,
- while +2/+10% production is a small ammount when building late stuff, it's a HUGE ammount when given to a relatively new city that has small population and 2-10 production - this can help to catch up,
- not to screw the tall, small civs, first four cities get better factory bonuses than all the later cities.

If you can fix something, why not fix two things at the same time. Civs that are far ahead would consider building this - why give opponents an edge - on the other hand, you could still get something. This would not be needed if we had a proper settler upgrade, but still - faires are known for their influence, increasing production output for all cities that does not require buildings and only works for some time would be nice and won't cause a stat bloat.
 
I was thinking about the production and science boni to factories and here's my take on it:
- provides +2 hammers / beakers in first four cities along with a +10% production bonus (similar to the Tradition code for 10% growth in those cities), perhaps without the bonus production in Capital (if possible),
- provides +1 hammer / beaker in all other cities along with a +5% production bonus.

Aside from that:
If possible, a civ that didn't reach a Silver medal (tier 2 reward) could also receive +2/+10%, or even +4/+10% production in all cities for 30 turns. If not possible, then all civs should receive this bonus (maybe a bit lower for higher tiers - that production got you something else).

Why:
- production is the single most important reason we have "once behind, stays behind" issues - production in cities that were found late, or on locations that are not particularly good, suffer because they still develop in the same way they were developing since ancient era - including the fact that we have 1 population, no buildings, and little to no production / food - after they are improved, the situation gets better in later eras, but it's still far from "Settlers->Colonists->Pioneers" we had in civ4 RoM which made the issue a lot, lot less serious - founding cities in later eras still forces you to build watermills, workshops, monuments, libraries, all that simple stuff, wasting a ton of time and cutting you on national wonders,
- while +2/+10% production is a small ammount when building late stuff, it's a HUGE ammount when given to a relatively new city that has small population and 2-10 production - this can help to catch up,
- not to screw the tall, small civs, first four cities get better factory bonuses than all the later cities.

If you can fix something, why not fix two things at the same time. Civs that are far ahead would consider building this - why give opponents an edge - on the other hand, you could still get something. This would not be needed if we had a proper settler upgrade, but still - faires are known for their influence, increasing production output for all cities that does not require buildings and only works for some time would be nice and won't cause a stat bloat.

So why don't I do a proper settler upgrade, then? :)

Edit: What I mean to say is, while I like the idea you present, I feel like it is more of a band-aid on the problem you describe, rather than a solution. I'd rather get to the source by ending the penalty for founding cities in the second half of the game.

I could also design a resolution that grants production to civs behind the global tech average, and gold to those above the tech average. Something akin to 'Global Industrialization.'
 
These are good - I'm just thinking about all the awesome ideas and my mind is always going in the direction "how to do it not to put civs far ahead even further ahead". The game is all about getting ahead, but every single bonus that wasn't in the base version makes this issue worse, so indtroducing balance factors is certainly an option. Otherwise, every single hammer, beaker or apple will make the game easier for the player to win (since AI can't really create "production", "science pump" or "culture pump" cities, piling all the boni). We've been there since School of Scribes gave +2 beakers and I've started to post in this thread (or post at all for that matter :p).

I guess Settler upgrades would certainly be in the scope of the mod, more so than many other things ;-) As would proper revolutions, but that is really far ahead. For now the main issue is that the ideas are too awesome to ignore, but also scary - the allpresent stat bloat etc.

Right now, if you get a city after medieval (for example to secure trade routes to CS / civs to take them over with culture / secure relations), that city will always be irredemably far behind. It will never grow properly - you have to drop a ton of gold on it to keep it from dragging your whole empire down (unavailible national wonders, science penalty, culture penalty etc.). And if you have to build 3-4 cities to secure trade routes etc.? If an AI finally gets the chance to grow after Astronomy (because he couldn't settle on his own continent, being pushed back by other civs)? Well, say hello to pop1 city making a monument in industrial era ;p
The single, laughable order tenent (Resettlement) doesn't help, though it would be awesome if we had Colonists and Pioneers.
Colonists (Conquistador pop was considered a Colonist pop if I remember correctly) had a monument, granary and 3 population I think. I can't remember what Pioneers provided, aside from pop5 start. In our case, Colonist (available at Astronomy) with pop3, granary, monument, shrine and lighthouse/watermill depending on start would be great. Pioneer (Steam Power or Replacable Parts) could have all that plus temple, library, barracks, colloseum, workshop, market and amphiteatr and pop5. Resettlement could stay - it's currently a terrible tenent, but it would actually be good (but not overpowering) if these units were available.

Last game I've found out that I don't have enough paper - I had 15-18 turns of not being able to produce diplomatic units (huge map, epic), so while I had a few awesome places to settle, I decided to simply conquer two other cities and call it a day. Noone sane builds settlers after renaissance, unless some dire circumstances occur.
 
I started playing a game in February with the following mods:

1.) Info Addict v. 22
2.) Barbarians Unlimited XP v. 2
3.) RED Modpack v. 27
4.) CSD v. 17

It's been a really fun game so far. But now I've reached some sort of game crashing problem. Not sure why, but it seems to have to do with a city state that changes allies 3 times in one turn. As soon as the little pop up appears telling of the 3rd ally change, the game crashes.

I've had no problems until this. It's really too bad. I was hoping to play this game out.

I've attached the file in case anyone is interested.
 

Attachments

  • Alexander_0310 AD-1880(b).zip
    2 MB · Views: 45
I started playing a game in February with the following mods:

1.) Info Addict v. 22
2.) Barbarians Unlimited XP v. 2
3.) RED Modpack v. 27
4.) CSD v. 17

It's been a really fun game so far. But now I've reached some sort of game crashing problem. Not sure why, but it seems to have to do with a city state that changes allies 3 times in one turn. As soon as the little pop up appears telling of the 3rd ally change, the game crashes.

I've had no problems until this. It's really too bad. I was hoping to play this game out.

I've attached the file in case anyone is interested.

Very odd. I've definitely done a lot of clean-up work on CSD since v17. I can't tell you definitively what happened – it could have been a slew of resolutions firing at once, or a collection of diplomatic units all popping at the same time. If I could guess, it is either a pathfinding problem or the AI tried to apply a MinorCivAI function to a major civ. You might try stepping back an autosave or two and see if the issue resolves itself - if the crash is variable, it may not reappear at the same time (or at all).
G

I guess Settler upgrades would certainly be in the scope of the mod, more so than many other things ;-)

Indeed – stay tuned.
 
I was thinking about the production and science boni to factories and here's my take on it:
- provides +2 hammers / beakers in first four cities along with a +10% production bonus (similar to the Tradition code for 10% growth in those cities), perhaps without the bonus production in Capital (if possible),
- provides +1 hammer / beaker in all other cities along with a +5% production bonus.
I'm wary of the percentage bonus. They are something that can get a little out of hand, I feel, but testing has to show. I'm also not 100% sure about giving it production bonuses, the winner already has the highest production nation-wide by virtue of getting it. I'd rather see some other yield, allowing diversification. Beakers are definitely fitting, but gold and tourism feel weird. Local happiness perhaps... I like the idea that it's restricted to the four first cities, though. I'm not the best person for game balance, though.

Regarding the settler upgrade: I like the idea (one of the best things about Call to Power), but I'd be wary of scope creep, a lot of mods have that. If you go for it, you should at least leave in an easy way of disabling it.

Finally, made a icon for the Olympic Village - I wasn't sure whether you wanted an "oilified" version of the splash image, but I tried my hand on one, though, just for fun. Use the parts you like (and if you want something changed, feel free to ask).

EDIT: Eugh, just realised CivFanatics converts sufficiently large PNG files to JPG. Since DDS requires compression, it's better to start from a clean, uncompressed PNG file...
I uploaded the icons and splashes in this imgur album in their full quality:
Spoiler :





 
I'm wary of the percentage bonus. They are something that can get a little out of hand, I feel, but testing has to show. I'm also not 100% sure about giving it production bonuses, the winner already has the highest production nation-wide by virtue of getting it. I'd rather see some other yield, allowing diversification. Beakers are definitely fitting, but gold and tourism feel weird. Local happiness perhaps... I like the idea that it's restricted to the four first cities, though. I'm not the best person for game balance, though.

Regarding the settler upgrade: I like the idea (one of the best things about Call to Power), but I'd be wary of scope creep, a lot of mods have that. If you go for it, you should at least leave in an easy way of disabling it.

Finally, made a icon for the Olympic Village - I wasn't sure whether you wanted an "oilified" version of the splash image, but I tried my hand on one, though, just for fun. Use the parts you like (and if you want something changed, feel free to ask).

EDIT: Eugh, just realised CivFanatics converts sufficiently large PNG files to JPG. Since DDS requires compression, it's better to start from a clean, uncompressed PNG file...
I uploaded the icons and splashes in this imgur album in their full quality:
Spoiler :






Fantastic! I love the art. Definitely going in the final v23 build.

Regarding settlers and feature creep, yeah, I hear ya. This is the only addition I've made (and the only one I will make) that doesn't really fit within the scope of 'making diplomacy and city-state interaction better.' It is, however, a big feature that I've always wanted, and one that will make the AI way more competitive in the late-game (as they won't be bogged down with tons of crappy cities).

The World's Fair was all about production but yes, you are correct in that the Civ with the highest production already won, thus giving them more production might be a bad idea. I'm leaning towards local happiness as well.
G
 
I just started playing this mod with the new version you just posted. I really enjoy it so far! The World Congress seems actually exciting and dramatic. I'm excited to mess with Warmonger penalties via resolutions. I like how getting allies requires work. I also like how it feels balanced (so far). There's a bunch of extra buildings and units to make, but you have extra gold because you're not giving it to city states.

Might I provide a few suggestions?
-Is there a way to polish out the diplomatic missions? I'm seeing that the mission has produced however much Influence and zero gold! Or vice versa.
-Enforce decolonization sounds a little strange to me...I don't really have a better idea but I don't see City-State influence as colonialism. Maybe enforce isolationism? Or reuse the embargo terminology?
-I think it'd be interesting to have a wonder for getting Gold at the Global Wargames. Maybe a famous test site? Or Los Alamos laboratory?

Anyway sorry if you've heard this before. I'm very glad I finally tried the mod.
 
I just started playing this mod with the new version you just posted. I really enjoy it so far! The World Congress seems actually exciting and dramatic. I'm excited to mess with Warmonger penalties via resolutions. I like how getting allies requires work. I also like how it feels balanced (so far). There's a bunch of extra buildings and units to make, but you have extra gold because you're not giving it to city states.

Might I provide a few suggestions?
-Is there a way to polish out the diplomatic missions? I'm seeing that the mission has produced however much Influence and zero gold! Or vice versa.
-Enforce decolonization sounds a little strange to me...I don't really have a better idea but I don't see City-State influence as colonialism. Maybe enforce isolationism? Or reuse the embargo terminology?
-I think it'd be interesting to have a wonder for getting Gold at the Global Wargames. Maybe a famous test site? Or Los Alamos laboratory?

Anyway sorry if you've heard this before. I'm very glad I finally tried the mod.

Glad you like it! I'm always thrilled to get feedback – makes what I do worthwhile. To answer your questions...

I left 'Diplomatic Missions' alone because changing LUA leads to a lot of conflicts with other mods that also change the same LUA (such as Enhanced UI). It isn't pretty, but it is a compromise.

I like 'Enforce Decolonization!' :D I'm an imperial historian by trade, and the idea of 'influencing' city-states (i.e. soft-power) smacks of imperialism to me. I'll take your suggestion under advisement, however.

I didn't want to have every project result in a wonder, but I might eventually do so. The attack bonus is pretty good, especially if you time the project's end with a big war on your evil neighbors. If there are suggestions for building features, I'm all ears.

Okay, so I've stepped into (and out of) the quagmire that is 'upgraded settlers.' It works. It is neat. I'm happy. Here's the breakdown:

Pioneer (unlocked at astronomy): +1 move, +1 sight. When you found a city, you get the following:

- 3 citizens
- Market
- Granary
- Lighthouse (if on the coast)
- Monument
- Shrine
- Walls
- Watermill (if on a river)

Colonist (unlocked at railroad): +2 move, +1 sight (versus Settler). When you found a city, you get the following:

- 6 citizens
- all the buildings from the Pioneer level
- Windmill (if on a hill)
- Workshop
- Amphitheater
- Barracks
- Harbor (if on the coast)
- Temple

Too strong? Not strong enough? Buildings you want to swap out? Now's your chance!

Edit: also, if you want to opt out of this whole shenanigan, it is as easy as adding a _ to the end of a folder in CSD's directory. That folder is called SettlerMod. Creative stuff.
G
 
As for the windmill: I think you've meant not on a hill.

As far as the rest goes:

Pioneer - stats good, buildings are good, but library's missing - I know it's gamey, but it's one of the main issues settling after some time is not feasible, and after some more time not even remotely viable. Also walls - I don't really think walls are a good idea - Barracks maybe, but walls? We're almost past the times of walls - some people might build them, yes, but I don't think they are suitable, though quite historically accurate as a "fortification" - but starting a castle day 1 in a new city might be a bit crazy (since we don't have an intermediate defensive building such as a watchtower or pallisade - walls take a lot of time to build and can't actually be brought by the new settlers (unlike most other buildings, which can be assembled at the site). Barracks, as "place where your city guard stays and where you train the military if you train them", make much more sense here instead of the next level - especially that it's by theme also a defensive building, to train people who will protect the settlers from hostile natives (why are natives always hostile? And why are we "defending" by taking their land and burning their villages :p).
I'd remember about conquistadors, the Spanish UU, not the historic ones :p - I know they receive little love, but allowing them to pop at least on this level is something that should not be forgotten (we fought for that in RoM times, don't even know why, since I never played Spain in civ - but it just made sense, and it makes sense now).

Colonist - stats good, would reduce population to 5, but maybe that's me (6 is a bit too much and perhaps too heavy on happiness - easy to starve a 6 on unimproved tiles without being a shoshone - easy to starve 5 as well, but not as likely). Windmill is great, but might be unbalanced - well, it might also be great, depending on how much they will cost. The rest is excellent. I don't know if it's possible to leave Pioneers as an option when Colonists happen without the AI going crazy like it did in RoM, but it might be worth considering, since even a pop5 city might not always be the best idea (especially that it must require a lot of production for all those buildings). It's better to give more buildings and increase the cost than make cuts, since that wouldn't really solve many issues. Giving the Colonist a bit of leeway on the culture borders side of things, a very minor shoshone-like effect would be in order to provide the city with workable tiles. On this level, I don't think shoshone will feel bad about this (their ability would still be better, and it's not like it matters that much after initial landgrab).

I cannot express how awesome this is, but I will try: it's truly awesome to the point of teenage-groupie mass-scream of joy ;p Yup, that awesome. I just can't describe with words how many things that might fix.
 
As for the windmill: I think you've meant not on a hill.

As far as the buildings go:

Pioneer - stats good, buildings are good, save for walls - I don't really think walls are a good idea - Barracks maybe, but walls? We're almost past the times of walls - some people might build them, yes, but I don't think they are suitable. Barracks, as "place where your city guard stays and where you train the military if you train them", make much more sense here instead of the next level.
I'd remember about conquistadors - I know they receive little love, but allowing them to pop at least on this level is something that should not be forgotten (we fought for that in RoM times, don't even know why - it just makes sense).

Colonist - stats good, would reduce population to 5 (6 is a bit too much - easy to starve a 6 on unimproved tiles - easy to starve 5 as well, but not as likely). Windmill is great, but might be unbalanced. The rest is excellent.

I cannot express how awesome this is, but I will try: it's truly awesome. I just can't describe with words how many things that might fix.

Yes, meant to say 'not on a hill' for windmill. (That always seemed arbitrary to me, by the way).

So, in lieu of barracks for colonist level, what should be built? I don't want the jump from Settler->Pioneer to be way better than the jump from Pioneer->Colonist.

I'll adjust the pop jump down to 5 for colonists as well.
G
 
Agreeing with thanerion regarding the walls (walls also mean colonists can become a combat unit to insta-pop a veritable defensive city) as well as the population, six does feel too high and strong - I was thinking 1->2->4, but that feels weak. Plus, I like the symmetry of going 1->3->5.

So, in lieu of barracks for colonist level, what should be built? I don't want the jump from Settler->Pioneer to be way better than the jump from Pioneer->Colonist.
Perhaps Aqueducts? They are not cheap, yes, but without the food to support it, it does nothing. And city growth takes long enough, especially if you're already hitting railroads - that city better grow big quick to matter.
 
Agreeing with thanerion regarding the walls (walls also mean colonists can become a combat unit to insta-pop a veritable defensive city) as well as the population, six does feel too high and strong - I was thinking 1->2->4, but that feels weak. Plus, I like the symmetry of going 1->3->5.


Perhaps Aqueducts? They are not cheap, yes, but without the food to support it, it does nothing. And city growth takes long enough, especially if you're already hitting railroads - that city better grow big quick to matter.

Sounds good to me. I think this is a fun little change. I'll admit it was a bear to implement without creating a hundred unique functions, but I'm glad I did it. Currently the buildings are assigned to the settler in the dll, so it isn't 'modular' (i.e. once compiled, the list of buildings is set). I might eventually give it its own column in the xml, but that's a project for another day (and more of a convenience than anything else).

While it doesn't make late-game city-founding a 'good' idea, it does at least justify the expense and, with enough trade routes funneling food/production to them, they can actually become productive parts of the empire in around 50 turns.

I'll finalize the changes after I finish work (definitely splurged a few good hours on this) and I'll upload it here for testing.

Edit: I re-read Thanerion's post, and missed a few things. I'll look into a tile grab increase for each – perhaps three new tiles – as well as a 50% food-box from the get-go (to keep them from insta-starving). Should make them a bit more hardy. I need to adjust food cost as well, as they are using the Settler logic (thus they are very cheap).

Cheers,
G
 
...Currently the buildings are assigned to the settler in the dll, so it isn't 'modular' (i.e. once compiled, the list of buildings is set). I might eventually give it its own column in the xml, but that's a project for another day (and more of a convenience than anything else)...

Curious you went that way instead of using some XML/sql to modify tables and assign the buildings that way. If you like you could use our code.
In Communitas we assign new cities a population of 5 and give them a selection of 1st tier buildings once a certain policy/policies is taken. Then with a simple lua function that policy can become active and do it's magic.

Obviously the code will need to be changed as you don't want it as a policy but a new unit, nevertheless if there is something here that can be reused to suit, feel free.

New policy set by sql. The list of buildings can be changed at any time to balance, if needed.
Spoiler :
Code:
INSERT INTO Policy_FreeBuildingClass(
	PolicyType, 
	BuildingClass, 
	NumCities)
SELECT DISTINCT
	'POLICY_HOMESTEAD_ACT', 
	BuildingClass, 
	-1
FROM Buildings WHERE BuildingClass IN (
	'BUILDINGCLASS_MONUMENT'	,
	'BUILDINGCLASS_GRANARY'		,
	'BUILDINGCLASS_BARRACKS'	,
	'BUILDINGCLASS_LIGHTHOUSE'	,
	'BUILDINGCLASS_LIBRARY'		,
	'BUILDINGCLASS_CARAVANSARY'	,
	'BUILDINGCLASS_STABLE'		,
	'BUILDINGCLASS_SMITH'		,
	'BUILDINGCLASS_WALLS'		,
	'BUILDINGCLASS_COLOSSEUM'	
);

Actual function to do the new buildings done in lua

Spoiler :
Code:
function DoPolicyFreeBuildingClasses(player, policyID)
	log:Info("DoPolicyFreeBuildingClasses")
	local playerID = player:GetID()
	local cityList = nil
	for row in GameInfo.Policy_FreeBuildingClass() do
		local testPolicyInfo = GameInfo.Policies[row.PolicyType]
		local numCities = row.NumCities
		if (policyID == testPolicyInfo.ID) or player:HasPolicy(testPolicyInfo.ID) then
			if player:IsHuman() then
				log:Debug("%45s has      %s", player:GetName(), testPolicyInfo.Type)
			end
			local buildingID = player:GetUniqueBuildingID(row.BuildingClass)
			if not MapModData.Cep_PlayerFreeBuildings.Buildings[playerID][buildingID] then
				MapModData.Cep_PlayerFreeBuildings.Buildings[playerID][buildingID] = 0
			end
			if numCities == -1 then
				for city in player:Cities() do
					if not city:IsHasBuilding(buildingID) then
						city:SetNumRealBuilding(buildingID, 1)
					end
				end
			elseif (MapModData.Cep_PlayerFreeBuildings.Buildings[playerID][buildingID] < numCities) then
				if not cityList then
					cityList = {}
					for city in player:Cities() do
						if player:IsHuman() then
							log:Debug("Policy_FreeBuildingFlavor #cityList=%s id=%s turn=%s", #cityList, City_GetID(city), city:GetGameTurnAcquired())
						end
						table.insert(cityList, {id=City_GetID(city), turn=city:GetGameTurnAcquired()})
					end
					table.sort(cityList, function (a,b)
						return a.turn < b.turn
					end)
				end
				local maxCityID = #cityList
				if numCities < maxCityID then
					maxCityID = numCities
				end
				for i = 1, maxCityID do
					local cityID = cityList[i].id
					local city = Map_GetCity(cityID)
					PlaceBuildingID(city, buildingID)
				end
			end		
		end
	end
end
 
Curious you went that way instead of using some XML/sql to modify tables and assign the buildings that way. If you like you could use our code.
In Communitas we assign new cities a population of 5 and give them a selection of 1st tier buildings once a certain policy/policies is taken. Then with a simple lua function that policy can become active and do it's magic.

Obviously the code will need to be changed as you don't want it as a policy but a new unit, nevertheless if there is something here that can be reused to suit, feel free.

New policy set by sql. The list of buildings can be changed at any time to balance, if needed.
Spoiler :
Code:
INSERT INTO Policy_FreeBuildingClass(
	PolicyType, 
	BuildingClass, 
	NumCities)
SELECT DISTINCT
	'POLICY_HOMESTEAD_ACT', 
	BuildingClass, 
	-1
FROM Buildings WHERE BuildingClass IN (
	'BUILDINGCLASS_MONUMENT'	,
	'BUILDINGCLASS_GRANARY'		,
	'BUILDINGCLASS_BARRACKS'	,
	'BUILDINGCLASS_LIGHTHOUSE'	,
	'BUILDINGCLASS_LIBRARY'		,
	'BUILDINGCLASS_CARAVANSARY'	,
	'BUILDINGCLASS_STABLE'		,
	'BUILDINGCLASS_SMITH'		,
	'BUILDINGCLASS_WALLS'		,
	'BUILDINGCLASS_COLOSSEUM'	
);

Actual function to do the new buildings done in lua

Spoiler :
Code:
function DoPolicyFreeBuildingClasses(player, policyID)
	log:Info("DoPolicyFreeBuildingClasses")
	local playerID = player:GetID()
	local cityList = nil
	for row in GameInfo.Policy_FreeBuildingClass() do
		local testPolicyInfo = GameInfo.Policies[row.PolicyType]
		local numCities = row.NumCities
		if (policyID == testPolicyInfo.ID) or player:HasPolicy(testPolicyInfo.ID) then
			if player:IsHuman() then
				log:Debug("%45s has      %s", player:GetName(), testPolicyInfo.Type)
			end
			local buildingID = player:GetUniqueBuildingID(row.BuildingClass)
			if not MapModData.Cep_PlayerFreeBuildings.Buildings[playerID][buildingID] then
				MapModData.Cep_PlayerFreeBuildings.Buildings[playerID][buildingID] = 0
			end
			if numCities == -1 then
				for city in player:Cities() do
					if not city:IsHasBuilding(buildingID) then
						city:SetNumRealBuilding(buildingID, 1)
					end
				end
			elseif (MapModData.Cep_PlayerFreeBuildings.Buildings[playerID][buildingID] < numCities) then
				if not cityList then
					cityList = {}
					for city in player:Cities() do
						if player:IsHuman() then
							log:Debug("Policy_FreeBuildingFlavor #cityList=%s id=%s turn=%s", #cityList, City_GetID(city), city:GetGameTurnAcquired())
						end
						table.insert(cityList, {id=City_GetID(city), turn=city:GetGameTurnAcquired()})
					end
					table.sort(cityList, function (a,b)
						return a.turn < b.turn
					end)
				end
				local maxCityID = #cityList
				if numCities < maxCityID then
					maxCityID = numCities
				end
				for i = 1, maxCityID do
					local cityID = cityList[i].id
					local city = Map_GetCity(cityID)
					PlaceBuildingID(city, buildingID)
				end
			end		
		end
	end
end

Thanks for the offer. I thought about doing it that way when I started out, as I knew CEP had a variation on this, however, since CSD already has so many dll edits, I figured I'd just keep editing the .dll. I can debug pretty easy that way, plus my LUA skill is far more rusty than my C++!

On a side-note, I'm always impressed at CEP's progress when I check in on your sub-forum. Between CEP, Whoward's combined dll with Putmalk, and CSD, we've just about completely redesigned this game! (By the way, Whoward, if you read this, you really need a three-letter acronym for your work that begins with 'C.')

G
 
Just a query about the DLL.
I always thought the DLL in CSD was a small subset of the one provided by WHoward for his Various Mod Components mod. Then I moticed the CSD DLL is 5.5 Mb compared to a little over 4Mb for WHoward's. I would've thought his would be bigger.

Is that not the case? Are these two different animals? Is it not possible to use WHoward's DLL and your XML/sql/lua?

I've never thought about it before because yours was the only DLL mod I have, but I have recently thought about some of the stuff Whoward has done and wanted to try.
 
Then I moticed the CSD DLL is 5.5 Mb compared to a little over 4Mb for WHoward's. I would've thought his would be bigger.

I suspect it's partly because as achievements are not possible with mods my DLL strips out all the redundant achievement checking code - which is a LOT of strings.

But it will mainly depend on what compiler/linker switches are used - eg has all the debug stuff been left in the DLL.
 
Thank you.:goodjob:

That was quick, have you got a little forum bot scouring posts checking for posts that reference you or your mods?:mischief:
 
Top Bottom