1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Bug in CP/CBO - please someone with GitHub account

Discussion in 'Community Patch Project' started by meRlinX_AT, Jan 14, 2017.

  1. meRlinX_AT

    meRlinX_AT JustMe

    Joined:
    Jan 19, 2015
    Messages:
    161
    Location:
    Earth
    Hallo,

    maybe someone with an Github account will help and upload this bugs?

    thanks a lot

    greetz
    :)


    -- CP 88 CoreChanges.sql
    -- UPDATE Features SET NoImprovement = 'true' WHERE Type = 'FEATURE_ICE';
    -- should be
    UPDATE Features SET NoImprovement = 1 WHERE NoImprovement = 'true';


    -- CSDCompatibility.sql v1 (12-13) CBO Compatibility and LUA (EUI Version)
    /*
    INSERT INTO Automates
    (Type, Description, Help, DisabledHelp, HotKey, OrderPriority, Command, Automate, Visible, IconIndex, IconAtlas)
    VALUES
    ('AUTOMATE_DIPLOMAT', 'TXT_KEY_ACTION_AUTOMATE_DIPLOMAT', 'TXT_KEY_ACTION_AUTOMATE_DIPLOMAT_HELP', 'TXT_KEY_ACTION_AUTOMATE_DIPLOMAT_DISABLED_HELP', 'KB_E', 1, 'COMMAND_AUTOMATE', 'AUTOMATE_DIPLOMAT', 'true', 43, 'UNIT_ACTION_ATLAS');
    */
    UPDATE Automates SET Visible = 1 WHERE Visible = 'true';

    -- CP 88 CoreEvents.sql
    UPDATE Events SET IsOneShot = 1 WHERE IsOneShot = 'true';
    UPDATE Events SET IsOneShot = 0 WHERE IsOneShot = 'false';

    UPDATE Events SET Global = 1 WHERE Global = 'true';
    UPDATE Events SET Global = 0 WHERE Global = 'false';

    UPDATE Events SET EraScaling = 1 WHERE EraScaling = 'true';
    UPDATE Events SET EraScaling = 0 WHERE EraScaling = 'false';

    UPDATE Events SET IgnoresGlobalCooldown = 1 WHERE IgnoresGlobalCooldown = 'true';
    UPDATE Events SET IgnoresGlobalCooldown = 0 WHERE IgnoresGlobalCooldown = 'false';

    UPDATE Events SET HasMetAMajorCiv = 1 WHERE HasMetAMajorCiv = 'true';
    UPDATE Events SET HasMetAMajorCiv = 0 WHERE HasMetAMajorCiv = 'false';

    UPDATE Events SET InDebt = 1 WHERE InDebt = 'true';
    UPDATE Events SET InDebt = 0 WHERE InDebt = 'false';

    UPDATE Events SET LosingMoney = 1 WHERE LosingMoney = 'true';
    UPDATE Events SET LosingMoney = 0 WHERE LosingMoney = 'false';

    UPDATE Events SET LessThanMaximumTradeRoutes = 1 WHERE LessThanMaximumTradeRoutes = 'true';
    UPDATE Events SET LessThanMaximumTradeRoutes = 0 WHERE LessThanMaximumTradeRoutes = 'false';

    UPDATE Events SET IsUnhappy = 1 WHERE IsUnhappy = 'true';
    UPDATE Events SET IsUnhappy = 0 WHERE IsUnhappy = 'false';

    UPDATE Events SET IsSuperUnhappy = 1 WHERE IsSuperUnhappy = 'true';
    UPDATE Events SET IsSuperUnhappy = 0 WHERE IsSuperUnhappy = 'false';

    UPDATE Events SET RequiresPantheon = 1 WHERE RequiresPantheon = 'true';
    UPDATE Events SET RequiresPantheon = 0 WHERE RequiresPantheon = 'false';

    UPDATE Events SET RequiresAnyStateReligion = 1 WHERE RequiresAnyStateReligion = 'true';
    UPDATE Events SET RequiresAnyStateReligion = 0 WHERE RequiresAnyStateReligion = 'false';

    UPDATE Events SET RequiresHolyCity = 1 WHERE RequiresHolyCity = 'true';
    UPDATE Events SET RequiresHolyCity = 0 WHERE RequiresHolyCity = 'false';

    UPDATE Events SET RequiresIdeology = 1 WHERE RequiresIdeology = 'true';
    UPDATE Events SET RequiresIdeology = 0 WHERE RequiresIdeology = 'false';

    UPDATE Events SET RequiresWar = 1 WHERE RequiresWar = 'true';
    UPDATE Events SET RequiresWar = 0 WHERE RequiresWar = 'false';

    UPDATE Events SET RequiresWarMinor = 1 WHERE RequiresWarMinor = 'true';
    UPDATE Events SET RequiresWarMinor = 0 WHERE RequiresWarMinor = 'false';

    UPDATE Events SET IsVassalOfSomeone = 1 WHERE IsVassalOfSomeone = 'true';
    UPDATE Events SET IsVassalOfSomeone = 0 WHERE IsVassalOfSomeone = 'false';

    UPDATE Events SET IsMasterOfSomeone = 1 WHERE IsMasterOfSomeone = 'true';
    UPDATE Events SET IsMasterOfSomeone = 0 WHERE IsMasterOfSomeone = 'false';

    -- same with EventChoices, EventChoice_Notification, CityEvents, CityEventChoices, CityEvent_EventLinks, CityEventChoice_Notification
    -- replaced directly in file CoreEvents.sql

    -- CSD for CBP BuildingRules.sql v27 (11-17) A mod to improve diplomacy
    /*
    UPDATE Buildings
    SET GoldenAge = 'true'
    WHERE BuildingClass= 'BUILDINGCLASS_MAUSOLEUM_HALICARNASSUS'
    AND EXISTS (SELECT * FROM CSD WHERE Type='ANCIENT_WONDERS' AND Value= 1 );
    */
    UPDATE Buildings SET GoldenAge = 1 WHERE GoldenAge = 'true';


    -- CBO v13 NewUnits.sql
    /*
    INSERT INTO Units
    (Class, Type, PrereqTech, Combat, Cost, FaithCost, PurchaseOnly, RequiresFaithPurchaseEnabled, Moves, CombatClass, Domain, MoveAfterPurchase, DefaultUnitAI, Description, Civilopedia, Strategy, Help, MilitarySupport, MilitaryProduction, Pillage, PolicyType, IgnoreBuildingDefense, AdvancedStartCost, XPValueAttack, XPValueDefense, Conscription, UnitArtInfo, UnitFlagAtlas, UnitFlagIconOffset, IconAtlas, PortraitIndex)
    VALUES
    ('UNITCLASS_GUERILLA', 'UNIT_GUERILLA', 'TECH_PENICILIN', 65, 350, 0, 1, 'false', 2, 'UNITCOMBAT_GUN', 'DOMAIN_LAND', 1, 'UNITAI_FAST_ATTACK', 'TXT_KEY_UNIT_GUERILLA', 'TXT_KEY_CIV5_GUERILLA_TEXT', 'TXT_KEY_UNIT_GUERILLA_STRATEGY', 'TXT_KEY_UNIT_HELP_GUERILLA', 1, 1, 1, 'POLICY_HONOR_FINISHER', 1, 40, 3, 3, 3, 'ART_DEF_UNIT_MERC', 'MERC_FLAG_ATLAS', 0, 'COMMUNITY_ATLAS', 52);
    */
    UPDATE Units SET RequiresFaithPurchaseEnabled = 0 WHERE RequiresFaithPurchaseEnabled = 'false';

    -- CBO v13 ImprovementChanges.sql
    /*
    UPDATE Improvements SET DestroyedWhenPillaged = 'false' WHERE Type = 'IMPROVEMENT_OFFSHORE_PLATFORM' AND EXISTS (SELECT * FROM COMMUNITY WHERE Type='COMMUNITY_CORE_BALANCE_TERRAIN' AND Value= 1 );
    */
    UPDATE Improvements SET DestroyedWhenPillaged = 0 WHERE DestroyedWhenPillaged = 'false';

    -- CP CommunityOptionsTable.sql

    /*
    CREATE TABLE IF NOT EXISTS
    Resource_TerrainWeights (
    ResourceType text REFERENCES Resources(Type),
    TerrainType text REFERENCES Terrains(Type),
    FeatureType text default NULL,
    PlotType text default NULL,
    Freshwater boolean default false, ----> 0
    NotLake boolean default false, ----> 0
    Weight variant default 1
    );
    */
     
  2. pandasnail

    pandasnail Prince

    Joined:
    Nov 18, 2015
    Messages:
    535
    I've posted githubs for people before, and I suppose I can again, but I kinda feel like these 'into the code' type of reports should be done by oneself. It really isn't very complicated at all to make an account.
     
  3. ExpiredReign

    ExpiredReign Deity

    Joined:
    Jan 3, 2013
    Messages:
    2,450
    Gender:
    Male
    Location:
    Tasmania
    None of your recommended changes make any sense. They don't follow basic SQL syntax and are apparently an effort to make the same changes using different terms.
    ie. any boolean code that is true can be defined as 1 or true, likewise false is also equal to 0.

    As for your use of UPDATE, OMG please read up on correct SQL syntax.
     
  4. Enginseer

    Enginseer Salientia of the Community Patch Supporter

    Joined:
    Nov 7, 2012
    Messages:
    3,226
    Gender:
    Male
    Location:
    Somewhere in California
    Yeah it doesn't matter, since the game accepts true and false as 1 and 0 anyway.

    Diplomat Automation? I remembered people started to complain about those or something.

    Ice shouldn't be prevented to improve for the reason that you might have mods that insert resources inside the ice and it hurts gameplay rather that in case an ice tile suddenly sticks itself upon a resource tile and you happen to be unable to improve it would be a shame..
     
  5. meRlinX_AT

    meRlinX_AT JustMe

    Joined:
    Jan 19, 2015
    Messages:
    161
    Location:
    Earth
    All UPDATE's are fine and correct SQLite syntax
    Please look SQLite syntax - don't mix different SQL ;)

    as ex. in SQLite SELECT Type FROM Features WHERE NoImprovement = 1 will not be true where you put true in a boolean


    I don't care about the game and nor about the ice or Automation...
    all is just about boolean has to be 0 or 1!

    a simple SQL Select with <>/= 0 or <>/= 1 or * or / will fail, if you put in true or false.




    PLEASE - Just forward it to Github CP/CBO Bugfix or leave without a comment - they will know, what to do - i know what i do.
    No discussion here - its not the right place

    Thanks :)
     
    Last edited: Jan 14, 2017
  6. Enginseer

    Enginseer Salientia of the Community Patch Supporter

    Joined:
    Nov 7, 2012
    Messages:
    3,226
    Gender:
    Male
    Location:
    Somewhere in California
  7. meRlinX_AT

    meRlinX_AT JustMe

    Joined:
    Jan 19, 2015
    Messages:
    161
    Location:
    Earth
  8. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,017
    Gender:
    Male
    Location:
    Little Rock
  9. meRlinX_AT

    meRlinX_AT JustMe

    Joined:
    Jan 19, 2015
    Messages:
    161
    Location:
    Earth
    ...
    UPDATE Features SET NoImprovement = 'false' WHERE Type = 'FEATURE_ICE';
    ...
    please give me your working SELECT with NoImprovement = 0 and without an OR or CASE or CAST or EXISTS or any other pia construct :)

    SELECT Type FROM Features WHERE NoImprovement = 0; ... will not show you the FEATURE_ICE, because of this. ... same with 1.
     
    Last edited: Jan 14, 2017
  10. ExpiredReign

    ExpiredReign Deity

    Joined:
    Jan 3, 2013
    Messages:
    2,450
    Gender:
    Male
    Location:
    Tasmania
    I understand what you're now asking but your initial post confused the issue you're now pushing.
    Correct me if I'm wrong but you want ALL boolean values to be changed to 1 or 0 and NOT as they sometimes are as "true" or "false"?

    As far as the game engine is concerned both work but you are also correct that SOME SQL commands do not make this distinction, such as SELECT.
     
    meRlinX_AT likes this.

Share This Page