New improvement art! You don't need to replace civ5artdefines_landmarks.xml

I believe that you should be able to add unit art in a fully modular way. The tables are right there in DebugDatabase.

Just for "fun" :rolleyes: I'm playing with adding unit art in SQL. I may be slightly out of my depth, but I think I get everything that's going on.

Unfortunately, CiV doesn't seem to pick up the new art files from my mod, and I just get spearmen art (which is what happens when the fxsxml isn't found). I'm wondering whether this is also an issue with landmarks. Have you tried using art introduced by a mod? Even just a copy of the vanilla art with a renamed fxsxml?

...The weird part is, when I activate a unit mod using the XML method and look at Civ5DebugDatabase.db, the entries from Civ5ArtDefines_UnitMembers.xml aren't injected into the corresponding ArtDefine tables. Worse, I can't even find where in the database the entries in Civ5ArtDefines_Units.xml are supposed to go (e.g., Formation, DamageStates, MemberCount), let alone where they ended up. Is there another database besides the ones in the cache folder?
 
Have you tried using art introduced by a mod? Even just a copy of the vanilla art with a renamed fxsxml?

Yes, that's exactly what I did in post #9 (renamed fxsxml and all downstream art assets).

...The weird part is, when I activate a unit mod using the XML method and look at Civ5DebugDatabase.db, the entries from Civ5ArtDefines_UnitMembers.xml aren't injected into the corresponding ArtDefine tables. Worse, I can't even find where in the database the entries in Civ5ArtDefines_Units.xml are supposed to go (e.g., Formation, DamageStates, MemberCount), let alone where they ended up. Is there another database besides the ones in the cache folder?

Well, I've been assuming in discussion that unit art works like landmark art, with the one known exception that you can replace unit .xml files but not landmark .xml files. But this is just a theory that I haven't tested. Perhaps unit art is the complete opposite of landmark art: you CAN replace .xml but you CAN'T update DebugDatabase directly. (Before reaching this conclusion, however, you should test to make sure you are able to change landmark art DB as I have done.)

One note: since I've been playing around with this stuff I've checked the "Reload Landmark System" in the mod properties. There is also a "Reload Unit System". In the past, I always had the former unchecked (per advice from other modders) and the latter checked. But I have no idea what these do or are intended to do.
 
Pazyryk,

Can you post the rest of your SQL code, i.e., for tables Builds, Improvements, and Unit_Builds -- did you have to use BuildFeatures or Improvement_ValidTerrains?
 
To add an improvement, you do need to add it as a Unit_Builds. You also need to add some terrain types to Improvement_ValidTerrains to be able to build it anywhere. BuildFeatures is only needed if you want the improvement type to "autochop" a feature.

