[help] Separating Art from Artifacts - mod crashes when digging up Artifact

kaspergm

Deity
Joined
Aug 19, 2012
Messages
5,828
I would like to request some help in tracking down an error in a mod I'm working on.

The purpose of the mod is to make Art and Artifacts go into two different slots, and to give Artifacts their own icon. I have been fairly succesfull with this so far, in the sense that I've gotten the two slots defined and the artwork for the artifact seems to be recognized, at least in the empty slot and in the highlighted slot, as seen in the screenshot below.

Spoiler :


However, when I set out an Archeologist to dig up an artifact and the dig is completed, if I choose the artifact option, I get a nasty bug where the game freezes and crashes to desctop. No report is left in the lua.log or xml.log as to what causes the crash. If I chose to create a landmark, no crash happens. Here's a link to the mod and a save just before an artifact is dug up:

Link to mod
Link to save game

I have tried to figure out what can be the cause of this. I don't know if I need to make a icon map over the artifact icons for the filled slot (there are four different in the .dds file), but I didn't have a template for an icon map for this kind of file, so I didn't make any - however, given that the empty slot shows up fine, I'm not sure this is the cause, nor can I see why this would give such a nasty crash (but what do I know).

Any help on this subject would be very much appreciated.
 
I assume game is trying to put your Artifact to Art slot, but since you made it illegal, game couldn't handle it anymore. Go to the jedi temple, Archeologic Lua and see what must be done. Though I bet you would be not able to do anything (hardcoded staff probably).

What I would do, is probably, keep current Art Slot for Artifacts (you can easily change icon and text), while make new Great Work Slot for Art.
 
I assume game is trying to put your Artifact to Art slot, but since you made it illegal, game couldn't handle it anymore.
Not sure - I did specify that Artifacts go into Artifact slots in the GreatWorks.xml file, but are you telling me that this information is also handled somewhere else in the game?

Go to the jedi temple, Archeologic Lua...
Sorry, but what is jedi temple? :confused:

Not related to your crash: Shouldn't rather the gallery have art (paintings) slots, and the museum artifact slots?
That is actually how it is. The building with the old Museum icon that holds the painting is the Gallery, it just looks like the tooltip is relating to the Museum (with the new icon) because the mouse pointer is not shown when you take the actual screenshot, making the tooltip text look displaced to the right.
 
BTW, please consider to use my version of CultureOverview.lua (which includes Leugi's support for custom GW buildings) as a base for your mod. Note that Leugi's/my version uses buildings instead of building classes for the columns, and shows everything but the six hardcoded buildings below the respective city name.

Reasoning: Should a mod create a civ-unique GW building (say, an Austrian opera house) which overrides a standard one, anyone playing the respective civ will still be able to capture cities with the standard one. Therefore, the Culture Overview columns should not replace standard buildings with possible unique variants.

EDIT: Thinking about it, I don't have a clue what actually happens if one captures cities with unique buildings (or with standard buildings of which the conqueror can build a unique variant). Are there any reports of capturing Assyrian cities where the Royal library remained intact?
 
It seems Royal Libraries can't be captured at all. However, the Celtic Ceilidh Hall has a conquest probability of 100%. I opened a new thread.

EDIT: Captured Ceilidh Halls downgrade to Opera Houses. Forget what I said about my (current) version of CultureOverview.lua -- there's obviously room for improvement.
 
I updated my "Culture Overview Fix (BNW)" to v 2. It now uses the following condition for displaying wonders and buildings below the city name:

Code:
if(building.BuildingClass ~= "BUILDINGCLASS_AMPHITHEATER" and
    building.BuildingClass ~= "BUILDINGCLASS_OPERA_HOUSE" and
    building.BuildingClass ~= "BUILDINGCLASS_MUSEUM" and
    building.BuildingClass ~= "BUILDINGCLASS_BROADCAST_TOWER" and
    building.BuildingClass ~= "BUILDINGCLASS_CATHEDRAL" and 
    building.Type ~= "BUILDING_ROYAL_LIBRARY" and
    building.GreatWorkCount > 0) then
The Celtic Ceilidh Hall now correctly replaces the Opera House.
 
What I would do, is probably, keep current Art Slot for Artifacts (you can easily change icon and text), while make new Great Work Slot for Art.
I went back and changed the mod to do what you suggested, keep the old Art_Artifact slot but only allow Artifacts to go into it, and then only make a new slot for Art, and now it seems to work. :goodjob:

 
This could become a really nice mod! What are your ideas for, e.g., Art/Artifact swapping and theming bonuses? And what will the required tech for Galleries be?
There is no problem with swapping, as these two are already considered separate identities in that menu (i.e. you swap Art for Art or Artifact for Artifact, but not Art for Artifact).

As for what tech unlocks the Gallery ... I myself intend to use this with a greater mod project I'm doing which makes major changes to the tech tree, but I guess from a general pov., Gallery should come with the tech that unlocks Artist's Guild. That would be Guilds in the current tech tree? The problem is that I want Galleries to be new requirement for Hermitage, and since Hermitage sits at Architecture and National Wonders normally sit on the tech level after the building that unlocks them, that doesn't fit perfectly, but then again, there are exceptions from this rule (National Epic, National Visitor's Centre), so I guess that can be deviated from.

As for theming bonuses, there would be no major changes, although Museum only holds Artifacts now, so that is an indirect change. Louvre holds only Art now, so Louvre needs for Art pieces from different civs and differen eras. This idea was spawned by this thread in the suggestions forum, and I intend to make a British Museum wonder which will hold 4 Artifacts and replace Louvre as Exploration wonder. I'll also make a National History Museum which requires Museums in all cities and holds 3 Artifacts, need to be from own civ and different eras. I also think I'll take Hermitage out as a World Wonder instead (4 Art, different civs, different eras?), and add a National Gallery national wonder (3 Art, need to be from own civ and different eras).

Edit > Just finished the icon for National History Museum ... very proud of this one, it will be the first time where I've done an icon where some of it goes outside the icon border (if it works as intended :p).

 
There is no problem with swapping, as these two are already considered separate identities in that menu (i.e. you swap Art for Art or Artifact for Artifact, but not Art for Artifact).

True. What was I thinking?

I guess from a general pov., Gallery should come with the tech that unlocks Artist's Guild. That would be Guilds in the current tech tree? The problem is that I want Galleries to be new requirement for Hermitage, and since Hermitage sits at Architecture and National Wonders normally sit on the tech level after the building that unlocks them, that doesn't fit perfectly, but then again, there are exceptions from this rule (National Epic, National Visitor's Centre), so I guess that can be deviated from.

I also don't think it's a hard-and-fast rule. Note: If the gallery comes at Guilds, you should display it before Opera Houses in the Culture Overview.

I intend to make a British Museum wonder which will hold 4 Artifacts and replace Louvre as Exploration wonder.

Makes sense -- at least one World Wonder for each Great Works category.

I'll also make a National History Museum which requires Museums in all cities and holds 3 Artifacts, need to be from own civ and different eras. I also think I'll take Hermitage out as a World Wonder instead (4 Art, different civs, different eras?), and add a National Gallery national wonder (3 Art, need to be from own civ and different eras).

Not so sure about those. With Museums holding two GW slots, do we really need another National Wonder?

Just finished the icon for National History Museum ... very proud of this one

It's quite good. :goodjob:
 
Sadly Firaxis has gone the extremely modding unfriendly route with BnW of hardcoding pretty much everything, even when it makes no sense to do so. GREAT_WORK_SLOT_LITERATURE, GREAT_WORK_SLOT_MUSIC and GREAT_WORK_SLOT_ART_ARTIFACT are hardcoded in the DLL (they must exist or bad things can happen) and artifacts are hardcoded to go into the ART_ARTIFACT slot.

Even the AI is hardcoded with this stuff. Watch the AI, see if it moves things in your new slot to get theming bonuses. I'm not sure if it does or not. I'm pretty sure it won't trade them if you change the slot for them (or create entirely new types). Because hey, why make a flexible AI when you can hardcode it for no reason...
 
Watch the AI, see if it moves things in your new slot to get theming bonuses. I'm not sure if it does or not. I'm pretty sure it won't trade them if you change the slot for them (or create entirely new types).

If the AI can't handle new Great Work types, it should be at least possible to keep art and artifacts together, but add a new art/artifact building ("Gallery") at guilds. See also this post.
 
Watch the AI, see if it moves things in your new slot to get theming bonuses. I'm not sure if it does or not. I'm pretty sure it won't trade them if you change the slot for them (or create entirely new types). Because hey, why make a flexible AI when you can hardcode it for no reason...
That's a good point, I'll have to keep an eye out for that. I didn't tamper with the trade interface though, so that should work as normal.
 
Just in case: The new Gallery building (class) should also be affected by the "Cultural Centers" Aesthetics policy (+50% production on <culture buildings>):

Code:
<GameData>
	<Policy_BuildingClassProductionModifiers>
		<Row>
			<PolicyType>POLICY_CULTURAL_CENTERS</PolicyType>
			<BuildingClassType>BUILDINGCLASS_GALLERY</BuildingClassType>
			<ProductionModifier>50</ProductionModifier>
		</Row>
	</Policy_BuildingClassProductionModifiers>
</GameData>
 
I'm busy these days, haven't had much time to work on this. Still need to find out whether AI properly uses the new Art slots.
 
Back
Top Bottom