Quick Modding Questions Thread

Discussion in 'Mod Creation Help' started by Leyrann, Oct 28, 2018.

  1. Lonecat Nekophrodite

    Lonecat Nekophrodite Emperor

    Joined:
    Jan 10, 2019
    Messages:
    1,180
    Gender:
    Male
    How will the game resolves the combat under situations.
    1. There are two antagonizing tag classes; Tank class and Antitank class. The Antitank class has a default Antitank ability (+10 strenghts VS Tank class unit, affecting tag)
    2. Antitank class uses Ranged promotion class, Tank class uses its own promo tree.
    3. A tank class unit earned a promotion similiar to Barding. (same protection against ranged attack)
    4. An antitank unit shoot at the same Tank class unit.

    How will damage is dealth? How will the game calculates damage numbers dealth?
    And is it sitll neccessary to give Antitank unit its own promo tree?
     
  2. firecantburnanything

    firecantburnanything Chieftain

    Joined:
    Jan 24, 2021
    Messages:
    5
    This log is from my Civ6 (all DLC included, some mods installed including 1 personal mod) when CTD occurred. Currently, CTD is continuously occurring at the beginning of the game.
    What information can you (or we) get from this log? Also, What should I do to resolve the error?
    Please let me know if there are any other logs needed to resolve the error.
     

    Attached Files:

  3. Feofilakt

    Feofilakt Chieftain

    Joined:
    Oct 22, 2019
    Messages:
    10
    Hello! How to make modifier take effect on all units in borders of single city?
     
  4. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    7,241
    Location:
    Illinois, USA
    Looks like a file called Kyushu_Config.xml is being loaded in both the FrontEnd and Ingame actions under an UpdateDatabase action-type
    Code:
    [2221258.215] [Gameplay] ERROR: no such table: Players
    [2221258.215] [Gameplay]: In Query - insert into Players('CivilizationAbilityDescription', 'CivilizationAbilityIcon', 'CivilizationAbilityName', 'CivilizationIcon', 'CivilizationName', 'CivilizationType', 'LeaderAbilityDescription', 'LeaderAbilityIcon', 'LeaderAbilityName', 'LeaderIcon', 'LeaderName', 'LeaderType', 'Domain') values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
    [2221258.215] [Gameplay]: In XMLSerializer while updating table Players from file Kyushu_Config.xml.
    No single file (XML or SQL) can ever be listed under an UpdateDatabase action-trype in both the FrontEnd and the Ingame Actions.

    The error specifies [Gameplay] (which is Database.log jargon for an error in InGameActions UpdateDatabase files) and that table "Players" is being used, which is not allowed in the InGameActions, so the file called Kyushu_Config.xml ought only to be loaded in the FrontEnd.


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

    An SQL file that is loading into one of UpdateColors or UpdateIcons has a fatal syntax error as noted by this message in Database.log:
    Code:
    [2221287.753] [Database] ERROR: near "(": syntax error
    Unfortnately Modding.log does not give a reference to any file being loaded at that time (which is common with errors coming from files in UpdateColors). But the error is most likely located in the most recent mod(s) downloaded or enabled.

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

    The first issue would not make the game CTD or shunt back to the game's main menu but the second might very well do so.
     
    Last edited: Jul 14, 2021
    firecantburnanything likes this.
  5. MoaiGangsta

    MoaiGangsta Chieftain

    Joined:
    Feb 27, 2021
    Messages:
    17
    Gender:
    Male
    Hi, quick question about changing plot yields based on adjacent districts:

    I've figured out how to make adjacent tiles to a specific district gain yields; for example, tiles adjacent to a Commercial Hub gain +1 gold (with no buildings built in it). However, when a tile is overlapped by 2 adjacent commercial hubs, it still only gains +1 gold. I am certain that the game is probably just checking that as long as the plot is adjacent to a commercial hub (regardless of how many comhub districts are adjacent to it) it will gain +1.

    Is there a way to make it so that a plot will gain +1 yield for each adjacent district, so that if a player builds cities close together they can stack the effect? (Similar to how preserve yields can stack)

    Below is the code I have so far:
    Code:
    INSERT INTO TraitModifiers        
            (TraitType,                                                    ModifierId)
    VALUES    ('TRAIT_LEADER_MG_SUNNY_LTRAIT',                        'MG_SUNNY_LTRAIT_ALL_GOL_1');
    ------------------------------------------------------------------------------------------------------------
    INSERT INTO Modifiers
            (ModifierId,                                                ModifierType,                            SubjectRequirementSetId)
    VALUES    ('MG_SUNNY_LTRAIT_ALL_GOL_1',                        'MODIFIER_PLAYER_ADJUST_PLOT_YIELD',                    'ADJACENT_TO_COMHUB_REQUIREMENTS');
    ------------------------------------------------------------------------------------------------------------
    INSERT INTO ModifierArguments
            (ModifierId,                                                Name,                            Value)
    VALUES    ('MG_SUNNY_LTRAIT_ALL_GOL_1',                                'Amount',                        '1'),
            ('MG_SUNNY_LTRAIT_ALL_GOL_1',                                'YieldType',                    'YIELD_GOLD');
    ------------------------------------------------------------------------------------------------------------
    INSERT INTO RequirementSets
            (RequirementSetId,                                            RequirementSetType)
    VALUES  ('ADJACENT_TO_COMHUB_REQUIREMENTS',                       'REQUIREMENTSET_TEST_ALL');
    
    INSERT INTO RequirementSetRequirements
            (RequirementSetId,                                            RequirementId)
    VALUES  ('ADJACENT_TO_COMHUB_REQUIREMENTS',                        'REQUIREMENT_TILE_ADJ_TO_COMHUB');
    
    INSERT INTO Requirements
            (RequirementId,                                            RequirementType)
    VALUES  ('REQUIREMENT_TILE_ADJ_TO_COMHUB',                         'REQUIREMENT_PLOT_ADJACENT_DISTRICT_TYPE_MATCHES');
    
    INSERT INTO RequirementArguments
            (RequirementId,                                                Name,                Value)
    VALUES  ('REQUIREMENT_TILE_ADJ_TO_COMHUB',                           'DistrictType',        'DISTRICT_COMMERCIAL_HUB'),
            ('REQUIREMENT_TILE_ADJ_TO_COMHUB',                           'MaxRange',            '1'),
            ('REQUIREMENT_TILE_ADJ_TO_COMHUB',                           'MinRange',            '1'),
            ('REQUIREMENT_TILE_ADJ_TO_COMHUB',                           'MustBeFunctioning',    'TRUE');
    If anyone has any insights, I would greatly appreciate it! :)
     
  6. Feofilakt

    Feofilakt Chieftain

    Joined:
    Oct 22, 2019
    Messages:
    10
    Never mind. But think it may be done by using COLLECTION_UNIT_NEAREST_OWNER_CITY. Actually, I would like to increase terrain movement cost somehow. Is that possible?
     
  7. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    7,241
    Location:
    Illinois, USA
    The Preserve does its thing via table Adjacent_AppealYieldChanges rather than via a modifier
    Code:
    	<Adjacent_AppealYieldChanges>
    		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="4" MaximumValue="100" YieldChange="2" YieldType="YIELD_FAITH" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_BREATHTAKING" BuildingType="BUILDING_GROVE"/>
    		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="2" MaximumValue="3" YieldChange="1" YieldType="YIELD_FAITH" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_CHARMING" BuildingType="BUILDING_GROVE"/>
    		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="4" MaximumValue="100" YieldChange="2" YieldType="YIELD_FOOD" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_BREATHTAKING" BuildingType="BUILDING_GROVE"/>
    		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="2" MaximumValue="3" YieldChange="1" YieldType="YIELD_FOOD" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_CHARMING" BuildingType="BUILDING_GROVE"/>
    		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="4" MaximumValue="100" YieldChange="2" YieldType="YIELD_CULTURE" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_BREATHTAKING" BuildingType="BUILDING_GROVE"/>
    		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="4" MaximumValue="100" YieldChange="2" YieldType="YIELD_GOLD" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_BREATHTAKING" BuildingType="BUILDING_SANCTUARY"/>
    		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="2" MaximumValue="3" YieldChange="1" YieldType="YIELD_GOLD" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_CHARMING" BuildingType="BUILDING_SANCTUARY"/>
    		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="4" MaximumValue="100" YieldChange="2" YieldType="YIELD_SCIENCE" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_BREATHTAKING" BuildingType="BUILDING_SANCTUARY"/>
    		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="2" MaximumValue="3" YieldChange="1" YieldType="YIELD_SCIENCE" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_CHARMING" BuildingType="BUILDING_SANCTUARY"/>
    		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="4" MaximumValue="100" YieldChange="2" YieldType="YIELD_PRODUCTION" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_BREATHTAKING" BuildingType="BUILDING_SANCTUARY"/>
    	</Adjacent_AppealYieldChanges>
    Modifiers that grant effects based on adjacency tend to act in the way you've experienced -- like a boolean yes/no rather than a cummulative for the number of adjacent X Unlike table Adjacency_YieldChanges which inherently will add the effect for each and every adjacent tile if you set the number of tiles needed to "1".

    You could try a "Count" RequirementArgument but I am not sure that will actually work for the District Type Matches RequirementType. If it does work you would need one unique modifier for each level of the "Count", along with its needed unique Requirement and set of RequirementArguments. I think RequirementArguments also can use a number of tiles needed argument but I cannot remember the exact "Name" setting you would need and I am not sure a REQUIREMENT_PLOT_ADJACENT_DISTRICT_TYPE_MATCHES would implement it.
     
    Last edited: Jul 17, 2021
    MoaiGangsta likes this.
  8. cgamepro

    cgamepro Chieftain

    Joined:
    Jul 17, 2021
    Messages:
    1
    Gender:
    Male
    Hello everyone :)
    I am trying to make every unit able to capture cities.
    I thought I would have to convert every ranged unit to melee in order to do that - but everytime I change every single aspect of the slinger to the melee counterparts in the "Units.xml" and move the slinger lines into the melee paragraphs the game just crashes. Does anyone know to convert existing ranged units to melee?
     
  9. MoaiGangsta

    MoaiGangsta Chieftain

    Joined:
    Feb 27, 2021
    Messages:
    17
    Gender:
    Male
    I see what you mean, its possible that it might need a count requirement.
    However, the Korean civ ability "Three Kingdoms" does a similar thing I am looking for with their Seowons and Mines/Farms (which stack with multiple adjacent Seowons).

    Looking through the modifiers used for their ability, I found that it just uses MODIFIER_PLAYER_ADJUST_PLOT_YIELD (the modifier I am using currently) and two Requirements; one for checking adjacent district (REQUIREMENT_PLOT_ADJACENT_DISTRICT_TYPE_MATCHES) which is the Requirement I am using for my own, as well as (REQUIRES_PLOT_HAS_MINE) which I wouldn't need since I want my districts to apply the yield regardless of improvements/features.

    However, I also see that the Korean ability also adds values into 2 tables; Improvement_Adjacencies and Adjacent_YieldChanges.
    Code:
    -<Improvement_Adjacencies>
    
    <Row YieldChangeId="Mine_ScienceSeowonAdjacency" ImprovementType="IMPROVEMENT_MINE"/>
    
    <Row YieldChangeId="Farm_FoodSeowonAdjacency" ImprovementType="IMPROVEMENT_FARM"/>
    
    </Improvement_Adjacencies>
    
    
    -<Adjacency_YieldChanges>
    
    <Row Description="Placeholder" AdjacentDistrict="DISTRICT_SEOWON" TilesRequired="1" YieldChange="1" YieldType="YIELD_SCIENCE" ID="Mine_ScienceSeowonAdjacency"/>
    
    <Row Description="Placeholder" AdjacentDistrict="DISTRICT_SEOWON" TilesRequired="1" YieldChange="1" YieldType="YIELD_FOOD" ID="Farm_FoodSeowonAdjacency"/>
    
    </Adjacency_YieldChanges>
    How would I go about implementing this? Would I be able to add something like this into my own mod?
    Code:
    INSERT INTO Adjacency_YieldChanges
            (Description,        AdjacentDistrict,            TilesRequired,        YieldChange,        YieldType,        ID)
    VALUES  ('Placeholder',      'DISTRICT_PRESERVE',        '1',                '1',                'YIELD_CULTURE',   Null);
    I think I might be onto something, I'm just unsure on how to exactly execute it.
     
  10. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    7,241
    Location:
    Illinois, USA
    The Seowon stacking works because it is an Adjacency_YieldChange implemented via table Improvement_Adjacencies. In order to make the Adjacency_YieldChange work for a non-district plot, it must be tied to an improvement, and the YieldChangeId must be linked to that improvement in table Improvement_Adjacencies
    Code:
    INSERT INTO Adjacency_YieldChanges
    	(ID, Description, YieldType, YieldChange, TilesRequired, AdjacentDistrict)
    VALUES	('Farm_LRS_CampusAdjacency','Placeholder','YIELD_FOOD',1,1,'DISTRICT_CAMPUS');
    
    INSERT INTO Improvement_Adjacencies
    	(ImprovementType, YieldChangeId)
    VALUES	('IMPROVEMENT_FARM','Farm_LRS_CampusAdjacency');
    You cannot have "null" as the ID in table Adjacency_YieldChanges
    Code:
    CREATE TABLE "Adjacency_YieldChanges" (
    		"ID" TEXT NOT NULL,
                   ...etc....
     
    MoaiGangsta likes this.
  11. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    7,241
    Location:
    Illinois, USA
    Code:
    <ModifierId>TRAIT_MINES_SCIENCE_SEOWON </ModifierId>
    Isn't actually implemented. It is defined in the Exp1 Major Civs file but then never attached to any trait, building, improvement, etc.

    I think it may have been implemented at one time but was removed from the "active deck" by one of the patches. Probably because Firaxis realized it would not stack when stemming from a Modifier.
     
  12. MoaiGangsta

    MoaiGangsta Chieftain

    Joined:
    Feb 27, 2021
    Messages:
    17
    Gender:
    Male
    Ah, that makes sense. Yeah, it looks like it'll probably take a count requirement, if its even possible. Very helpful information, nonetheless. Many thanks! :)
     
  13. drakthug

    drakthug Chieftain

    Joined:
    Jul 17, 2021
    Messages:
    4
    Gender:
    Male
    Okay bear with me, how do I change the name of my mod folder without breaking everything? Am I just stuck with what I named it?

    I imagine everything containing "Test" would have to be edited but I don't know if the modbuddy is gonna like that.
     
  14. aviatori

    aviatori Chieftain

    Joined:
    Mar 13, 2015
    Messages:
    33
    Gender:
    Male
    Location:
    Earth, Georgian Republic, Tbilisi
    Hello to all :hatsoff:

    Is there any possibility to restrict bomber class units to land on Carriers?
     
  15. raen

    raen Coat of Arms

    Joined:
    May 12, 2003
    Messages:
    2,461
    Location:
    Portugal
    In my opinion, is better to modify all you want in the file system, then when done, make a new clean mod in ModBuddy.
    Then open in file explorer, copy your previous files and folders to that new brand mod folder.
    Then finally at mobuddy add your items to the project.
     
  16. Phillip12345

    Phillip12345 Chieftain

    Joined:
    Jul 24, 2021
    Messages:
    8
    I created a custom civ in Modbuddy, built it, and it appeared in the create game screen, but when I pressed start game, an error message popped up after a few seconds saying "There was an error starting the game. We recommend disabling any mods and trying again. Error- One or more mods failed to load content" and then it gives me the option to manage mods or close. Does anyone know a solution to this? I'm using MC's Master Template btw.
     
  17. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    7,241
    Location:
    Illinois, USA
    Your InGame code is no good. Look in Database.log for error messages. Then compare the timestamps at the beginnings of these messages for similar timestamps in the file Modding.log which will give you a better idea which file failed to load properly.
    The logging messages in Modding.log will generally have the same timestamp or a slightly smaller numerical timestamp as compared to those found in Database.log
     
  18. Phillip12345

    Phillip12345 Chieftain

    Joined:
    Jul 24, 2021
    Messages:
    8
    Thanks. What do I do when I've found the file?
     
  19. BoredCitizen

    BoredCitizen Chieftain

    Joined:
    Jun 29, 2012
    Messages:
    4
    I tacked on a movement mod on another mod, but I get the error
    Code:
    [Configuration] ERROR: no such table: Units
    I'm guessing Units is in another database, but how do I get it to update the right database? I couldn't figure it out

    the mod is
    Code:
    UPDATE Units SET BaseMoves = BaseMoves + 1;
    in an SQL file
     
  20. Gedemon

    Gedemon Modder Super Moderator

    Joined:
    Oct 4, 2004
    Messages:
    10,031
    Location:
    France
    One SQL file is set to load in the wrong Database in your mod.

    There is no Units table available in [Configuration] (ie <FrontEndActions>), file must be set for <InGameActions>
     
    BoredCitizen likes this.

Share This Page