Magma_Dragoon
Reploid
- Joined
- May 10, 2008
- Messages
- 2,354
I'd like to add a new improvement, strategic mine, that is built on strategic mineral resources with the goal of giving encampments an adjacency bonus to this improvement. The strategic mine will look like an ordinary mine and unlocks with mining, but can be built on undiscovered strategic minerals. The game prevents forest being planted on undiscovered uranium, so I suspect this will work. But...
If I try to load this mod, it fails and goes back to the main menu. Modding.log shows:
Status: Applying Component - NewAction
[134057.982] Status: Creating database save point.
[134057.983] Status: UpdateDatabase - Loading districtadjacency.sql
[134057.983] ERROR: Failed to release save point.
[134057.993] Warning: Error when calling IComponentHandler::ApplyComponent.
[134058.009] Status: Modding Framework - Finished Apply Components
[134058.009] ERROR: Failed to apply enabled components.
Thing is, when I run the exact same sql against the debug db, it works! I must be breaking a rule that isn't enforced at the database level, and I can't infer anything from the logged error. I was flummoxed, so I looked up a mod that added new improvements and noticed it had a name for the new improvement. I tried adding one (copypasted from that mod). Fixes nothing, and logs an error of it's own (non fatal) when the sql file is removed from the update action.
[138079.636] Status: Applying Component - NewAction
[138079.636] Status: Creating database save point.
[138079.636] Status: UpdateDatabase - Loading name.xml
[138079.636] Warning: UpdateDatabase - Error Loading XML.
[138079.636] Status: Successfully released save point.
[138079.636] Status: Applied component to game.
[138079.652] Status: Modding Framework - Finished Apply Components
[138079.652] Status: Applied all components of enabled mods.
[138079.702] Status: Initializing Gameplay DLL.
[138079.765] Status: Reloading Tuner states.
[138079.766] Status: Saving a debug version of the gameplay database.
[138080.371] Status: Performing post configure processing.
[138080.684] Status: Successfully reconfigured game.
I don't know what table text entries go in, so I can't look in the debug db if this actually loads or is discarded.
I'm flummoxed again.
Code:
insert into Improvements (ImprovementType,Name,PrereqTech,Buildable,Description,PlunderType,PlunderAmount,Icon)
values ('IMPROVEMENT_STRATEGIC_MINE','LOC_IMPROVEMENT_MINE_NAME','TECH_MINING',1,'LOC_IMPROVEMENT_MINE_DESCRIPTION','PLUNDER_SCIENCE',25,'ICON_IMPROVEMENT_MINE');
If I try to load this mod, it fails and goes back to the main menu. Modding.log shows:
Status: Applying Component - NewAction
[134057.982] Status: Creating database save point.
[134057.983] Status: UpdateDatabase - Loading districtadjacency.sql
[134057.983] ERROR: Failed to release save point.
[134057.993] Warning: Error when calling IComponentHandler::ApplyComponent.
[134058.009] Status: Modding Framework - Finished Apply Components
[134058.009] ERROR: Failed to apply enabled components.
Thing is, when I run the exact same sql against the debug db, it works! I must be breaking a rule that isn't enforced at the database level, and I can't infer anything from the logged error. I was flummoxed, so I looked up a mod that added new improvements and noticed it had a name for the new improvement. I tried adding one (copypasted from that mod). Fixes nothing, and logs an error of it's own (non fatal) when the sql file is removed from the update action.
Code:
<?xml version="1.0" encoding="utf-8"?>
<GameData>
<BaseGameText>
<Row Tag="LOC_IMPROVEMENT_STRATEGIC_MINE_NAME" >
<Text>Mine</Text>
<Gender>Masculine:no_article</Gender>
</Row>
</BaseGameText>
</GameData>
[138079.636] Status: Applying Component - NewAction
[138079.636] Status: Creating database save point.
[138079.636] Status: UpdateDatabase - Loading name.xml
[138079.636] Warning: UpdateDatabase - Error Loading XML.
[138079.636] Status: Successfully released save point.
[138079.636] Status: Applied component to game.
[138079.652] Status: Modding Framework - Finished Apply Components
[138079.652] Status: Applied all components of enabled mods.
[138079.702] Status: Initializing Gameplay DLL.
[138079.765] Status: Reloading Tuner states.
[138079.766] Status: Saving a debug version of the gameplay database.
[138080.371] Status: Performing post configure processing.
[138080.684] Status: Successfully reconfigured game.
I don't know what table text entries go in, so I can't look in the debug db if this actually loads or is discarded.
I'm flummoxed again.
Last edited: