Change VP Options

and also for scout and pathfinder barbarian penalties i've tried these codes but it doesnt work any solution to it aswell ?
Try this code.
Code:
DELETE FROM Unit_FreePromotions WHERE UnitType = 'UNIT_SHOSHONE_PATHFINDER' AND PromotionType = 'PROMOTION_BARBARIAN_PENALTY_I';
DELETE FROM Unit_FreePromotions WHERE UnitType = 'UNIT_SCOUT' AND PromotionType = 'PROMOTION_BARBARIAN_PENALTY_II';
 
Try this code.
Code:
DELETE FROM Unit_FreePromotions WHERE UnitType = 'UNIT_SHOSHONE_PATHFINDER' AND PromotionType = 'PROMOTION_BARBARIAN_PENALTY_I';
DELETE FROM Unit_FreePromotions WHERE UnitType = 'UNIT_SCOUT' AND PromotionType = 'PROMOTION_BARBARIAN_PENALTY_II';

didn't work :(

edit: sorry it works know don't know what changed but second time i've started a game it applied. thank you so much.
 
Last edited:
I've been making good use of this mod, mostly to configure the game to my personal tastes, but also for it's original purpose of saving game options. Thanks for making it :)

I have a few questions (for anybody who knows):

1) My code.sql is getting rather large. I'm tempted to split it into 2 or 3 files. Looking at the modinfo file, I can see what to do except for the md5 number. Can I just use any unique number or it there some magic here?

2) Can I add some sort of define in the sql that I can test later in the file and if so how? The idea is to have a few of these at the top of the file to make it easier to turn certain changes on and off e.g. DO_PANTHEON_CHANGES.

3) Can I add a define that I can test in the LUA code in the UI? I have made a few personal changes to the UI that my (only other) user would prefer not to see. Being able to control these from this mod (that he is also using) seems like the simplest way to configure it.

Thanks for help with any of this.
 
1) My code.sql is getting rather large. I'm tempted to split it into 2 or 3 files. Looking at the modinfo file, I can see what to do except for the md5 number. Can I just use any unique number or it there some magic here?

md5 definition from wikipedia :
The MD5 message-digest algorithm is a widely used hash function producing a 128-bit hash value. Although MD5 was initially designed to be used as a cryptographic hash function, it has been found to suffer from extensive vulnerabilities. It can still be used as a checksum to verify data integrity, but only against unintentional corruption. It remains suitable for other non-cryptographic purposes, for example for determining the partition for a particular key in a partitioned database.

If you don't plan to release a mod in Steam, you can put any alphanumeric in it. I read somewhere you can write
Code:
<File md5=""
but it doesn't work for me

Look at (7a) Promotion Icons for VP (v 1) in VP :
Code:
  <Files>
    <File md5="00000000000000000000000000000000" import="1">dds/promoVP_00_016.dds</File>
    <File md5="00000000000000000000000000000000" import="1">dds/promoVP_00_032.dds</File>
    <File md5="00000000000000000000000000000000" import="1">dds/promoVP_00_045.dds</File>
    <File md5="00000000000000000000000000000000" import="1">dds/promoVP_00_064.dds</File>
    <File md5="00000000000000000000000000000000" import="1">dds/promoVP_00_256.dds</File>
! It works fine as long it's not on Steam.

Md5 is supposed to be calculated automatically with modbudy. I don't use modbudy and that's why

In Ver. 2 I will use http://www.winmd5.com to generate correct MD5s. Then, I will look like a very serious guy :crazyeye:

2) Can I add some sort of define in the sql that I can test later in the file and if so how? The idea is to have a few of these at the top of the file to make it easier to turn certain changes on and off e.g. DO_PANTHEON_CHANGES.

Everything between -- and the end of line is ignored
Code:
-- PROMOTION_PRISONER_WAR PromotionDuration = '9'
UPDATE UnitPromotions
SET PromotionDuration = '9'
WHERE Type = 'PROMOTION_PRISONER_WAR';

UPDATE Language_en_US
SET Text = '-50% Work for 9 turns.'
WHERE Tag = 'TXT_KEY_PROMOTION_PRISONER_WAR_HELP';

Everything between /* and */ is ignored
Code:
/*
-- Distance minimum between Cities

-- Duel
UPDATE Worlds
SET MinDistanceCities = '3'
WHERE Type = 'WORLDSIZE_DUEL';
-- Tiny
UPDATE Worlds
SET MinDistanceCities = '3'
WHERE Type = 'WORLDSIZE_TINY';
-- Small
UPDATE Worlds
SET MinDistanceCities = '3'
WHERE Type = 'WORLDSIZE_SMALL';
-- Standard
UPDATE Worlds
SET MinDistanceCities = '3'
WHERE Type = 'WORLDSIZE_STANDARD';
-- Large
UPDATE Worlds
SET MinDistanceCities = '3'
WHERE Type = 'WORLDSIZE_LARGE';
-- Huge
UPDATE Worlds
SET MinDistanceCities = '3'
WHERE Type = 'WORLDSIZE_HUGE';

*/

EDIT : If you have good tricks in your code.sql, tell everybody here :scan:
EDIT2 : Notepad2 is good and is light to edit sql
 
Last edited:
I've been making good use of this mod, mostly to configure the game to my personal tastes, but also for it's original purpose of saving game options. Thanks for making it :)

I have a few questions (for anybody who knows):
Thank you, psparky.
I've increased the number of code files .
This is all I can do, I'm sorry to say.
 

Attachments

Thank you for the update - I will certainly make use of that :)

Also thanks for the info above - in particular, I didn't know about block comments. I'm afraid I don't have any good tricks to share, mostly it's simple variations of ideas I found in this thread.
 
I'm using audio edits and my question is do I need to change <ReloadAudioSystem>0</ReloadAudioSystem> in the .modinfo file to 1 or keep it off (0)?
If I need to keep it off, what does this option do?
Code:
-- City ambience sound -50% volume down (was 60, 60)
INSERT INTO Audio_2DSounds (ScriptID, SoundID, SoundType, Looping, DontTriggerDuplicates, DontPlayMoreThan, MaxVolume, MinVolume)
SELECT 'AS2D_AMBIENCE_CITY_ERA_ANCIENT_LARGE', 'SND_AMBIENCE_CITY_ANC_LARGE', 'GAME_AMBIENCE', 1, 1, 1, 30, 30 UNION ALL
SELECT 'AS2D_AMBIENCE_CITY_ERA_ANCIENT_SMALL', 'SND_AMBIENCE_CITY_ANC_SMALL', 'GAME_AMBIENCE', 1, 1, 1, 30, 30 UNION ALL
SELECT 'AS2D_AMBIENCE_CITY_ERA_CLASSICAL_LARGE', 'SND_AMBIENCE_CITY_ANC_LARGE', 'GAME_AMBIENCE', 1, 1, 1, 30, 30 UNION ALL
SELECT 'AS2D_AMBIENCE_CITY_ERA_CLASSICAL_SMALL', 'SND_AMBIENCE_CITY_ANC_SMALL', 'GAME_AMBIENCE', 1, 1, 1, 30, 30 UNION ALL
SELECT 'AS2D_AMBIENCE_CITY_ERA_MEDIEVAL_LARGE', 'SND_AMBIENCE_CITY_MED_LARGE', 'GAME_AMBIENCE', 1, 1, 1, 30, 30 UNION ALL
SELECT 'AS2D_AMBIENCE_CITY_ERA_MEDIEVAL_SMALL', 'SND_AMBIENCE_CITY_MED_SMALL', 'GAME_AMBIENCE', 1, 1, 1, 30, 30 UNION ALL
SELECT 'AS2D_AMBIENCE_CITY_ERA_RENAISSANCE_LARGE', 'SND_AMBIENCE_CITY_MED_LARGE', 'GAME_AMBIENCE', 1, 1, 1, 30, 30 UNION ALL
SELECT 'AS2D_AMBIENCE_CITY_ERA_RENAISSANCE_SMALL', 'SND_AMBIENCE_CITY_MED_SMALL', 'GAME_AMBIENCE', 1, 1, 1, 30, 30 UNION ALL
SELECT 'AS2D_AMBIENCE_CITY_ERA_INDUSTRIAL_LARGE', 'SND_AMBIENCE_CITY_IND_LARGE', 'GAME_AMBIENCE', 1, 1, 1, 30, 30 UNION ALL
SELECT 'AS2D_AMBIENCE_CITY_ERA_INDUSTRIAL_SMALL', 'SND_AMBIENCE_CITY_IND_SMALL', 'GAME_AMBIENCE', 1, 1, 1, 30, 30 UNION ALL
SELECT 'AS2D_AMBIENCE_CITY_ERA_MODERN_LARGE', 'SND_AMBIENCE_CITY_MODERN_LARGE', 'GAME_AMBIENCE', 1, 1, 1, 30, 30 UNION ALL
SELECT 'AS2D_AMBIENCE_CITY_ERA_MODERN_SMALL', 'SND_AMBIENCE_CITY_MODERN_SMALL', 'GAME_AMBIENCE', 1, 1, 1, 30, 30 UNION ALL
SELECT 'AS2D_AMBIENCE_CITY_ERA_FUTURE_LARGE', 'SND_AMBIENCE_CITY_MODERN_LARGE', 'GAME_AMBIENCE', 1, 1, 1, 30, 30 UNION ALL
SELECT 'AS2D_AMBIENCE_CITY_ERA_FUTURE_SMALL', 'SND_AMBIENCE_CITY_MODERN_SMALL', 'GAME_AMBIENCE', 1, 1, 1, 30, 30;
Next, I want to add
Code:
           <Where Name="GLOBAL_SUBS_UNDER_ICE_IMMUNITY"/>
           <Set Value="1"/>
to the xml below:
Code:
<GameData>
    <CustomModOptions>
        <Update>
            <Where Name="DIPLOMACY_AUTO_DENOUNCE"/>
            <Set Value="1"/>
        </Update>
    </CustomModOptions>
</GameData>
Do I have to put it like
#1
Code:
<GameData>
    <CustomModOptions>
        <Update>
            <Where Name="DIPLOMACY_AUTO_DENOUNCE"/>
            <Set Value="1"/>
            <Where Name="GLOBAL_SUBS_UNDER_ICE_IMMUNITY"/>
            <Set Value="1"/>
        </Update>
    </CustomModOptions>
</GameData>
or #2
Code:
<GameData>
    <CustomModOptions>
        <Update>
            <Where Name="DIPLOMACY_AUTO_DENOUNCE"/>
            <Set Value="1"/>
        </Update>
        <Update>
            <Where Name="GLOBAL_SUBS_UNDER_ICE_IMMUNITY"/>
            <Set Value="1"/>
        </Update>
    </CustomModOptions>
</GameData>
EDIT: or #3 and simply use the .sql for it?
Code:
-- Subs Immune Under Ice
UPDATE CustomModOptions SET Value = 1 WHERE Name = 'GLOBAL_SUBS_UNDER_ICE_IMMUNITY';

-- Automatic Denunciation At Declaration Of War
UPDATE CustomModOptions SET Value = 1 WHERE Name = 'DIPLOMACY_AUTO_DENOUNCE';

-- No Civilization Gifting
UPDATE CustomModOptions SET Value = 0 WHERE Name = 'NO_MAJORCIV_GIFTING';
 
Last edited:
I'm using audio edits and my question is do I need to change <ReloadAudioSystem>0</ReloadAudioSystem> in the .modinfo file to 1 or keep it off (0)?
If I need to keep it off, what does this option do?
It seems to me that you don't have to change ReloadAudioSystem unless you add audio files.
https://forums.civfanatics.com/threads/common-novice-modder-mistakes.541578/#No Check-Boxes

Next, I want to add
Code:
           <Where Name="GLOBAL_SUBS_UNDER_ICE_IMMUNITY"/>
           <Set Value="1"/>
to the xml below:
I haven't tested it, but #2 and #3 should work.
 
Seen here, the ryanmusante's receipe to disable civs :

e.g. for Austria and Venice (xml) (AI can not pick Austria and Venice)
Code:
<GameData>
    <Civilizations>
        <Update>
            <Where Type='CIVILIZATION_AUSTRIA'/>
            <Set AIPlayable="false"/>
        </Update>
        <Update>
            <Where Type='CIVILIZATION_VENICE'/>
            <Set AIPlayable="false"/>
        </Update>
    </Civilizations>
</GameData>
 
