I've made some amendments to the Great Works/culture overview screen

Rob (R8XFT)

Ancient Briton
Retired Moderator
Joined
Aug 11, 2002
Messages
10,866
Location
Leeds (UK)
The new modcast set me on a mission. The guys were saying how the Great Works/culture overview screen is hard-coded and I wanted to see just how much I could change. At first, it seemed impossible, but I've had some success! Attached is a basic mod (which still needs a little work if it's to become a mod - but it's fit for purpose here).

The first thing it does is adds the Theatre of Dionysus as a wonder available with Drama; this part of the process was straightforward; it's basically a slightly different Globe Theatre. OK, so most modders could do that one! It was nice to find a use for the redundant theatre icon ;).

It also adds the library and university as buildings that have one great writing slot and appear on the grid on the Great Works screen. I figured out that most of the columns were based on the Building Class, so I made the university the default building for the Heroic Epic Building Class, modified what that class did, deleted the usual university class, aligned all other buildings relying on that class to the Heroic Epic Building Class and finally set up a new building class for the Heroic Epic. Phew! Then I needed to add a global instances to the Heroic Epic class (I set it to 99) in order to make the game think it was a wonder that could be built once by each civilization - this way, on the Great Works screen, it appears like any other wonder. It could do with a wonder splash though!

The library was a little different, as I've swapped it for the Royal Library. To cut a long story short, this was the exception to the rule; the Royal Library appears on the screen based on....well, based on it being the Royal Library. I needed to override the files to make it so that it thought that the library was the Royal Library and vice-versa.

Finally, I've changed the Ceilidh Hall so that everyone can get it and that it has a couple of slots for music with a theming bonus. If you set the buildings to two on any of the columns that normally have one, it does work in a sense - except you can't access the Great Works screen to swap things around. A bit of lateral thinking for this one - I made the Ceilidh Hall a wonder that every city could build once - adding a global instances of 999 (I don't think any game would need as many as that!) The result is that the Ceilidh Hall shows in each city where wonders would show on the Great Works screen. As a side-effect, they're listed in the builds queue where wonders would be and, again, could do with a wonder splash. I'm not sure yet (as it hasn't happened in-game yet) if you get a message every time another civ builds a Ceilidh Hall, though I think it's likely.

I've not posted the mod in the modpacks section as it's only here to demonstrate what I've discovered so far, not to be nitpicked about choices for the Ceilidh Hall etc. I have attached it here, along with some screenshots.

Incidentally, the Celts get a sanctuary (garden replacement) instead of the Ceilidh Hall as their Unique Building.

I hope this helps others and that someone else might be able to advance from what I've done and take it a step further. I'd be interested in your thoughts :cooool:.
 

Attachments

  • Great works (v 1).zip
    Great works (v 1).zip
    1.1 MB · Views: 96
  • GreatWorks01.jpg
    GreatWorks01.jpg
    312.2 KB · Views: 219
  • GreatWorks02.jpg
    GreatWorks02.jpg
    315.4 KB · Views: 210
  • GreatWorks03.jpg
    GreatWorks03.jpg
    319.4 KB · Views: 197
Is no-one actually interested in this? It's a way to add buildings to the culture overview screen; I'm just surprised the thread's had so many views and no comments ;).
 
Is no-one actually interested in this? It's a way to add buildings to the culture overview screen; I'm just surprised the thread's had so many views and no comments ;).

Very interesting, since i use a replace for the cultureview.lua (hope name is correct), while adding new wonders and buildings, with themes to the game, iam glad to hear, thats you find a way to modify it.
Will look into your mod next time, i start working on CiV again.;)
 
Hi Rob, this is really helpful for something I want to mod. I do have a question, though.

You say that the buildings are "hardcoded". When you say hardcoded, do you mean that it's in the .dll? Because from what I can see, the buildings that appear in the normal culture building overview are controlled through the CultureOverview.XML file (not the LUA file). In the CultureOverview.LUA file, there is a section that defines what buildings go into the Wonder section under the city name (namely all wonders + Hermitage + National College).

So from what I've seen, I wouldn't say this info is hardcoded (as in coded into the .dll) - but am I mistaken about this, and is the info in the .XML file not actually active code?
 
Hi Rob, this is really helpful for something I want to mod. I do have a question, though.

You say that the buildings are "hardcoded". When you say hardcoded, do you mean that it's in the .dll? Because from what I can see, the buildings that appear in the normal culture building overview are controlled through the CultureOverview.XML file (not the LUA file). In the CultureOverview.LUA file, there is a section that defines what buildings go into the Wonder section under the city name (namely all wonders + Hermitage + National College).

So from what I've seen, I wouldn't say this info is hardcoded (as in coded into the .dll) - but am I mistaken about this, and is the info in the .XML file not actually active code?

