How to delete stuff

My main reason for deleting a whole building class is to avoid conflict between mods; imagine a player who's installed a multi-building modpack and likes most of the content, but prefers my version of the Brewery. Trouble is, that other modpack has a Brewery of its own included (with different stats); instead of letting duplicates exist in otherwise compatible mods, deleting a nonstandard building class seems workable IMO. (If you had a similar problem and no mod-merging tool, how would you resolve the conflict?)
 
In that situation delete the buildingclass and then use two DMR tags to clean up.

But note, your mod is dependant on load order - works if your mod loads after the buildings collection mod; doesn't work if you mod loads before the buildings collection mod.
 
@WHoward69: You're right; my .modinfo file would need a reference to whichever mod had the conflicting item (to make sure that one loads first). As for the two DMR tags -- I'm guessing that these are the right places to clean up, after I delete the building class?

Code:
<!-- Close the holes in all relevant tables -->

<DeleteMissingReferences table="BuildingClasses" column="Type"/>
<DeleteMissingReferences table="Buildings" column="Type"/>


EDIT: After deleting entries from the in-game text, ls it necessary to delete missing references anywhere? If so, what would the right syntax be? My current project includes this code--


Spoiler :
Code:
	<Language_en_US>
	
	
		<Delete Tag="TXT_KEY_BUILDING_GOLDSMITH" />
		<Delete Tag="TXT_KEY_BUILDING_GOLDSMITH_HELP" />
		<Delete Tag="TXT_KEY_BUILDING_GOLDSMITH_STRATEGY" />
		<Delete Tag="TXT_KEY_BUILDING_GOLDSMITH_PEDIA" />
		
		<Delete Tag="TXT_KEY_BUILDING_JEWELER" />
		<Delete Tag="TXT_KEY_BUILDING_JEWELER_HELP" />
		<Delete Tag="TXT_KEY_BUILDING_JEWELER_STRATEGY" />
		<Delete Tag="TXT_KEY_BUILDING_JEWELER_PEDIA" />
		
		<Delete Tag="TXT_KEY_RESOURCE_AMBER" />
		<Delete Tag="TXT_KEY_RESOURCE_AMBERX" />
		<Delete Tag="TXT_KEY_RESOURCE_AMBERZ" />
		<Delete Tag="TXT_KEY_CIV5_RESOURCE_AMBERZ" />
		<Delete Tag="TXT_KEY_CIV5_RESOURCE_AMBER_TEXT" />
		<Delete Tag="TXT_KEY_CIV5_RESOURCE_AMBERX_TEXT"/>
		<Delete Tag="TXT_KEY_CIV5_RESOURCE_AMBERZ_TEXT"/>

<!-- several entries deleted for space -->

	
	</Language_en_US>

Will deleting these items leave anything behind to clean up?
 
In that situation delete the buildingclass and then use two DMR tags to clean up.

But note, your mod is dependant on load order - works if your mod loads after the buildings collection mod; doesn't work if you mod loads before the buildings collection mod.
How do you delete missing references with SQL?
here is what I have right now:

Code:
DELETE FROM BuildingClasses
    (Type)
VALUES
    ('BUILDINGCLASS_BAR');

DELETE FROM BuildingClasses
WHERE Type NOT IN (SELECT ??? FROM ?????????);

INSERT INTO BuildingClasses
    (Type, DefaultBuilding, Description)
VALUES
    ('BUILDINGCLASS_BAR', 'BUILDING_BAR', 'TXT_KEY_BUILDING_BAR');

It should work like this (this example doesn't delete missing references however):
Code:
<GameData>
    <BuildingClasses>
        <!-- Deletes duplicate buildings from other mods -->
        <Delete Type="BUILDINGCLASS_BAR"/>
        <Row>
            <Type>BUILDINGCLASS_BAR</Type>
            <DefaultBuilding>BUILDING_BAR</DefaultBuilding>
            <Description>TXT_KEY_BUILDING_BAR</Description>
        </Row>
    </BuildingClasses>
 
There is no SQL equivalent of DMR, you would need to know all tables that could be affected (including those added by mods) and write SQL for each of them, eg

DELETE FROM Building_Flavors WHERE BuildingType NOT IN (SELECT Type FROM Buildings);
 
Back
Top Bottom