• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days. For more updates please see here.

Farm Replacement Won't Show Up!

Since the last patch(That fixed the CTD) The Farm Improvement acts funny when you try to hook it into any other improvement. I tried with my resource mod to use the farm art defines for 2 of my resources and lets just say its not pretty. I had to revert back to using Luigi's 3D Model fix. Which clips well now bah the roads been under the improvement which is not really a problem.
 
Since the last patch(That fixed the CTD) The Farm Improvement acts funny when you try to hook it into any other improvement. I tried with my resource mod to use the farm art defines for 2 of my resources and lets just say its not pretty. I had to revert back to using Luigi's 3D Model fix. Which clips well now bah the roads been under the improvement which is not really a problem.

Before I use a new improvement I want to make sure there's no other option, so I'd rather make a new art define as Snarko suggested, but I can't find those files.
 
Unless you find something I missed I doubt it will work, I have tried. But, they are located in the Database(get an SQL addon for Firefox or Download SQLlteSpy) they are listed as ArtDefine_ see Screenshot.

EDIT:
Actualy you may well get it to work, I was using custom resource graphics and that might well have played a part in the issues I had. Good luck :)
 
Unless you find something I missed I doubt it will work, I have tried. But, they are located in the Database(get an SQL addon for Firefox or Download SQLlteSpy) they are listed as ArtDefine_ see Screenshot.

EDIT:
Actualy you may well get it to work, I was using custom resource graphics and that might well have played a part in the issues I had. Good luck :)

The SQL in that image looks a bit funny. How would I code it?
 
The SQL in that image looks a bit funny. How would I code it?
Code:
INSERT INTO ArtDefine_Landmarks (Era, State, Scale, ImprovementType,
    LayoutHandler, ResourceType, Model, TerrainContour, Tech)
    SELECT Era, State, Scale, 'ART_DEF_IMPROVEMENT_KIBBUTZ',
    LayoutHandler, ResourceType, Model, TerrainContour, Tech
    FROM ArtDefine_Landmarks
    WHERE ImprovementType = 'ART_DEF_IMPROVEMENT_FARM';
INSERT INTO ArtDefine_LandmarkTypes (Type, LandmarkType, FriendlyName)
    VALUES ('ART_DEF_IMPROVEMENT_KIBBUTZ', 'Improvement', 'Kibbutz');
EDIT: And of course, you need to remember to change your ArtDefineTag entry in the Improvements table from ART_DEF_IMPROVEMENT_FARM to ART_DEF_IMPROVEMENT_KIBBUTZ.

I'm not sure this method will work where reusing the farm improvement art define doesn't, but I suppose it's worth a try.

EDIT #2: Fixed syntax error.

EDIT #3: The SV entry would be:
Code:
INSERT INTO ArtDefine_StrategicView (StrategicViewType, TileType, Asset)
    VALUES ('ART_DEF_IMPROVEMENT_KIBBUTZ', 'Improvement', 'SV_Farm.dds');
(or if you prefer, just use XML for this and LandmarkTypes.)
 
Code:
INSERT INTO ArtDefine_Landmarks (Era, State, Scale, ImprovementType,
    LayoutHandler, ResourceType, Model, TerrainContour, Tech)
    SELECT Era, State, Scale, 'ART_DEF_IMPROVEMENT_KIBBUTZ',
    LayoutHandler, ResourceType, Model, TerrainContour, Tech
    FROM ArtDefine_Landmarks
    WHERE ImprovementType = 'ART_DEF_IMPROVEMENT_FARM';
INSERT INTO ArtDefine_LandmarkTypes (Type, LandmarkType, FriendlyName)
    VALUES 'ART_DEF_IMPROVEMENT_KIBBUTZ', 'Improvement', 'Kibbutz';
EDIT: And of course, you need to remember to change your ArtDefineTag entry in the Improvements table from ART_DEF_IMPROVEMENT_FARM to ART_DEF_IMPROVEMENT_KIBBUTZ.

I'm not sure this method will work where reusing the farm improvement art define doesn't, but I suppose it's worth a try.

I'm trying to test it out, but this showed up in the log files:
Code:
near "'ART_DEF_IMPROVEMENT_KIBBUTZ'": syntax error
 
Oops. The values clause should have parentheses around the parameters:
Code:
INSERT INTO ArtDefine_LandmarkTypes (Type, LandmarkType, FriendlyName)
    VALUES ('ART_DEF_IMPROVEMENT_KIBBUTZ', 'Improvement', 'Kibbutz');
 
Hmm... there may be a table for SV that I've neglected, but it sounds like you're going to have to use a farm replacement.

Just for fun, what happens if you change LayoutHandler to 'RANDOM'?
 
You can try SNAPSHOT too. They are both Valid.

EDIT: And yes there is a Strategic View art define:

ArtDefine_StrategicView is the database, with values : StrategicViewType, TileType, Asset
 
