[SOLVED] Unit Error Check

Mikecro

Chieftain
Joined
Aug 16, 2022
Messages
18
Hello, I have a weird syntax error while trying to create a unique unit based on Huscarls from Vikings Scenario. I checked everything...i dont know whats wrong.
Here is 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');

And here is database 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

Take a note that i dont know whats causing issue in 2nd row with localization, as all xml files have their GameData and GameInfo set - otherwise i wouldnt be able to build the mod. I am using ModBuddy.
 
I think this is the same post/error that you asked about in the following thread:


I answered over there - the advice should equally apply.
 
I think this is the same post/error that you asked about in the following thread:


I answered over there - the advice should equally apply.
Yeah, duplicate thread. Lost internet connection, couldnt find previous thread so made a new one...later realized first one was posted, but threads cant be deleted, so this one will have to stay. Thanks again.
 
Top Bottom