Advertisement
Civilization Fanatics' Center

Go Back   Civilization Fanatics' Forums > CIVILIZATION V > Civ5 - Creation & Customization

Notices

Reply
 
Thread Tools
Old Jan 21, 2012, 04:35 AM   #41
Nutty
Deity
 
Nutty's Avatar
 
Join Date: Mar 2011
Location: Orange County, California, U.S.A.
Posts: 2,088
Quote:
Originally Posted by Pazyryk View Post
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" 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?
Nutty is offline   Reply With Quote
Old Jan 21, 2012, 09:27 AM   #42
Pazyryk
Deity
 
Pazyryk's Avatar
 
Join Date: Jun 2008
Posts: 3,584
Quote:
Originally Posted by Nutty View Post
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).

Quote:
Originally Posted by Nutty View Post
...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 is offline   Reply With Quote
Old Jan 21, 2012, 05:20 PM   #43
Nutty
Deity
 
Nutty's Avatar
 
Join Date: Mar 2011
Location: Orange County, California, U.S.A.
Posts: 2,088
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?
Nutty is offline   Reply With Quote
Old Jan 21, 2012, 06:26 PM   #44
Pazyryk
Deity
 
Pazyryk's Avatar
 
Join Date: Jun 2008
Posts: 3,584
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 Mr or Nezhlba in sql.)
Pazyryk is offline   Reply With Quote
Old Jan 22, 2012, 01:41 AM   #45
Nutty
Deity
 
Nutty's Avatar
 
Join Date: Mar 2011
Location: Orange County, California, U.S.A.
Posts: 2,088
Quote:
Originally Posted by Pazyryk View Post
(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.
Nutty is offline   Reply With Quote
Old Jan 27, 2012, 04:17 AM   #46
Nutty
Deity
 
Nutty's Avatar
 
Join Date: Mar 2011
Location: Orange County, California, U.S.A.
Posts: 2,088
Quote:
Originally Posted by Pazyryk View Post
(I could post some example SQL if that is what you're looking for...)
Quote:
Originally Posted by Nutty View Post
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!
Nutty is offline   Reply With Quote
Old Jan 27, 2012, 09:07 AM   #47
Pazyryk
Deity
 
Pazyryk's Avatar
 
Join Date: Jun 2008
Posts: 3,584
Sorry Nutty, got busy with other things and forgot. I'll post some example SQL this weekend

Quote:
Originally Posted by Nutty View Post
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.)
Pazyryk is offline   Reply With Quote
Old Jan 28, 2012, 02:54 AM   #48
Nutty
Deity
 
Nutty's Avatar
 
Join Date: Mar 2011
Location: Orange County, California, U.S.A.
Posts: 2,088
Quote:
Originally Posted by Pazyryk View Post
Sorry Nutty, got busy with other things and forgot.
No worries!

Quote:
Originally Posted by Pazyryk View Post
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.
Nutty is offline   Reply With Quote
Old Jan 29, 2012, 06:07 PM   #49
Pazyryk
Deity
 
Pazyryk's Avatar
 
Join Date: Jun 2008
Posts: 3,584
Glad to see its working for someone else. Too bad units seem to work differently.

Per your request, I've posted some example SQL in my tutorial here (not really related to the present thread).
Pazyryk is offline   Reply With Quote
Old Jan 29, 2012, 08:53 PM   #50
human machine
Chieftain
 
human machine's Avatar
 
Join Date: Jan 2009
Posts: 32
Quote:
Originally Posted by Pazyryk View Post
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...
Attached Thumbnails
Click image for larger version

Name:	Screen shot 2012-01-29 at 10.05.37 PM.jpg
Views:	88
Size:	83.6 KB
ID:	312523  
human machine is offline   Reply With Quote
Old Jan 29, 2012, 08:57 PM   #51
Putmalk
Deity
 
Putmalk's Avatar
 
Join Date: Sep 2010
Location: New York
Posts: 2,246
I believe Reload Landmarks is known to cause crashes. Ask Spatz about it.
__________________
Mod Creator
Check out Civ IV Diplomacy Features in Civ V!

Check me out on Twitter (@Putmalk) and Reddit (/u/Putmalk)! Feel free to shoot me a message anytime!

Check out my youtube channel here.
Putmalk is offline   Reply With Quote
Old Jan 29, 2012, 09:51 PM   #52
Pazyryk
Deity
 
Pazyryk's Avatar
 
Join Date: Jun 2008
Posts: 3,584
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?

Last edited by Pazyryk; Jan 29, 2012 at 09:57 PM.
Pazyryk is offline   Reply With Quote
Old Jan 29, 2012, 10:52 PM   #53
FiresForever
Prince
 
FiresForever's Avatar
 
Join Date: Sep 2010
Posts: 584
A quick google search gave this post by Thal about CTD and activating the reload landmark system, i really hope that firaxis patched it:

http://forums.civfanatics.com/showthread.php?t=431714

and some more stuff here:

http://forums.2kgames.com/showthread...s-with-uploads
FiresForever is offline   Reply With Quote
Old Jan 29, 2012, 11:09 PM   #54
Pouakai
Tangaroa

 
Pouakai's Avatar
 
Join Date: Jun 2010
Location: The Republic of New Zealand
Posts: 6,064
Images: 24
I used to check 'Reload Landmark System' when making the wonders, but since I stopped I've had nowhere near the number of crashes I used to
Pouakai is offline   Reply With Quote
Old Jan 30, 2012, 03:06 AM   #55
Hulfgar
Emperor
 
Hulfgar's Avatar
 
Join Date: Mar 2008
Location: France
Posts: 1,300
'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.
Hulfgar is offline   Reply With Quote
Old Jan 30, 2012, 08:27 AM   #56
Pazyryk
Deity
 
Pazyryk's Avatar
 
Join Date: Jun 2008
Posts: 3,584
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.
Pazyryk is offline   Reply With Quote
Old Jan 30, 2012, 04:09 PM   #57
Nutty
Deity
 
Nutty's Avatar
 
Join Date: Mar 2011
Location: Orange County, California, U.S.A.
Posts: 2,088
Quote:
Originally Posted by Pazyryk View Post
@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.

Last edited by Nutty; Jan 30, 2012 at 04:21 PM.
Nutty is offline   Reply With Quote
Old Jan 31, 2012, 03:06 PM   #58
Ekmek
on steam: ekmek_e
 
Ekmek's Avatar
 
Join Date: Aug 2002
Location: San Diego, California
Posts: 5,877
Quote:
Originally Posted by Pazyryk View Post
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?
Ekmek is offline   Reply With Quote
Old Jan 31, 2012, 04:26 PM   #59
Sneaks
Brooklyn Bum
 
Sneaks's Avatar
 
Join Date: Oct 2010
Location: NYC
Posts: 1,876
I can confirm the growth function on improvements still works. I have created forts that grow into citadels after X number of turns
Sneaks is offline   Reply With Quote
Old Jan 31, 2012, 04:50 PM   #60
Ekmek
on steam: ekmek_e
 
Ekmek's Avatar
 
Join Date: Aug 2002
Location: San Diego, California
Posts: 5,877
Quote:
Originally Posted by Sneaks View Post
I can confirm the growth function on improvements still works. I have created forts that grow into citadels after X number of turns
do you have that in a mod somewhere?
Ekmek is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION V > Civ5 - Creation & Customization > New improvement art! You don't need to replace civ5artdefines_landmarks.xml

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Advertisement

All times are GMT -6. The time now is 11:10 PM.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
This site is copyright Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR