Most frustrating things in Civ5 code

Perhaps I'm not quite enlightened on it yet, but can anyone explain to me why Firaxis would pack all their art assets into inaccessible .fpk files? And then go further by making everything look random and indecipherable, requiring modders to not only find some .fpk unpacker but also a .dds unscrambler? :mad:

(This is kind of turning into a "rant about Firaxis" thread. Just as well, I guess. :))
 
Paint.NET can actually open, save and edit .dds files, so it's not so bad.
 
To make things even worse, the NoAnnexing tag is tied, in the DLL, to being able to purchase in puppet cities. So if you want one but not the other, it's simply too bad.

I actually managed to solve this problem, or at least half of it. From my Big Boss Subsistence mod:

Code:
--Prevents purchasing in puppet states
function MSFNoPuppetBuy(iPlayer, iCityID)
	local pPlayer = Players[iPlayer]
	if pPlayer:GetCivilizationType() ~= GameInfoTypes.CIVILIZATION_MSF then
		return true
	end
	local pCity = UI.GetHeadSelectedCity()
	if pCity ~= nil then
		if pCity:IsPuppet() then
			return false
		end
	end
	return true
end

GameEvents.CityCanConstruct.Add(MSFNoPuppetBuy)
GameEvents.CityCanTrain.Add(MSFNoPuppetBuy)

Prevents CIVILIZATION_MSF (a Civ with NoAnnexing) from making any purchases with Gold, but still allows for the regular automated selection of buildings to be built without issue. It won't prevent the AI from doing it...but the AI doesn't do it anyway, according to the DLL.

Now, if you want to allow puppet gold purchasing and regular annexing and settling together...well, can't help you there.
 
It won't prevent the AI from doing it...but the AI doesn't do it anyway, according to the DLL.

Unless your players are also using CSD or Smart AI, both of which re-enable the AI purchasing in cities.

local pCity = Players[iPlayer]:GetCityByID(iCityID)

should make it work for the AI as well.
 
local pCity = Players[iPlayer]:GetCityByID(iCityID)



should make it work for the AI as well.


Wouldn't this prevent the puppet state from doing its normal automated construction?



Sent from my iPhone using Tapatalk
 
I actually managed to solve this problem, or at least half of it. From my Big Boss Subsistence mod:

Interesting. Thanks for the tip; I may be able to make use of it one day.

Unless your players are also using CSD or Smart AI, both of which re-enable the AI purchasing in cities.

That's simply ridiculous.
 
That's simply ridiculous.
What is?

That players are using CSD or Smart AI?
That those mods reenable the AI purchasing in cities?
That the AI doesn't purchase in cities in the first place?

:crazyeye:
 
That players need to use a mod to enable the AI to use core game mechanics.
That those mods need to patch up Firaxis'... "AssignStartingPlots.luas" - excuse my language :)
That the AI doesn't purchase in cities in the first place.
That the modularity of this game was so lauded to begin with, but as time went on (and XPs arose), it became less and less modular.
 
Got a few more things to rant about after attempting to make my latest Civ work.

  • What the hell is wrong with Tourism? I know it doesn't work like a Yield, but it's really frustrating when you can have multiple of a dummy building in a city, but only one will provide Tourism.
  • Giving a city a building from a specific BuildingClass that isn't the default building or the Civ's UB causes far too many problems. It won't count towards the requirements for National Wonders or future buildings which require that building's class to construct (e.g. Library to University). Also, add a building like this with a Great Work slot, and you won't be able to put Great Works in it or get theming bonuses.
  • Why isn't there a simple RequiresFreshWater tag in the Improvements table? The closest thing is RequiresFlatlandsOrFreshWater, but the UI I'm trying to make is going to be OP if it can be built on any flatland.
 
"The most moddable civ yet ..."

and the part the omitted

"... but you'll need to waste time and effort creating dummy buildings, fake policies/techs, hidden units etc, etc, etc to achieve anything meaningful because the code base is so inconsistent"
 
Few more rants.

- Great Galleas is not intuitive GREAT_GALLEAS but VENETIAN_GALLEAS

- Mandekalu Cavalry is not intuitive MANDEKALU_CAVALRY but MUSLIMCAVALRY

- War Elephant is INDIAN_ELEPHANT

- For some reason BUILDING_TEXT_HELP is separated from BUILDING_TEXT and BUILDING_TEXT_STRATEGY, and each expansion/DLC has these lines in different file! Good luck finding them all! Oh, and to complicate that more, wonders/buildings/units/traits/everything is in various random XML files so in order to properly change TEXT you have to search proper lines in all text files (...and for some reason each version, even the smallest DLC, has over dozen various XML files - even with 1KB each one! - instead of one easy to explore file!). For example, one time I found BUILDING_TEXT_HELP for proper building in Buildings.xml, once in Jon2.xml (what the hell is Jon?) and once in TextInfo.xml because why not. Everything depends on from which DLC you seek for XML (and apparently the amount of trolling mood of developers :crazyeye: ). Combine this with the fact that some features have no intuitive names taken from in - game but for example, as I have written before, MUSLIMCAVALRY.

Firaxis!!! :mad:

You know what would be utopia? One goddamn XML file for text. Yes, it would be big, but I prefer to launch one big file and edit this one file for 30 minutes using SEARCH IN FILE option than switch between 15 randomly named and divided files only to find BUILDINGS neither in BUILDINGS.xml nor BUILDINGS_TEXT.xml but in JON2.xml, whatever the hell is JON.


Seriously, I am 18 years old stupid noob amateur and I regularly almost facepalm when I see hordes of stupid/needless 'programming choices' made by Firaxis.

Also:
1) As few people commented before, the most ridiculous thing are those useless tables like <ReceivesCultureFromKills>true. Because why implement some very simple mechanism 'hey modder! look, you can use this simple XML lines to customise free food/whatever yield from kills!', better implement hordes of strict arbitrary lines like this one :p And this damn boolean (true/false) instead of, you know, value which could be used to customize amount of culture...

2) I don't know if it would be possible, maybe for some reason absolutely not, but you know what would be very, very, VERY helpful for beginning LUA modders? Game logic in Assets written in - surprise! - LUA. So we could reuse it. This is even more annoying because there is some LUA lines in Assets, they are just AssingStartPlots.lua which is still impossible to edit by beginners because it is f****ked :lol:
 
Krajzen: There are some VERY frustrating things with Civ5, but I get the impression you're making it harder on yourself.

Stop looking through the XML files, and look at the SQLite database (Civ5DebugDatabase.db). I promise, your modding experience will go from maddening to merely frustrating. There's a separate database just for text! (Localization-Merged.db)

And if you want Lua to replicate, look at the scenarios.
 
Also, use the online civilopedia if ever you need to look up strategy, help or pedia texts. I used it any time I need to update an existing text like that. Any text not covered, you can search for with something like grepWin.

Jon is Jon Shafer, BTW (at least I presume).
 
As a mod you should know better than to swear in the forums :lol:
That those mods need to patch up Firaxis'... "AssignStartingPlots.luas" - excuse my language :)
Who else here thinks we should officially make "AssignStartingPlots.lua" the official civ5 modding swear word?

I can just imagine...
"Dang! This AssignStartingPlots code isn't working!"
 
Back
Top Bottom