Please help with various sql edits

crimsontrojan

Chieftain
Joined
Aug 13, 2014
Messages
6
Thanks for your time here. I'm a newbie modder with only minimal experience. I can't for the life of me figure out why the few tweaks I'm trying to make below aren't working, given the much more complex things I've implemented just fine.

- Issue
is followed by my attempted sql when relevant.

America - Update home continent fighting bonus to +7 instead of +5

UPDATE ModifierArguments SET Value='7' WHERE ModifierId='COMBAT_BONUS_HOME_CONTINENT_MODIFIER' AND Name = 'Amount';

Spain - Add gold (and/or faith) to international domestic trade routes. Can change international intercontinental gold just fine.

INSERT INTO TraitModifiers
(TraitType, ModifierId)
VALUES ('TRAIT_CIVILIZATION_TREASURE_FLEET', 'TRAIT_INTERCONTINENTAL_DOMESTIC_GOLD') ;

INSERT INTO Modifiers
(ModifierId, ModifierType)
VALUES ('TRAIT_INTERCONTINENTAL_DOMESTIC_GOLD', 'MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD_FOR_DOMESTIC') ;

INSERT INTO ModifierArguments
(ModifierId, Name, Value)
VALUES ('TRAIT_INTERCONTINENTAL_DOMESTIC_GOLD', 'YieldType', 'YIELD_GOLD') ;

INSERT INTO ModifierArguments
(ModifierId, Name, Value)
VALUES ('TRAIT_INTERCONTINENTAL_DOMESTIC_GOLD', 'Value', '2') ;

- I can change civic for Missions, update housing to .5, but can't make Missions only buildable on frontier (like Great Wall) and not adjacent to another Mission (like Sphinx). Tried both UPDATE Improvements and INSERT INTO Improvements

- Also can't make Missions buildable on bonus resources.

INSERT INTO Improvement_ValidResources
( ImprovementType, FeatureType)
VALUES ( 'IMPROVEMENT_MISSION', 'RESOURCE_COPPER') ,
( 'IMPROVEMENT_MISSION', 'RESOURCE_STONE' ) ,
( 'IMPROVEMENT_MISSION', 'RESOURCE_RICE') ,
( 'IMPROVEMENT_MISSION', 'RESOURCE_WHEAT') ,
( 'IMPROVEMENT_MISSION', 'RESOURCE_BANANAS') ,
( 'IMPROVEMENT_MISSION', 'RESOURCE_CATTLE') ,
( 'IMPROVEMENT_MISSION', 'RESOURCE_SHEEP') ,
( 'IMPROVEMENT_MISSION', 'RESOURCE_DEER') ;

General - Make Seaports add 1 trade route.

INSERT INTO Modifier
(ModifierId, ModifierType)
VALUES ('SEAPORT_ADDTRADEROUTE', 'MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_CAPACITY') ;

INSERT INTO ModifierArguments
(ModifierId, Name, Value)
VALUES ('SEAPORT_ADDTRADEROUTE', 'Amount', 1) ;

INSERT INTO BuildingModifiers
(ModifierId, Name)
VALUES ('BUILDING_SEAPORT', 'SEAPORT_ADDTRADEROUTE') ;
 
(1) America - Update home continent fighting bonus to +7 instead of +5 -- updates just fine, at least judging from the DebugGameplay database, without any in-game testing.

(2) Spain - Add gold (and/or faith) to international domestic trade routes.

Code:
INSERT INTO ModifierArguments
(ModifierId, Name, Value)
VALUES ('TRAIT_INTERCONTINENTAL_DOMESTIC_GOLD', 'Value' 'Amount', '2') ;

-- should be 'AMOUNT' instead of 'VALUE'.

(3) Missions only buildable on frontier (like Great Wall) and not adjacent to another Mission (like Sphinx) -- the following code updates DebugGameplay correctly:

Code:
UPDATE Improvements SET BuildOnFrontier='1' WHERE ImprovementType='IMPROVEMENT_MISSION';
UPDATE Improvements SET SameAdjacentValid='0' WHERE ImprovementType='IMPROVEMENT_MISSION';

(4) Missions buildable on bonus resources.

Code:
INSERT INTO Improvement_ValidResources (ImprovementType,FeatureType ResourceType,MustRemoveFeature) VALUES
('IMPROVEMENT_MISSION','RESOURCE_DEER',0),
('IMPROVEMENT_MISSION','RESOURCE_COPPER',0),
('IMPROVEMENT_MISSION','RESOURCE_STONE',0),
('IMPROVEMENT_MISSION','RESOURCE_RICE',0),
('IMPROVEMENT_MISSION','RESOURCE_WHEAT',0),
('IMPROVEMENT_MISSION','RESOURCE_BANANAS',0),
('IMPROVEMENT_MISSION','RESOURCE_CATTLE',0),
('IMPROVEMENT_MISSION','RESOURCE_SHEEP',0);

-- TWO ISSUES:
(a) should be 'ResourceType' instead of 'FeatureType' in this table. I've also inserted values for feature removal to avoid removing forests, jungles, etc.
(b) you had a problem with syntax - "" - after struggling with it for 10 minutes, I retyped the whole entry and it worked without a hitch. Don't know where the syntax error was exactly, but it's gone now. Database updates correctly.

(5) Make Seaports add 1 trade route

Code:
INSERT INTO Modifiers (ModifierId,ModifierType)
VALUES ('SEAPORT_ADDTRADEROUTE','MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_CAPACITY');

INSERT INTO ModifierArguments
(ModifierId,Name,Value)
VALUES ('SEAPORT_ADDTRADEROUTE','Amount',1);

INSERT INTO BuildingModifiers
(BuildingType,ModifierId)
VALUES ('BUILDING_SEAPORT','SEAPORT_ADDTRADEROUTE');

Once again, you had a syntax issue somewhere in your code which I did not go hunting for. I retyped the code and fixed two things. In BuildingModifiers Table, the columns are BuildingType, ModifierId and not ModifierId, Name. The code updates correctly now.

Watch out for those ' ' and " ". They are vicious. ;)
 
Once again, you had a syntax issue somewhere in your code which I did not go hunting for. I retyped the code and fixed two things. In BuildingModifiers Table, the columns are BuildingType, ModifierId and not ModifierId, Name. The code updates correctly now.

Watch out for those ' ' and " ". They are vicious. ;)

Thank you so much for taking time here Gleb Bazov!

have updated to using Notepad++ and that helps with the syntax, but I'm sure I'll continue to destroy otherwise perfectly obvious code...
 
Back
Top Bottom