• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

Adding Leader Specific yields to Desert?

rykolo

Chieftain
Joined
Nov 4, 2018
Messages
2
I am trying to make it so my leader's UA is that he can work desert tiles for one food and one production. This is the code.



-- Civilization Traits
-------------------------------------
INSERT INTO CivilizationTraits
(CivilizationType, TraitType )
VALUES ('CIVILIZATION_KENIISU_GOTHS', 'TRAIT_CIVILIZATION_KENIISU_GOTHS_UA' ); -- Assigns Trait to Civilization


-------------------------------------
-- Types
-------------------------------------
INSERT INTO Types
(Type, Kind)
VALUES ('TRAIT_CIVILIZATION_KENIISU_GOTHS_UA', 'KIND_TRAIT'); -- Defines Trait as, well, a Trait.

-------------------------------------
-- Traits
-------------------------------------
INSERT INTO Traits
(TraitType, Name, Description)
VALUES ('TRAIT_CIVILIZATION_KENIISU_GOTHS_UA', 'LOC_TRAIT_CIVILIZATION_KENIISU_GOTHS_UA_NAME', 'LOC_TRAIT_CIVILIZATION_KENIISU_GOTHS_UA_DESCRIPTION'); -- Assigns Info to the Trait such as Name and Description

-------------------------------------
-- TraitModifiers
-------------------------------------
INSERT INTO TraitModifiers
(TraitType, ModifierId)
VALUES ('TRAIT_CIVILIZATION_KENIISU_GOTHS_UA', 'KENIISU_GOLDEN_AGE_CAMPUS_GP'); -- Assigns the Modiifer to the Trait

------------------------------------------------------------------------
-- Modifiers
------------------------------------------------------------------------
INSERT INTO Modifiers
(ModifierId, ModifierType, SubjectRequirementSetId)
VALUES ('KENIISU_GOLDEN_AGE_CAMPUS_GP', 'MODIFIER_PLAYER_ADJUST_PLOT_YIELD', 'PLOT_IS_DESERT'); -- Setups the Modifier to be a Modifier adjusting Great Person Point to a District if that District is a Campus

------------------------------------------------------------------------
-- Modifier Arguments
------------------------------------------------------------------------
INSERT INTO ModifierArguments
(ModifierId, Name, Value)
VALUES ('KENIISU_GOLDEN_AGE_CAMPUS_GP', 'YieldType', 'YIELD_FOOD', null, 'ARGTYPE_IDENTITY'), -- Sets the Modifier's Value to "1" making it so the Great Person point is increased by 1
('KENIISU_GOLDEN_AGE_CAMPUS_GP', 'Amount', 1, null 'ARGTYPE_IDENTITY'),
('KENIISU_GOLDEN_AGE_CAMPUS_GP', 'YieldType', 'YIELD_PRODUCTION', null, 'ARGTYPE_IDENTITY'), -- Makes it so it assigns the Point to a Great Scientist.
('KENIISU_GOLDEN_AGE_CAMPUS_GP', 'Amount', 1, null, 'ARGTYPE_IDENTITY');
------------------------



Yes I'm using a template because im only 2 days into learning how to mod this game. I'm pretty sure PLOT_IS_DESERT is one thing I got wrong (of many) anything else? Thanks
 
here's a screenshot of the code if it makes it easier to read
 

Attachments

  • 2018-11-04.png
    2018-11-04.png
    139.6 KB · Views: 189
When copy/pasting code to the forum, use code wraps to make it easier to read the code. The forum will place anything between code wraps into a special code "box".

So, without the extra . shown:

[.code]some code here[./code] is displayed as
Code:
some code here

Code:
('KENIISU_GOLDEN_AGE_CAMPUS_GP', 'Amount', 1, null 'ARGTYPE_IDENTITY'),
You are missing a required comma character between "null" and 'ARGTYPE_IDENTITY'. Database.log will have shown you an error message related to this fatal syntax error in the posted code.

C:\Users\[YourUserName]\Documents\My Games\Sid Meier's Civilization VI\Logs/Database.log
You need to view the contents of Database.log with at least Notepad++. The older Notepad does not display the file properly and you get one interminable run-on 'sentence' instead of readable messaging.

You also have repeated the line I quoted, this time correctly coded, but the game will not allow a repeat combination of argument values for columns "ModifierID" and "Name". So you need to eliminate entirely the line with the error.
 
After a closer look at your code and your explanation, I understand now why the double-attempt to state "Amount" and "YieldType" for the same modifier.
  • In order to make your Modifier add both +1 Food and +1 Production, you actually need to create two modifiers. The second can be directly linked to the first, or you can link each directly to the Trait under table TraitModifiers. One Modifier is for the Food and the second is for the Production. Both however can use the same Requirement Set called 'PLOT_IS_DESERT' once you define the RequirementSet and its attendant Requirements.
You've not defined the SubjectRequirementSetId called 'PLOT_IS_DESERT' so you will get an invalid reference error and probably get shoved back to the main menu because of this non-existant reference. And you will also get a refusal of the game to implement your effect because it does not know what conditions need to be met in order to apply the modifier.
 
Last edited:
Back
Top Bottom