[GS] [Solved]I can't find out what is wrong. Syntax error?

Unbaraki

Chieftain
Joined
Apr 8, 2019
Messages
9
Code:
--Modifiers
UPDATE            Modifiers
SET                ModifierId = 'TRAIT_NORWAY_PRODUCTIONSHALLOWWATER', ModifierType = 'MODIFIER_PLAYER_ADJUST_PLOT_YIELD', Permanent = '0', SubjectRequirementSetId = 'PLOT_HAS_SHALLOW_WATER'
WHERE            ModifierId = 'TRAIT_MELEE_NAVAL_HEAL_NEUTRAL';


--Modifiers arguments
INSERT INTO ModifierArguments
(    ModifierId,                                        Name,                Type,                    Value                )    VALUES
(    'TRAIT_NORWAY_PRODUCTIONSHALLOWWATER',            'YieldType',        'ARGTYPE_IDENTITY',        'YIELD_PRODUCTION'    ),
(    'TRAIT_NORWAY_PRODUCTIONSHALLOWWATER',            'Amount',            'ARGTYPE_IDENTITY',        '1'                    );

--TraitModifiers
UPDATE            TraitModifiers
SET                ModifierId = 'TRAIT_NORWAY_PRODUCTIONSHALLOWWATER'
WHERE            TraitType = 'TRAIT_CIVILIZATION_EARLY_OCEAN_NAVIGATION' AND ModifierId = 'TRAIT_MELEE_NAVAL_HEAL_NEUTRAL';

I am trying to make this happened that Norway gets Auckland's bonus, but when I tried this code.

I get this log

Code:
[4286862.211] [Configuration]: Validating Foreign Key Constraints...
[4286862.212] [Configuration]: Passed Validation.
[4286868.577] [Gameplay] ERROR: near "": syntax error
[4286878.279] [Gameplay]: Validating Foreign Key Constraints...
[4286878.299] [Gameplay]: Passed Validation.

all the time. "[4286868.577] [Gameplay] ERROR: near "": syntax error", I can't figure out what is wrong.

since, I failed to find syntax error, so I deleted every SQL code, and tried the mod I made again. but it gave me same error.

Did I miss something?
 
Is there another mod that is also loading? Keep in mind if one auto downloads from a Steam subscription it sometimes can Activate itself without you noticing.
 
Code:
[4286868.577] [Gameplay] ERROR: near "": syntax error
You can (and will) get that error if an action "id=" name begins with a number or has spaces anywhere within it, or is not provided. This will cause that error
Code:
<UpdateDatabase id="Data Base Schema Changes">
or this will cause that error
Code:
<UpdateDatabase id="1DataBaseSchemaChanges">
or this will cause that error
Code:
<UpdateDatabase>
This will not cause the error
Code:
<UpdateDatabase id="DataBaseSchemaChanges">
Check the contents of Modding.log for messages with an identical or similar time-stamp to
Code:
[4286868.577]
And bear in mind that the time-stamp on the error message will be different next time you try to run the game with the mod enabled because the OS "time" will be different.
 
Thank you for responding.

I checked .modinfo file but, I can't find the error. And I am really stuck. Maybe I skipped some process here?

Code:
--NORWAY_TRAITS_FIX-------------------------------------------------------------------
--------------------------------------------------------------------------------------

--Production from shallow water----------------------

--Modifiers
UPDATE            Modifiers
SET                ModifierId = 'TRAIT_NORWAY_PRODUCTIONSHALLOWWATER', ModifierType = 'MODIFIER_PLAYER_ADJUST_PLOT_YIELD', Permanent = '0', SubjectRequirementSetId = 'PLOT_HAS_SHALLOW_WATER'
WHERE            ModifierId = 'TRAIT_MELEE_NAVAL_HEAL_NEUTRAL';


--Modifiers arguments
INSERT INTO ModifierArguments
(    ModifierId,                                        Name,                Type,                    Value                )    VALUES
(    'TRAIT_NORWAY_PRODUCTIONSHALLOWWATER',            'YieldType',        'ARGTYPE_IDENTITY',        'YIELD_PRODUCTION'    ),
(    'TRAIT_NORWAY_PRODUCTIONSHALLOWWATER',            'Amount',            'ARGTYPE_IDENTITY',        '1'                    );

--TraitModifiers
UPDATE            TraitModifiers
SET                ModifierId = 'TRAIT_NORWAY_PRODUCTIONSHALLOWWATER'
WHERE            TraitType = 'TRAIT_CIVILIZATION_EARLY_OCEAN_NAVIGATION' AND ModifierId = 'TRAIT_MELEE_NAVAL_HEAL_NEUTRAL';

-------------------------------------------------------

--Trade trait------------------------------------------

--Modifiers
INSERT INTO Modifiers
(    ModifierId,                                                ModifierType,                                                                            OwnerRequirementSetId,        SubjectRequirementSetId        )    VALUES
(    'TRAIT_NORWAY_CULTURE_TRADE_ROUTE_BONUS_INTERNATIONAL',    'MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD_PER_SPECIALTY_DISTRICT_FOR_INTERNATIONAL',    NULL,                        NULL                        ),
(    'TRAIT_NORWAY_GOLD_TRADE_ROUTE_BONUS_INTERNATIONAL',    'MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD_PER_SPECIALTY_DISTRICT_FOR_INTERNATIONAL',    NULL,                        NULL                        );