Does anyone of you could come up with a way to set the promo payout rate regardless of the pace? It would be great:popcorn:

EXPERIENCE_PER_LEVEL or something?
Code:
UPDATE Defines SET Value = '9' WHERE Name = 'EXPERIENCE_PER_LEVEL';
Default value is 10.
 

Attachments

  • xp.png
    xp.png
    32.6 KB · Views: 208
What is the best way to convert this to SQL without errors?
Spoiler code :

Code:
<GameData>
    <Unit_FreePromotions>
        <Row>
            <UnitType>UNIT_SCOUT</UnitType>
            <PromotionType>PROMOTION_RIVAL_TERRITORY</PromotionType>
        </Row>
        <Row>
            <UnitType>UNIT_SHOSHONE_PATHFINDER</UnitType>
            <PromotionType>PROMOTION_RIVAL_TERRITORY</PromotionType>
        </Row>
    </Unit_FreePromotions>
        
    <UnitClasses>
        <Delete Type="UNITCLASS_MECH"/>
        <Delete Type="UNITCLASS_XCOM_SQUAD"/>
    </UnitClasses>
        
    <DeleteMissingReferences table="UnitClasses" column="Type"/>
    <DeleteMissingReferences table="Units" column="Type"/>
        
    <Units>
        <Update>
            <Where Type="UNIT_SUBMARINE"/>
            <Set RivalTerritory="1"/>
        </Update>
        <Update>
            <Where Type="UNIT_NUCLEAR_SUBMARINE"/>
            <Set RivalTerritory="1"/>
        </Update>
    </Units>
        
    <Resolutions>
        <Delete Type="RESOLUTION_BAN_LUXURY_HAPPINESS"/>
    </Resolutions>
</GameData>
 
What is the best way to convert this to SQL without errors?
How about this?
Code:
UPDATE Units SET RivalTerritory = '1' WHERE Type = 'UNIT_SCOUT';
UPDATE Units SET RivalTerritory = '1' WHERE Type = 'UNIT_SHOSHONE_PATHFINDER';
UPDATE Units SET RivalTerritory = '1' WHERE Type = 'UNIT_SUBMARINE';
UPDATE Units SET RivalTerritory = '1' WHERE Type = 'UNIT_NUCLEAR_SUBMARINE';

DELETE FROM UnitClasses WHERE Type = 'UNITCLASS_MECH';
DELETE FROM UnitClasses WHERE Type = 'UNITCLASS_XCOM_SQUAD';

DELETE FROM Resolutions WHERE Type = 'RESOLUTION_BAN_LUXURY_HAPPINESS';
 
How about this?
Code:
<Unit_FreePromotions> and <Units><Update>
Looks great, just couple questions, what is the difference in the XML code of both?
Code:
DELETE FROM Units WHERE Class =
Is it redundant to add this to a deletion in addition to the UnitClasses?
 
Last edited:
Code:
<Unit_FreePromotions> and <Units><Update>
Looks great, just couple questions, what is the difference in the XML code of both?
Both of them have the same effect.
You can use Unit_FreePromotions instead of RivalTerritory.
Code:
INSERT INTO Unit_FreePromotions (UnitType, PromotionType) SELECT 'UNIT_SCOUT' , 'PROMOTION_RIVAL_TERRITORY';
INSERT INTO Unit_FreePromotions (UnitType, PromotionType) SELECT 'UNIT_SHOSHONE_PATHFINDER' , 'PROMOTION_RIVAL_TERRITORY';
INSERT INTO Unit_FreePromotions (UnitType, PromotionType) SELECT 'UNIT_SUBMARINE' , 'PROMOTION_RIVAL_TERRITORY';
INSERT INTO Unit_FreePromotions (UnitType, PromotionType) SELECT 'UNIT_NUCLEAR_SUBMARINE' , 'PROMOTION_RIVAL_TERRITORY';

FYI
<Unit_FreePromotions> appears as a promotion icon, whereas <Units><Update> doesn't.
<Unit_FreePromotions> doesn't affect existing units, whereas <Units><Update> does.

Code:
DELETE FROM Units WHERE Class =
Is it redundant to add this to a deletion in addition to the UnitClasses?
Yeah, you don't have to add DELETE FROM Units.
 
Last edited:
Back
Top Bottom