I don't want to post that particular SQL because I'm trying to keep my mod a bit of a secret, for now at least. (I could post some example SQL if that is what you're looking for. I actually don't use xml anymore except for Text.xml, and only that because you can't add things like Mór or Nezhêlîba in sql.)
 
(I could post some example SQL if that is what you're looking for...)
I'd appreciate it if you could. SQL syntax is a bit strange.

I never got a response. Hey, Pazyryk--or anyone else who's got this figured out--if you've got a bit of time...

I've managed to figure out enough SQL to be medium-dangerous, but I can't seem to replicate your results with improvements. The tables are all being updated properly. My workers can build the thing just fine, it's just that it's invisible.

I tried converting a couple of Civ4 buildings, but I can't even get any of the vanilla CiV ones to work (and I've tried several). If you get a chance, can you post an example, or if it's easier, critique what I've got below:

Spoiler :
Code:
INSERT INTO "ArtDefine_Landmarks" ('Era', 'State', 'Scale', 'ImprovementType', 'LayoutHandler', 'ResourceType', 'Model', 'TerrainContour')
	VALUES ( 'Any', 'Any', 1.0, 'ART_DEF_IMPROVEMENT_TOWER', 'SNAPSHOT', 'ART_DEF_RESOURCE_ALL', 'porcelain_tower2.fxsxml', 1 );
INSERT INTO "ArtDefine_LandmarkTypes" ('Type', 'LandmarkType', 'FriendlyName')
	VALUES ( 'ART_DEF_IMPROVEMENT_TOWER', 'Improvement', 'Tower' );
INSERT INTO "ArtDefine_StrategicView" ('StrategicViewType', 'TileType', 'Asset')
	VALUES ( 'ART_DEF_IMPROVEMENT_TOWER', 'Improvement', 'SV_Landmark.dds' );
-----------
INSERT INTO "BuildFeatures" ('BuildType', 'FeatureType', 'PrereqTech', 'Time', 'Production', 'Cost', 'Remove')
	VALUES ( 'BUILD_TOWER', 'FEATURE_JUNGLE', 0, 100, 0, 0, 0 );
INSERT INTO "BuildFeatures" ('BuildType', 'FeatureType', 'PrereqTech', 'Time', 'Production', 'Cost', 'Remove')
	VALUES ( 'BUILD_TOWER', 'FEATURE_FOREST', 0, 100, 0, 0, 0 );
INSERT INTO "BuildFeatures" ('BuildType', 'FeatureType', 'PrereqTech', 'Time', 'Production', 'Cost', 'Remove')
	VALUES ( 'BUILD_TOWER', 'FEATURE_MARSH', 0, 100, 0, 0, 0 );
INSERT INTO "BuildFeatures" ('BuildType', 'FeatureType', 'PrereqTech', 'Time', 'Production', 'Cost', 'Remove')
	VALUES ( 'BUILD_TOWER', 'FEATURE_FALLOUT', 0, 100, 0, 0, 0 );
-----------
INSERT INTO "Improvement_ValidTerrains" ('ImprovementType', 'TerrainType')
	VALUES ( 'IMPROVEMENT_TOWER', 'TERRAIN_GRASS' );
INSERT INTO "Improvement_ValidTerrains" ('ImprovementType', 'TerrainType')
	VALUES ( 'IMPROVEMENT_TOWER', 'TERRAIN_PLAINS' );
INSERT INTO "Improvement_ValidTerrains" ('ImprovementType', 'TerrainType')
	VALUES ( 'IMPROVEMENT_TOWER', 'TERRAIN_DESERT' );
INSERT INTO "Improvement_ValidTerrains" ('ImprovementType', 'TerrainType')
	VALUES ( 'IMPROVEMENT_TOWER', 'TERRAIN_TUNDRA' );
INSERT INTO "Improvement_ValidTerrains" ('ImprovementType', 'TerrainType')
	VALUES ( 'IMPROVEMENT_TOWER', 'TERRAIN_SNOW' );
INSERT INTO "Improvement_ValidTerrains" ('ImprovementType', 'TerrainType')
	VALUES ( 'IMPROVEMENT_TOWER', 'TERRAIN_HILL' );
-----------
INSERT INTO "Unit_Builds" ('UnitType', 'BuildType')
	VALUES ( 'UNIT_WORKER', 'BUILD_TOWER' );
-----------
INSERT INTO "Builds" ('Type', 'Description', 'Help', 'DisabledHelp', 'Recommendation', 'HotKey', 'HotKeyAlt', 'HotKeyPriority', 'HotKeyPriorityAlt', 'OrderPriority', 'AltDown', 'AltDownAlt', 'ShiftDown', 'ShiftDownAlt', 'CtrlDown', 'CtrlDownAlt', 'Time', 'Cost', 'CostIncreasePerImprovement', 'Kill', 'Repair', 'RemoveRoute', 'PrereqTech', 'ImprovementType', 'RouteType', 'EntityEvent', 'IconIndex', 'IconAtlas')
	SELECT ("BUILD_TOWER"), ("Test Tower Build"), "Help", "DisabledHelp", "Recommendation", ("KB_Z"), "HotKeyAlt", "HotKeyPriority", "HotKeyPriorityAlt", "OrderPriority", "AltDown", "AltDownAlt", "ShiftDown", "ShiftDownAlt", "CtrlDown", "CtrlDownAlt", "Time", "Cost", "CostIncreasePerImprovement", "Kill", "Repair", "RemoveRoute", "PrereqTech", ("IMPROVEMENT_TOWER"), "RouteType", "EntityEvent", (54), "IconAtlas"
	FROM "Builds" WHERE (Type = "BUILD_FARM");
INSERT INTO "Improvements" ('Type', 'Description', 'Civilopedia', 'Help', 'ArtDefineTag', 'WorldSoundscapeAudioScript', 'ImprovementPillage', 'ImprovementUpgrade', 'SpecificCivRequired', 'CivilizationType', 'HillsMakesValid', 'FreshWaterMakesValid', 'RiverSideMakesValid', 'NoFreshWater', 'RequiresFlatlands', 'RequiresFlatlandsOrFreshWater', 'RequiresFeature', 'Coastal', 'Water', 'DestroyedWhenPillaged', 'BuildableOnResources', 'BarbarianCamp', 'Goody', 'Permanent', 'OutsideBorders', 'GraphicalOnly', 'CreatedByGreatPerson', 'Culture', 'CultureAdjacentSameType', 'TilesPerGoody', 'GoodyRange', 'FeatureGrowth', 'UpgradeTime', 'RiverSideUpgradeMod', 'CoastalLandUpgradeMod', 'HillsUpgradeMod', 'FreshWaterUpgradeMod', 'DefenseModifier', 'NearbyEnemyDamage', 'PillageGold', 'ResourceExtractionMod', 'GoldMaintenance', 'PortraitIndex', 'IconAtlas')
	SELECT ("IMPROVEMENT_TOWER"), ("Tower"), "Civilopedia", "Help", ("ART_DEF_IMPROVEMENT_TOWER"), "WorldSoundscapeAudioScript", "ImprovementPillage", "ImprovementUpgrade", "SpecificCivRequired", "CivilizationType", "HillsMakesValid", "FreshWaterMakesValid", "RiverSideMakesValid", "NoFreshWater", "RequiresFlatlands", "RequiresFlatlandsOrFreshWater", "RequiresFeature", "Coastal", "Water", "DestroyedWhenPillaged", "BuildableOnResources", "BarbarianCamp", "Goody", "Permanent", "OutsideBorders", "GraphicalOnly", "CreatedByGreatPerson", "Culture", "CultureAdjacentSameType", "TilesPerGoody", "GoodyRange", "FeatureGrowth", "UpgradeTime", "RiverSideUpgradeMod", "CoastalLandUpgradeMod", "HillsUpgradeMod", "FreshWaterUpgradeMod", "DefenseModifier", "NearbyEnemyDamage", "PillageGold", "ResourceExtractionMod", "GoldMaintenance", (36), "IconAtlas"
	FROM "Improvements" WHERE (Type = "IMPROVEMENT_FARM");
-----------

Thanks!
 
Sorry Nutty, got busy with other things and forgot. I'll post some example SQL this weekend

The tables are all being updated properly.
I hate to state the obvious, but if the tables contain the data that your SQL is supposed to add, then your SQL must be working. Something else is wrong. Perhaps what you are putting in the tables. I'm not spotting it now but I'll look again over the weekend.

As I said in one of the dozen posts above, I've been checking "Reload Landmarks" in the mod properties since I've been doing this. Since I haven't gone back and tried unchecking it again, I have no idea whether this might matter.

My only comments on your SQL are stylistic (for now). As I said above, if the changes you want are acurately relfected in the DB tables, then it must be working.
1) You don't need to quote tables and columns that are already defined. I.e., no quotes needed in the "INSERT" line. For that matter, you should not use double quotes at all in SQLite.
2) You can add many rows after an INSERT statement as explained here. You'll see that a lot in my example SQL, with whole tables (>100 rows) added by a single INSERT. It cuts the lines in half and makes it more readable.
3) I see 0 in at least one place that should be NULL (PrereqTech). This might work but it is not what you see in the core tables so you should avoid it. (On the other hand, true and false are entered as 1 and 0 which you have done correctly.)
 