To be clear, what we're saying is change the top SQL command to:
Code:
INSERT INTO ArtDefine_Landmarks (Era, State, Scale, ImprovementType,
    LayoutHandler, ResourceType, Model, TerrainContour, Tech)
    SELECT Era, State, Scale, 'ART_DEF_IMPROVEMENT_KIBBUTZ',
    [COLOR=Red]'RANDOM'[/COLOR], ResourceType, Model, TerrainContour, Tech
    FROM ArtDefine_Landmarks
    WHERE ImprovementType = 'ART_DEF_IMPROVEMENT_FARM';
(or instead try 'SNAPSHOT'). Again, a shot in the dark.


The SV entry would be:
Code:
INSERT INTO ArtDefine_StrategicView (StrategicViewType, TileType, Asset)
    VALUES ('ART_DEF_IMPROVEMENT_KIBBUTZ', 'Improvement', 'SV_Farm.dds');
(or if you prefer, just use XML for this and LandmarkTypes.)
 
Wow, seems I'm quite late to the thread, but I actually know what is happening (and quite sadly, haven't found a way of fixing it myself)

So yeah, the issue is actually older than the Farm bug Fix. And yes, it is related to the Farm's Layout Handler.

The Farm's Layout Handler is actually a hugely hardcoded thing, (and is, after all, what was causing the Farm Crash bug), that does a huge lot of things. It sets up randomly the Farm huts, it also sets the Farm huts change in the era. It also adds the crops (which are not part of the Farm hut model) and sets the crops to change with time (they grow sometimes becoming more colorful, very hard to notice). While adding the crops it also allows them to fit when another farm is next.

So yeah. When you use the same ArtDefine of the farm on another improvement (even if its one that exists before the mod), it will not show anything because its not "IMPROVEMENT_FARM", so there's really no way of making a new improvement use the farm graphics. (That's actually that made me start the whole model fix, I wanted to have an improvement with a farm model)

Setting the layout to RANDOM or SNAPSHOT as Nutty suggests; will only result in showing the huts (because that's the only model being referenced, the crops are not a model per se). So yeah, there's really no way of making a different improvement other than IMPROVEMENT_FARM show crops. If you delete Improvement_Farm and then make your new improvement be "IMPROVEMENT_FARM", it works, but of course then you can't have normal farms.

So, my suggestion, use another model for your Kibbutz.
 
Will the Fall patch fix this?
No. Now that the crash has been fixed, I'm sure they don't consider this a bug.

Unique improvements don't replace other improvements, i.e., the Dutch can potentially build farms or polders on flood plain tiles (and you often do have to replace the one with the other, since you don't get polders until you research Guilds).
 
No. Now that the crash has been fixed, I'm sure they don't consider this a bug.

Unique improvements don't replace other improvements, i.e., the Dutch can potentially build farms or polders on flood plain tiles (and you often do have to replace the one with the other, since you don't get polders until you research Guilds).

Well that stinks . . . I looked at Leugi's models but they have some issues. :(
 
I looked at Leugi's models but they have some issues.

Not as many as the Vanilla, at least they show up, if you really don't like them that much take a look at whowards pick and mix mods, there is a farm replacement there too, it uses some of the re skinned resource graphics I made for CCTP.
 
Not as many as the Vanilla, at least they show up, if you really don't like them that much take a look at whowards pick and mix mods, there is a farm replacement there too, it uses some of the re skinned resource graphics I made for CCTP.

Looked at Whowards but i'm a bit confused.

-- Create an Arable improvement type
INSERT INTO ArtDefine_LandmarkTypes(Type, LandmarkType, FriendlyName)
SELECT 'ART_DEF_IMPROVEMENT_ARABLE', 'Improvement', 'Arable';

-- The following block makes all Farms look the same (using the building graphics from the Wheat farm), but changes them between the Renaissance and Industrial eras
--INSERT INTO ArtDefine_Landmarks(Era, State, Scale, ImprovementType, LayoutHandler, ResourceType, Model, TerrainContour)
--SELECT 'Ancient', 'UnderConstruction', 1.5, 'ART_DEF_IMPROVEMENT_ARABLE', 'SNAPSHOT', 'ART_DEF_RESOURCE_ALL', 'HB_Medieval_Farm.fxsxml', 1 UNION ALL
--SELECT 'Ancient', 'Constructed', 1.5, 'ART_DEF_IMPROVEMENT_ARABLE', 'SNAPSHOT', 'ART_DEF_RESOURCE_ALL', 'Medieval_Farm.fxsxml', 1 UNION ALL
--SELECT 'Ancient', 'Pillaged', 1.5, 'ART_DEF_IMPROVEMENT_ARABLE', 'SNAPSHOT', 'ART_DEF_RESOURCE_ALL', 'PL_Medieval_Farm.fxsxml', 1 UNION ALL
--SELECT 'Industrial', 'UnderConstruction', 1.5, 'ART_DEF_IMPROVEMENT_ARABLE', 'SNAPSHOT', 'ART_DEF_RESOURCE_ALL', 'HB_Modern_Farm.fxsxml', 1 UNION ALL
--SELECT 'Industrial', 'Constructed', 1.5, 'ART_DEF_IMPROVEMENT_ARABLE', 'SNAPSHOT', 'ART_DEF_RESOURCE_ALL', 'Modern_Farm.fxsxml', 1 UNION ALL
--SELECT 'Industrial', 'Pillaged', 1.5, 'ART_DEF_IMPROVEMENT_ARABLE', 'SNAPSHOT', 'ART_DEF_RESOURCE_ALL', 'PL_Modern_Farm.fxsxml', 1;

