Hello, I have a problem with this code for a unique unit - database keeps saying syntax error near ''INSERT'' but i cannot find any problems. I would really appreciate if someone would tell me whats wrong. I am trying to add Huscarls from Vikings scenario in game.
Here's code:
Here's database's log:
Thanks to anyone who helps.
Note: i dont know whats causing localization error but all xml files have GameData and GameInfo set properly, otherwise i wouldnt be able to build a mod. Using ModBuddy.
Here's code:
SQL:
INSERT INTO Types (Type, Kind) VALUES ('UNIT_NORWEGIAN_HUSCARL', 'KIND_UNIT'),
INSERT INTO Types (Type, Kind) VALUES ('ABILITY_PLUS_10_DEFENDER', 'KIND_ABILITY');
INSERT INTO TypeTags (Type, Tag) VALUES ('UNIT_NORWEGIAN_HUSCARL', 'CLASS_MELEE'),
INSERT INTO TypeTags (Type, Tag) VALUES ('ABILITY_PLUS_10_DEFENDER', 'CLASS_NORWEGIAN_HUSCARL');
INSERT INTO UnitAiInfos (UnitType, AiType) VALUES ('UNIT_NORWEGIAN_HUSCARL', 'UNITAI_COMBAT'),
INSERT INTO UnitAiInfos (UnitType, AiType) VALUES ('UNIT_NORWEGIAN_HUSCARL', 'UNITAI_EXPLORE'),
INSERT INTO UnitAiInfos (UnitType, AiType) VALUES ('UNIT_NORWEGIAN_HUSCARL', 'UNITTYPE_MELEE'),
INSERT INTO UnitAiInfos (UnitType, AiType) VALUES ('UNIT_NORWEGIAN_HUSCARL', 'UNITTYPE_LAND_COMBAT');
INSERT INTO Units (UnitType, BaseMoves, Cost, AdvisorType, BaseSightRange, ZoneOfControl, Domain, FormationClass, Name, Description, PurchaseYield, PromotionClass, Maintenance, Combat, PrereqCivic, MandatoryObsoleteTech, TraitType) VALUES ('UNIT_NORWEGIAN_HUSCARL', '2', '120', 'ADVISOR_CONQUEST', '2', 1, 'DOMAIN_LAND', 'FORMATION_CLASS_LAND_COMBAT', 'LOC_UNIT_NORWEGIAN_HUSCARL_NAME', 'LOC_UNIT_NORWEGIAN_HUSCARL_DESCRIPTION', 'YIELD_GOLD', 'PROMOTION_CLASS_MELEE', '2', '40', 'CIVIC_FEUDALISM', 'TECH_REPLACEABLE_PARTS', 'TRAIT_CIVILIZATION_UNIT_NORWEGIAN_HUSCARL');
INSERT INTO UnitUpgrades (Unit, UpgradeUnit) VALUES ('UNIT_NORWEGIAN_HUSCARL', 'UNIT_MUSKETMAN');
INSERT INTO UnitAbilities (UnitAbilityType, Name, Description) VALUES ('ABILITY_PLUS_10_DEFENDER', 'LOC_ABILITY_PLUS_10_DEFENDER_NAME', 'LOC_ABILITY_PLUS_10_DEFENDER_DESCRIPTION');
INSERT INTO TypeTags (Type, Tag) VALUES ('ABILITY_PLUS_10_DEFENDER', 'CLASS_NORWEGIAN_HUSCARL');
INSERT INTO RequirementSets (RequirementSetId, RequirementSetType) VALUES ('PLAYER_IS_DEFENDER_REQUIREMENTS_SET', 'REQUIREMENTSET_TEST_ANY');
INSERT INTO RequirementSetRequirements (RequirementSetId, RequirementId) VALUES ('PLAYER_IS_DEFENDER_REQUIREMENTS_SET', 'PLAYER_IS_DEFENDER_REQUIREMENTS');
INSERT INTO Modifiers (ModifierId, ModifierType, SubjectRequirementSetId) VALUES ('PLUS_10_WHEN_DEFENDING_COMBAT_BONUS', 'MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH', 'PLAYER_IS_DEFENDER_REQUIREMENTS_SET');
INSERT INTO UnitAbilityModifiers (UnitAbilityType, ModifierId) VALUES ('ABILITY_PLUS_10_DEFENDER', 'PLUS_10_WHEN_DEFENDING_COMBAT_BONUS');
INSERT INTO ModifierStrings (ModifierId, Context, Description) VALUES ('PLUS_10_WHEN_DEFENDING_COMBAT_BONUS', 'Preview', 'PLUS_10_WHEN_DEFENDING_COMBAT_BONUS_DESCRIPTION');
INSERT INTO ModifierArguments (ModifierId, Name, Value) VALUES ('PLUS_10_WHEN_DEFENDING_COMBAT_BONUS', 'Amount', '10');
Here's database's log:
Code:
[2813948.487] [Localization]: StartupErrorMessages.xml
[2813948.487] [Localization]: Input XML does not contain database entry tags. GameData, GameInfo or Database
[2813954.881] [Localization]: Validating Foreign Key Constraints...
[2813954.881] [Localization]: Passed Validation.
[2813954.903] [Configuration]: Validating Foreign Key Constraints...
[2813954.904] [Configuration]: Passed Validation.
[2813957.229] [FullTextSearch]: Initializing FullTextSearch
[2813958.180] [Gameplay]: Validating Foreign Key Constraints...
[2813958.198] [Gameplay]: Passed Validation.
[2813959.467] [Configuration]: Validating Foreign Key Constraints...
[2813959.468] [Configuration]: Passed Validation.
[2813961.703] [HallofFame]: Database found. Checking versions...
[2813961.717] [HallofFame]: Database is up-to-date!
[2813981.742] [FullTextSearch]: FTS - Creating Context
[2813998.893] [Configuration]: Validating Foreign Key Constraints...
[2813998.893] [Configuration]: Passed Validation.
[2814020.322] [Gameplay] ERROR: near "INSERT": syntax error
[2814050.263] [Configuration]: Validating Foreign Key Constraints...
[2814050.264] [Configuration]: Passed Validation.
[2814053.388] [FullTextSearch]: FTS - Creating Context
[2814068.188] [FullTextSearch]: FullTextSearch - Shutting down
Thanks to anyone who helps.
Note: i dont know whats causing localization error but all xml files have GameData and GameInfo set properly, otherwise i wouldnt be able to build a mod. Using ModBuddy.