Sorry Nutty, got busy with other things and forgot.
No worries!

As I said in one of the dozen posts above, I've been checking "Reload Landmarks" in the mod properties since I've been doing this. Since I haven't gone back and tried unchecking it again, I have no idea whether this might matter.

Well, that was easy.

Spoiler :


Of course it matters. Duh! I was having CTDs with it on (turns out CiV didn't like the model), so I turned it off while troubleshooting, and never turned it back on.

Thanks for the SQL style tips.

Based on my playing around with this, I uploaded a tiny mod, Smaller Landmarks, that shrinks down resources, features, and improvements to better mesh with R.E.D. unit scaling.

Unfortunately, it really looks like SQL alone doesn't cut it for units.
 
I've been checking "Reload Landmarks" in the mod properties

Tried this last weekend, had no luck (Build resulted in a empty tile, but tool tip was there).
BUT with "Reload Landmarks" on, I've been able to replicate your results
Cool Find!
now to see if I can import a civ4 improvement...
 

Attachments

  • Screen shot 2012-01-29 at 10.05.37 PM.jpg
    Screen shot 2012-01-29 at 10.05.37 PM.jpg
    83.6 KB · Views: 148
I believe Reload Landmarks is known to cause crashes. Ask Spatz about it.
 
I remember him saying something like that too. It would be nice if he elaborated here.

However, it does seem like we've figured out its function. I can't go back to not adding improvements now.

@Nutty, Just out of curiosity, did you have the "Reload Unit System" checked when you failed to add unit art?
 
'Reload Landmark System' is known to cause random crashes when a unit is moving.

I had the same problem as Pouakai : from the day I checked it my mod would crash randomly, it has stopped since I have unchecked Reload Landmark System.

This function may have some utility perhaps included for a later use, but as with a lot of things in Civ 5 modding it seems to be bugged or unusable.
 
Well, it may be fixed. Or not. The patch notes don't always help in these cases. What I can say is that I haven't seen any crashes like that lately. However, I've been doing a lot of Lua coding/debugging so I rarely get past turn 10.
 
@Nutty, Just out of curiosity, did you have the "Reload Unit System" checked when you failed to add unit art?

Unfortunately (for the sake of an easy fix), yes.

EDIT: And with the crazy idea that the unit system really was totally opposite the landmark system, I just tried, and it doesn't work with it unchecked, either.
 
I will do that as soon as someone creates a functional art assent for a new or converted improvement. The process should be identical to unit creation, but that is a process that few have mastered. I am not one of them.

@Pouakai, For a new table or new table column, yes, of course. For an existing table with existing functionality (like unit ArtDef tables) no.

I messed A LONG time ago with trying to add the pyramids as an improvement or even just adding a wonder. The big difference between Civ4 TIs/Wonders/Buildings and Civ5 is that the Civ5 ones appear to have a skeleton.

You are probably getting the unfinished wonder graphic because you are using the original fxsxml which calls for both gr2s and is handled by the wonder generator. So if you create a new fxsxml using only the inished wonder gr2 you'll get the finished wonder.

Not to distract you but (I can't confirm where) I heard that the code to make cottages grow from Civ4 is still in the civ5 code. So its possible to bring those growing tiles back. So you could possible switch the tradepost graphics with cities graphics and have it grow (until someone imports the civ4 graphics).

On another note you can add TIs but does this mean you can add new wonder graphics too? do they look to be handled the same?

Finally, your opening posts makes it sound like you found a bug in the database handling. Is that the case?
 
I can confirm the growth function on improvements still works. I have created forts that grow into citadels after X number of turns
 
Top Bottom