-- The following two blocks use CCTP resources to create four Farms, one (barley) for Wheat resources and three that display randomly
INSERT INTO ArtDefine_Landmarks(Era, State, Scale, ImprovementType, LayoutHandler, ResourceType, Model, TerrainContour)
SELECT 'Any', 'UnderConstruction', 0.96, 'ART_DEF_IMPROVEMENT_ARABLE', 'SNAPSHOT', 'ART_DEF_RESOURCE_WHEAT', 'ART/Barley/HB_Plantation_MID_Barley.fxsxml', 1 UNION ALL
SELECT 'Any', 'Constructed', 0.96, 'ART_DEF_IMPROVEMENT_ARABLE', 'SNAPSHOT', 'ART_DEF_RESOURCE_WHEAT', 'ART/Barley/Plantation_MID_Barley.fxsxml', 1 UNION ALL
SELECT 'Any', 'Pillaged', 0.96, 'ART_DEF_IMPROVEMENT_ARABLE', 'SNAPSHOT', 'ART_DEF_RESOURCE_WHEAT', 'ART/Barley/PL_Plantation_MID_Barley.fxsxml', 1;

-- Use the same (generic) Under Construction and Pillaged graphics, otherwise the Constructed farm is different from what was being built!
INSERT INTO ArtDefine_Landmarks(Era, State, Scale, ImprovementType, LayoutHandler, ResourceType, Model, TerrainContour)
SELECT 'Any', 'UnderConstruction', 0.96, 'ART_DEF_IMPROVEMENT_ARABLE', 'RANDOM', 'ART_DEF_RESOURCE_ALL', 'ART/Tobacco/HB_Plantation_MID_Tobacco.fxsxml', 1 UNION ALL
SELECT 'Any', 'Constructed', 0.96, 'ART_DEF_IMPROVEMENT_ARABLE', 'RANDOM', 'ART_DEF_RESOURCE_ALL', 'ART/Corn/Plantation_MID_Corn.fxsxml', 1 UNION ALL
SELECT 'Any', 'Constructed', 0.96, 'ART_DEF_IMPROVEMENT_ARABLE', 'RANDOM', 'ART_DEF_RESOURCE_ALL', 'ART/Mango/Plantation_MID_Mango.fxsxml', 1 UNION ALL
SELECT 'Any', 'Constructed', 0.96, 'ART_DEF_IMPROVEMENT_ARABLE', 'RANDOM', 'ART_DEF_RESOURCE_ALL', 'ART/Tobacco/Plantation_MID_Tobacco.fxsxml', 1 UNION ALL
SELECT 'Any', 'Pillaged', 0.96, 'ART_DEF_IMPROVEMENT_ARABLE', 'RANDOM', 'ART_DEF_RESOURCE_ALL', 'ART/Mango/PL_Plantation_MID_Mango.fxsxml', 1;

INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset)
SELECT 'ART_DEF_IMPROVEMENT_ARABLE', 'Improvement', 'SV_Farm.dds';

-- Now set the Farm to use the new Arable improvement graphics
UPDATE Improvements SET ArtDefineTag='ART_DEF_IMPROVEMENT_ARABLE' WHERE ArtDefineTag='ART_DEF_IMPROVEMENT_FARM';

-- Finally (paranoia) delete the Farm improvement graphics
DELETE FROM ArtDefine_LandmarkTypes WHERE Type='ART_DEF_IMPROVEMENT_FARM';
DELETE FROM ArtDefine_Landmarks WHERE ImprovementType='ART_DEF_IMPROVEMENT_FARM';
DELETE FROM ArtDefine_StrategicView WHERE StrategicViewType='ART_DEF_IMPROVEMENT_FARM';

Is it adding new resources or is that just for resource differences? Also, how would I edit this to make a new improvement, and not update the farm?
 
In general, here's a great resource for CiV table manipulation: XML/SQL Cheat Sheet

Whoward69's code adds new art defines, and assigns those to the wheat and standard farms. The "new" resources are just random differences for flavor. You need only change FARM to KIBBUTZ in the second to last block, and delete the last block altogether.
 
In general, here's a great resource for CiV table manipulation: XML/SQL Cheat Sheet

Whoward69's code adds new art defines, and assigns those to the wheat and standard farms. The "new" resources are just random differences for flavor. You need only change FARM to KIBBUTZ in the second to last block, and delete the last block altogether.

My mod is having huge issues with this in it.
 
Back
Top Bottom