Hardcoded doesn't mean coded into the DLL. Hardcoded means that it's not modular i.e. the programmer writes something like "if something = Theatre then do x" instead of "if something has tag x then do y". Essentially, you can't easily add new elements because if you do the system doesn't know about it unless you physically modify the code.

Another example, the difference between

Code:
int number = 5;
cout << number;

and

Code:
int number;
cout << "Enter a number" << endl;
cin >> number;

cout << number;

Is that in the first example, the program will always print out "5" and in the second example, the user can specify the value they want printed out. Which is easier and smarter to modify?

Hardcoding is taking a shortcut - instead of supporting multiple different buildings as long as they have a great work slot they support a fixed set of buildings and make it a pain in the ass to correct for anyone else.
 
I was just trying to find a way round the issue when the guys on one of the modcasts had said it was hardcoded. I've just had a look at that XML file - I'm not really sure with the popup XMLs at the moment - but it looks like someone more proficient than I could modify this find and then change how the popup looks. Nice find - hope that one of those more proficient than I comments ;).

EDIT: One of those "more proficient people" that I was speaking of cross-posted :).
 
Hardcoded doesn't mean coded into the DLL. Hardcoded means that it's not modular i.e. the programmer writes something like "if something = Theatre then do x" instead of "if something has tag x then do y". Essentially, you can't easily add new elements because if you do the system doesn't know about it unless you physically modify the code.
Ok, I guess I didn't know my terms properly. In my world, hardcoded = something that can't be changed through normal modding (i.e. buried in the .dll).

Either way, I just took 10 minutes to do a small experiment: Basically what I did was I edited CultureOverview.xml to remove the columns associated with Palace, National Epic and Heroic Epic, and I also removed the section that defined their buttons. Then I went to CultureOverview.lua to remove the sort options for these buildings (because they no longer have a button) and instead added them to the list of exceptions that get sorted with World Wonders under the city name - and voila!



I even found in the XML file there's a section called "Column Backgrounds" which defines the backgrounds and dividers of the columns, so you can remove the empty columns or make new ones to fit new buildings you add if these have multiple building slots.
 
Just wanted to add that I have today succesfully added a new building to the Culture Overview simply by copy/pasting the templates of the other buildings in CultureOverview.xml and CultureOverview.lua files. No fake building classes or anything. Only tricky part is one needs to be aware of the special section that handles the black/grey columns and green divider lines in the background and needs to be updated according to how you shift around columns.



I did spend the better part of an hour bug-tracking, but that was because I had accidentally set one of the files to update userdata instead of update database ... :mad:
 
Nice...
 
I just took 10 minutes to do a small experiment: Basically what I did was I edited CultureOverview.xml to remove the columns associated with Palace, National Epic and Heroic Epic, and I also removed the section that defined their buttons. Then I went to CultureOverview.lua to remove the sort options for these buildings (because they no longer have a button) and instead added them to the list of exceptions that get sorted with World Wonders under the city name - and voila!

If you also removed the empty columns at the right, this would be a nice little mod -- Palace, National Epic and Heroic Epic featuring their own columns is clearly incorrect.
 
Yes, like I said, removing the empty columns is also very easy in the xml file, you will see in the latest version where I added a new building, I also removed the empty columns in the end.
 
By all means, go ahead. That will save me the trouble of finding out how to upload a mod to steam! My purpose for looking into this is not so much moving those columns in itself, that is only a step I took to make room for much culture buildings. Do you want me to upload the edited CultureOverview.xml and CultureOverview.lua files here?
 
This is a very exciting little mod that's growing here. How ever much I love the BNW great works mechanics, there is something about it which is leaving me wanting. Mainly not enough of it - not enough works, not enough slots, and absolutely no way of getting ancient works of art and writing, which is bizarre. This wee mod goes a great way towards solving most of these problems.

Can I recommend an addition? Giving the Mosque a great writing slot, and the Monastery a great music slot would help a lot in negating the insanity of the Cathedral being the only religious building that can house a GW. But this is sterling work and the addition of the Theatre of Dionysus is inspired.
 
Do you want me to upload the edited CultureOverview.xml and CultureOverview.lua files here?

Thanks, I already reengineered that part. :-)

Can I recommend an addition? Giving the Mosque a great writing slot, and the Monastery a great music slot would help a lot in negating the insanity of the Cathedral being the only religious building that can house a GW.

My work-in-progess is only an interface fix. However, it will *support* Mosques with great writing slots and the like. (They will be listed below the respective city name, which is better than missing at all. Automatically adding/changing columns is beyond my abilities.)
 
This needs to get saved somehow for future use. I've thought of having a civ with its own great works (as a joke -- they're "Great Culinary Works") and if I ever do, I'd like to be able to remember how.
 
Back
Top Bottom