--Modifers arguments
INSERT INTO ModifierArguments
(    ModifierId,                                                        Name,                Type,                    Value                )    VALUES
(    'TRAIT_NORWAY_CULTURE_TRADE_ROUTE_BONUS_INTERNATIONAL',            'YieldType',        'ARGTYPE_IDENTITY',        'YIELD_CULTURE'        ),
(    'TRAIT_NORWAY_CULTURE_TRADE_ROUTE_BONUS_INTERNATIONAL',            'Amount',            'ARGTYPE_IDENTITY',        '1'                    ),
(    'TRAIT_NORWAY_GOLD_TRADE_ROUTE_BONUS_INTERNATIONAL',            'YieldType',        'ARGTYPE_IDENTITY',        'YIELD_GOLD'        ),
(    'TRAIT_NORWAY_GOLD_TRADE_ROUTE_BONUS_INTERNATIONAL',            'Amount',            'ARGTYPE_IDENTITY',        '2'                    );

--TraitModifiers
INSERT INTO TraitModifiers
(    TraitType,                                                ModifierId                                                        )    VALUES
(    'TRAIT_CIVILIZATION_EARLY_OCEAN_NAVIGATION',            'TRAIT_NORWAY_CULTURE_TRADE_ROUTE_BONUS_INTERNATIONAL'            );


------------------------------------------------------------

--NORWAY_TRAITS_FIX END------------------------------------------------------------------------

This is the SQL code, I want to make it work. My mod has only this sql file and .art.xml file that gives you when you start new Empty mod project.
And I only touched in-GameAction - UpdateDatabase and loaded above SQL file.


Code:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="5eab2cad-c505-4d58-8ba2-55a71c02c4e7" version="1">
  <Properties>
    <Name>VikingAge</Name>
    <Description>VikingAge</Description>
    <Teaser>VikingAge</Teaser>
    <Authors>Unbaraki</Authors>
    <CompatibleVersions>1.2,2.0</CompatibleVersions>
  </Properties>
  <InGameActions>
    <UpdateDatabase id="GamePlay">
      <File>Core/GameData.sql</File>
    </UpdateDatabase>
  </InGameActions>
  <Files>
    <File>Core/GameData.sql</File>
  </Files>
</Mod>

.modinfo I got.

Code:
[26679.673] [Localization]: StartupErrorMessages.xml
[26679.673] [Localization]: Input XML does not contain database entry tags. GameData, GameInfo or Database
[26683.094] [Localization]: Validating Foreign Key Constraints...

[26856.842] [Configuration]: Validating Foreign Key Constraints...
[26856.843] [Configuration]: Passed Validation.
[26858.582] [Gameplay] ERROR: near "": syntax error
[26863.734] [Gameplay]: Validating Foreign Key Constraints...
[26863.754] [Gameplay]: Passed Validation.

Database.log

Code:
[26858.581] Applying Component - GamePlay (UpdateDatabase)
[26858.581] UpdateDatabase - Loading Core/GameData.sql
[26858.582] Warning: UpdateDatabase - Error Loading SQL.
[26858.582] Applying Component - AustraliaGameplay_XP2 (UpdateDatabase)
[26858.583] UpdateDatabase - Loading Data/Australia_Expansion2.xml

Modding.log


What interesting is FiraxisLive.log. When I try to test my mod, FiraxisLive.log reports me error. It didn't happen when I didn't load my mod.

Code:
[4/9/2019 10:28:25.122] CTPFiraxisLive.cpp(1871) Starting SSO login...
My2KLogon successful
[4/9/2019 10:28:26.635] CTPFiraxisLive.cpp(2073) Failed to get account linked with error 2562 (ERROR_NOT_LOGGED_IN)
[4/9/2019 10:28:26.636] CTPFiraxisLive.cpp(94) SsoLoginCallback success
FiraxisLiveClient UserStateNotify: LoggingIn
 
Well, the error your posted SQL code should be creating is
Code:
[80434.911] [Gameplay] ERROR: Invalid Reference on Modifiers.SubjectRequirementSetId - "PLOT_HAS_SHALLOW_WATER" does not exist in RequirementSets
Since this RequirementSet has never been defined. This is in fact the error I get when I copy your SQL code from post number 4 into an SQL file in a testing mod I use.

The fact that you are instead getting
Code:
[26858.582] [Gameplay] ERROR: near "": syntax error
tells me there is an issue with the structure of the mod or in the contents of Core/GameData.sql above the code you have been posting. Without the mod itself to look at there is no way to tell which is the problem. It would be necessary to have the mod itself as it is in the game's Mods folder zipped and attached to a forum post in order to apply any further help in discovering and eliminating the problem.
 
Thank you for answering me.

I changed SQL code in mod I downloaded with my new SQL code. It worked fine.

but, I can't find why the syntax error is happening.

this is the whole solution file.
 

Attachments

Back
Top Bottom