Hi all,
I am in the process of creating a few mods to add difficulty creating and maintaining units. One is a simple mod to increase maintenance costs for units based on promotion class, have military units cost population, and make two new projects for early game when there are not many build options. However the increase in maintenance cost only updates the database for certain units. My best guess is a mod conflict, but don't know. any thoughts?
I am in the process of creating a few mods to add difficulty creating and maintaining units. One is a simple mod to increase maintenance costs for units based on promotion class, have military units cost population, and make two new projects for early game when there are not many build options. However the increase in maintenance cost only updates the database for certain units. My best guess is a mod conflict, but don't know. any thoughts?
Code:
/*
Use production to support scientific or cultural endeavors for early game balance when few units can be built
1. project for culture from production
2. project for science from production
3. projects become obsolete when district built (not possible yet)
*/
INSERT INTO Types (
Type,
Kind
) VALUES (
"PROJECT_SUPPORT_SCIENCE",
"KIND_PROJECT"
);
INSERT INTO Projects (
ProjectType,
Name,
ShortName,
Description,
PopupText,
Cost,
CostProgressionModel,
CostProgressionParam1,
PrereqTech,
PrereqCivic,
PrereqDistrict,
VisualBuildingType,
AdvisorType
) VALUES (
"PROJECT_SUPPORT_SCIENCE",
"Science from production",
"Science from production",
"Support scientific inquiry",
NULL,
100,
"COST_PROGRESSION_GAME_PROGRESS",
200,
NULL,
NULL,
"DISTRICT_CITY_CENTER",
NULL,
"ADVISOR_TECHNOLOGY"
);
INSERT INTO Modifiers (
ModifierId,
ModifierType,
RunOnce,
Permanent
) VALUES (
"PROJECT_COMPLETION_MODIFIER_PROJECT_SUPPORT_SCIENCE",
"MODIFIER_PLAYER_GRANT_INFLUENCE_TOKEN",
0,
1
);
INSERT INTO ModifierArguments (
ModifierId,
Name,
Type,
Value
) VALUES (
"PROJECT_COMPLETION_MODIFIER_PROJECT_SUPPORT_SCIENCE",
"Amount",
"ARGTYPE_IDENTITY",
"0"
);
INSERT INTO ProjectCompletionModifiers (
ProjectType,
ModifierId
) VALUES (
"PROJECT_SUPPORT_SCIENCE",
"PROJECT_COMPLETION_MODIFIER_PROJECT_SUPPORT_SCIENCE"
);
INSERT INTO Project_YieldConversions (
ProjectType,
YieldType,
PercentOfProductionRate
) VALUES (
"PROJECT_SUPPORT_SCIENCE",
"YIELD_SCIENCE",
5
);
INSERT INTO Types (
Type,
Kind
) VALUES (
"PROJECT_SUPPORT_CULTURE",
"KIND_PROJECT"
);
INSERT INTO Projects (
ProjectType,
Name,
ShortName,
Description,
PopupText,
Cost,
CostProgressionModel,
CostProgressionParam1,
PrereqTech,
PrereqCivic,
PrereqDistrict,
VisualBuildingType,
AdvisorType
) VALUES (
"PROJECT_SUPPORT_CULTURE",
"Culture from production",
"Culture from production",
"Support cultural endeavors",
NULL,
100,
"COST_PROGRESSION_GAME_PROGRESS",
200,
NULL,
NULL,
"DISTRICT_CITY_CENTER",
NULL,
"ADVISOR_CULTURE"
);
INSERT INTO Modifiers (
ModifierId,
ModifierType,
RunOnce,
Permanent
) VALUES (
"PROJECT_COMPLETION_MODIFIER_PROJECT_SUPPORT_CULTURE",
"MODIFIER_PLAYER_GRANT_INFLUENCE_TOKEN",
0,
1
);
INSERT INTO ModifierArguments (
ModifierId,
Name,
Type,
Value
) VALUES (
"PROJECT_COMPLETION_MODIFIER_PROJECT_SUPPORT_CULTURE",
"Amount",
"ARGTYPE_IDENTITY",
"0"
);
INSERT INTO ProjectCompletionModifiers (
ProjectType,
ModifierId
) VALUES (
"PROJECT_SUPPORT_CULTURE",
"PROJECT_COMPLETION_MODIFIER_PROJECT_SUPPORT_CULTURE"
);
INSERT INTO Project_YieldConversions (
ProjectType,
YieldType,
PercentOfProductionRate
) VALUES (
"PROJECT_SUPPORT_CULTURE",
"YIELD_CULTURE",
5
);
/*Global Parameters*/
UPDATE GlobalParameters SET Value="150" WHERE NAME="COMBAT_MAX_HIT_POINTS";
UPDATE GlobalParameters SET VALUE="0" WHERE NAME="GOLD_NEGATIVE_BALANCE_DISBAND_UNIT_LINE";
UPDATE GlobalParameters SET VALUE="-5" WHERE NAME="GOLD_NEGATIVE_BALANCE_SUBSEQUENT_DISBAND_UNIT";
UPDATE GlobalParameters SET Value="1" WHERE NAME="BARBARIAN_BOLDNESS_PER_TURN";
/*Units maintenance cost increase*/
UPDATE StartEras SET Gold=Gold+50;
UPDATE Units SET Maintenance=1 WHERE UnitType="UNIT_WARRIOR";
UPDATE Units SET Maintenance=1 WHERE UnitType="UNIT_SCOUT";
UPDATE Units SET Maintenance=1 WHERE UnitType="UNIT_SLINGER";
UPDATE Units SET Maintenance=2 WHERE UnitType="UNIT_SUMERIAN_WAR_CART";
UPDATE Units SET Maintenance=1 WHERE UnitType="UNIT_CREE_OKIHTCITAW";
UPDATE Units SET Maintenance=1 WHERE UnitType="UNIT_MAORI_TOA";
UPDATE Units SET Maintenance=Maintenance*2 WHERE (PromotionClass="PROMOTION_CLASS_MELEE" OR
PromotionClass="PROMOTION_CLASS_RANGED" OR
PromotionClass="PROMOTION_CLASS_RECON" OR
PromotionClass="PROMOTION_CLASS_LIGHT_CAVALRY" OR
PromotionClass="PROMOTION_CLASS_ANTI_CAVALRY");
UPDATE Units SET Maintenance=Maintenance*3 WHERE (PromotionClass="PROMOTION_CLASS_HEAVY_CAVALRY" OR
PromotionClass="PROMOTION_CLASS_SIEGE" OR
PromotionClass="PROMOTION_CLASS_AIR_FIGHTER" OR
PromotionClass="PROMOTION_CLASS_AIR_BOMBER");
UPDATE Units SET Maintenance=Maintenance*4 WHERE (PromotionClass="PROMOTION_CLASS_NAVAL_MELEE" OR
PromotionClass="PROMOTION_CLASS_NAVAL_RAIDER" OR
PromotionClass="PROMOTION_CLASS_NAVAL_RANGED");
UPDATE Units SET Maintenance=Maintenance*8 WHERE PromotionClass="PROMOTION_CLASS_NAVAL_CARRIER";
UPDATE Units SET Maintenance=Maintenance*10 WHERE PromotionClass="PROMOTION_CLASS_GIANT_DEATH_ROBOT";
/*Apply popultaion costs to unist by formation class*/
UPDATE Units SET BuildCharges=5 WHERE UnitType="UNIT_BUILDER";
UPDATE Units SET PopulationCost=2 WHERE FormationClass="FORMATION_CLASS_LAND_COMBAT"
AND NOT UnitType="UNIT_BARBARIAN_HORSEMAN"
AND NOT UnitType="UNIT_BARBARIAN_HORSE_ARCHER";
UPDATE Units SET PopulationCost=1 WHERE FormationClass="FORMATION_CLASS_SUPPORT";
UPDATE Units SET PopulationCost=3 WHERE FormationClass="FORMATION_CLASS_NAVAL"
AND NOT UnitType="UNIT_BARBARIAN_RAIDER";
UPDATE Units SET PopulationCost=4 Where UnitType="UNIT_SETTLER";
/*BarbarianTribes*/
UPDATE BarbarianTribes SET TurnsToWarriorSpawn=TurnsToWarriorSpawn*0.5;