Celtic Warrior
Warlord
- Joined
- Aug 29, 2004
- Messages
- 200
I know this should be simple but
Im not going to give up.
<Files>
<File>Example1.xml</File>
<File>Example2.xml</File>
<File>Example3.xml</File>
<File>Example4.xml</File>
</Files>
<?xml version="1.0" encoding="utf-8"?>
<Mod id="b1325bdf-9167-4c78-9faf-3fb285bd01ef" version="1.0.1">
<Properties>
<Name>Civilopedia on Main Menu</Name>
<Teaser>Adds a Civilopedia shotcut to the Main Menu</Teaser>
<Description>Adds Civilopedia to the main menu so you don't have to wait through a loading screen just to figure out which leader you want!</Description>
<Authors>Remgrandt</Authors>
<EnabledByDefault>1</EnabledByDefault>
<EnabledAtStartup>1</EnabledAtStartup>
</Properties>
<Components>
<ImportFiles id="MMCIVILOPEDIA_FILES">
<Items>
<File>UI/FrontEnd/MainMenu.lua</File>
<File>UI/FrontEnd/MainMenu.xml</File>
<File>Text/en_US/FrontEndText.xml</File>
</Items>
</ImportFiles>
</Components>
<Files>
<File>UI/FrontEnd/MainMenu.lua</File>
<File>UI/FrontEnd/MainMenu.xml</File>
<File>Text/en_US/FrontEndText.xml</File>
</Files>
</Mod>
<GameData>
<LocalizedText>
<Row Tag="LOC_SOMETHING" Language="en_US">
<Text>Your Text</Text>
</Row>
</LocalizedText>
</GameData>
<Components>
<LocalizedText id="BASE_GAMEPLAY_TEXT">
<Items>
<File>Text/en_US/FrontEndText.xml</File>
</Items>
</LocalizedText>
</Components>
<Settings>
<LocalizedText id="BASE_GAMEPLAY_SETTING_TEXT">
<Items>
<File>Text/en_US/FrontEndText.xml</File>
</Items>
</LocalizedText>
</Settings>
So is direct modification of the game files the only way to do my mod at this point?Currently it is not anything you can get around re the text not reloading when you return to the main menu. All mods are doing it. Localized text wants an exit to desktop and a restart of the game in order to load properly.
Anything that is not in the <Settings> portions of the modinfo file does not load until after a game is started. This appears to also be true for replacement lua files that are creating a replacement UI. You could try putting your import segment under <Settings> but then your text would not load anyway because it will not be updated to the database until after you start a game.
Also so far as I know you can't import your text file anyway because it should be using a format ofand anything in a file that uses <GameData> or <GameInfo> will never be implemented via a file-import method. They have to useCode:<GameData> <LocalizedText> <Row Tag="LOC_SOMETHING" Language="en_US"> <Text>Your Text</Text> </Row> </LocalizedText> </GameData>
in the modinfo file in order to get the contents of file FrontEndText.xml added to the localization table. Or they have to use asCode:<Components> <LocalizedText id="BASE_GAMEPLAY_TEXT"> <Items> <File>Text/en_US/FrontEndText.xml</File> </Items> </LocalizedText> </Components>
But the game is finicky in that it does not like to see non-configuration stuff in the configuration Text database.Code:<Settings> <LocalizedText id="BASE_GAMEPLAY_SETTING_TEXT"> <Items> <File>Text/en_US/FrontEndText.xml</File> </Items> </LocalizedText> </Settings>
Tbh it's really a bit PITA at the moment.
-- Components associated with a setting.
-- @SettingRowId is the locally unique id of the setting.
-- @ComponentRowId is the locally unique id of the component.
CREATE TABLE SettingComponents(
'SettingRowId' INTEGER NOT NULL,
'ComponentRowId' INTEGER NOT NULL,
PRIMARY KEY('SettingRowId', 'ComponentRowId'),
FOREIGN KEY('SettingRowId') REFERENCES Settings('SettingRowId') ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY('ComponentRowId') REFERENCES Components('ComponentRowId') ON DELETE CASCADE ON UPDATE CASCADE
);
Stupid question here: why do we have two databases? Does one get queried before the other?
Don't forget localisation, which is stored in a fourth
<?xml version="1.0" encoding="utf-8"?>
<!-- Mod ID, needs to be unique to your mod. -->
<Mod id="0afa7ecd-5d9f-4c49-9184-a69de3ce45ee" version="1">
<!-- Basic Mod information -->
<Properties>
<Name>LOC_MOD_TITLE</Name>
<Stability>Alpha</Stability>
<Teaser>LOC_MOD_TEASER</Teaser>
<Description>LOC_MOD_DESCRIPTION</Description>
<Authors>LOC_MOD_AUTHORS</Authors>
<EnabledByDefault>1</EnabledByDefault>
<EnabledAtStartup>1</EnabledAtStartup>
</Properties>
<Dependencies />
<References />
<Blocks />
<!-- Settings, Loaded at boot by the game engine-->
<Settings>
<Custom id="MOD_Setting">
<Items>
<!-- Update Configuration Database-->
<File>NewFile_C_Config.sql</File>
<File>NewFile_B_Config.xml</File>
<!-- Load order of Components, this is important. -->
<Component>MOD_Component_A</Component>
<Component>MOD_Component_D</Component>
<Component>MOD_Component_C</Component>
<Component>MOD_Component_B</Component>
<Component>MOD_Text</Component>
</Items>
</Custom>
<!-- Configuration Database Text -->
<LocalizedText id="MOD_Setting">
<Items>
<File>NewText_Config.xml</File>
</Items>
</LocalizedText>
</Settings>
<!-- Different parts of the mod. Database entries are loaded once you hit Start Game.
Import files are loaded at game boot up (I think).-->
<Components>
<!-- Gameplay Scripts -->
<GameplayScripts>
<Property>
<RuleSet>YOUR_RULESET</RuleSet>
</Property>
<Items>
<File>YourGameplayScripts.Lua</File>
</Items>
</GameplayScripts>
<!-- What files to Import -->
<ImportFiles id="MOD_Import">
<Items>
<File>LuaFile.lua</File>
</Items>
</ImportFiles>
<!-- What files to update database with -->
<UpdateDatabase id="MOD_Component_D">
<Items>
<File>NewFile_D.sql</File>
</Items>
</UpdateDatabase>
<UpdateDatabase id="MOD_Component_C">
<Items>
<File>NewFile_C.xml</File>
</Items>
</UpdateDatabase>
<UpdateDatabase id="MOD_Component_B">
<Items>
<File>NewFile_B.xml</File>
</Items>
</UpdateDatabase>
<UpdateDatabase id="MOD_Component_A">
<Items>
<File>NewFile_A.xml</File>
</Items>
</UpdateDatabase>
<!-- Localized text files to add -->
<LocalizedText id="MOD_Text">
<Items>
<File>ModText.xml</File>
</Items>
</LocalizedText>
</Components>
<!-- Mod Text -->
<LocalizedText>
<Text id="LOC_MOD_TITLE">
<en_US>Title</en_US>
</Text>
<Text id="LOC_MOD_TEASER">
<en_US>Teaser</en_US>
</Text>
<Text id="LOC_MOD_DESCRIPTION">
<en_US>Description</en_US>
</Text>
<Text id="LOC_MOD_AUTHORS">
<en_US>Author</en_US>
</Text>
</LocalizedText>
<!-- Files to included in the mod -->
<Files>
<File>LuaFile.lua</File>
<File>ModText.xml</File>
<File>NewFile_A.xml</File>
<File>NewFile_B.xml</File>
<File>NewFile_C.xml</File>
<File>NewFile_D.sql</File>
<File>NewFile_C_Config.sql</File>
<File>NewFile_B_Config.xml</File>
<File>NewText_Config.xml</File>
</Files>
</Mod>
This is a Template of all the possible functions (if thats the right word) you can have in a Modinfo. There maybe others that I have not found yet. there is a brief description for some, but most are self explanitory.
<?xml version="1.0" encoding="utf-8"?>
<Mod id="f7b57f92-c92b-495d-8840-2993539024f5" version="1">
<Properties>
<Name>Misc Improvements</Name>
<Teaser>LOC_AZTEC_MONTEZUMA_MOD_TEASER</Teaser>
<Description>Misc Game Tweaks</Description>
<Authors>dls1961</Authors>
<ShowInBrowser>AlwaysHidden</ShowInBrowser>
<EnabledByDefault>1</EnabledByDefault>
<EnabledAtStartup>1</EnabledAtStartup>
</Properties>
<Components>
<UpdateDatabase id="RulesGameTweaks">
<Items>
<File>RulesGameTweaks.sql</File>
</Items>
</UpdateDatabase>
</Components>
<Settings>
<Custom id="DLS_CONFIG_DATA">
<Items>
<File>RulesConfigTweaks.sql</File>
</Items>
</Custom>
</Settings>
<Files>
<File>RulesConfigTweaks.sql</File>
<File>RulesGameTweaks.sql</File>
</Files>
</Mod>
-- Insert SQL Rules Here
Update Parameters Set DefaultValue = 'DIFFICULTY_WARLORD' Where Name = 'LOC_GAME_HANDICAP';
Update Parameters Set DefaultValue = 'GAMESPEED_QUICK' Where RecNo = 5;
Update MapSizes Set MinCityStates = 8, MaxCityStates = 8, DefaultCityStates = 8 Where MapSizeType = 'MAPSIZE_SMALL';
<Mod id="17462E0F-1EE1-4819-A44A-052B589LEESB" version="1">
<Properties>
<Name>Really Advanced Setup Lite</Name>
<Teaser>Allows user to set up additional starting conditions, meant esp to help mod-makers</Teaser>
<Description>Really Advanced Setup Lite</Description>
<Authors>LeeS</Authors>
</Properties>
<Files>
<File>RASL_Set-Up.xml</File>
<File>RASL_Set-Up2.xml</File>
<File>LUA/RASL.lua</File>
</Files>
<Components>
<UpdateDatabase id="MOD_Component_A">
<Items>
<File>RASL_Set-Up.xml</File>
<File>RASL_Set-Up2.xml</File>
</Items>
</UpdateDatabase>
<GameplayScripts id="RASL_LUA">
<Items>
<File>LUA/RASL.lua</File>
</Items>
</GameplayScripts>
</Components>
</Mod>
<Mod id="17462E0F-1EE1-4819-A44A-052B589LEESB" version="1">
<Properties>
<Name>Really Advanced Setup Lite</Name>
<Teaser>Allows user to set up additional starting conditions, meant esp to help mod-makers</Teaser>
<Description>Really Advanced Setup Lite</Description>
<Authors>LeeS</Authors>
</Properties>
<Files>
<File>RASL_Set-Up.xml</File>
<File>RASL_Set-Up2.xml</File>
<File>LUA/RASL.lua</File>
</Files>
<Components>
<UpdateDatabase id="MOD_Component_A">
<Items>
<File>RASL_Set-Up.xml</File>
</Items>
</UpdateDatabase>
<UpdateDatabase id="MOD_Component_B">
<Items>
<File>RASL_Set-Up2.xml</File>
</Items>
</UpdateDatabase>
<GameplayScripts id="RASL_LUA">
<Items>
<File>LUA/RASL.lua</File>
</Items>
</GameplayScripts>
</Components>
</Mod>
<Mod id="17462E0F-1EE1-4819-A44A-052B589LEESB" version="1">
<Properties>
<Name>Really Advanced Setup Lite</Name>
<Teaser>Allows user to set up additional starting conditions, meant esp to help mod-makers</Teaser>
<Description>Really Advanced Setup Lite</Description>
<Authors>LeeS</Authors>
</Properties>
<Files>
<File>RASL_Set-Up.xml</File>
<File>RASL_Set-Up2.xml</File>
<File>LUA/RASL.lua</File>
</Files>
<Settings>
<Custom id="RASL_SETTINGS">
<Items>
<Component>MOD_Component_A</Component>
<Component>MOD_Component_B</Component>
</Items>
</Custom>
</Settings>
<Components>
<UpdateDatabase id="MOD_Component_B">
<Items>
<File>RASL_Set-Up2.xml</File>
</Items>
</UpdateDatabase>
<UpdateDatabase id="MOD_Component_A">
<Items>
<File>RASL_Set-Up.xml</File>
</Items>
</UpdateDatabase>
<GameplayScripts id="RASL_LUA">
<Items>
<File>LUA/RASL.lua</File>
</Items>
</GameplayScripts>
</Components>
</Mod>
<Components>
<UpdateDatabase id="MOD_Component_A">
<Items>
<File>RASL_Set-Up.xml</File>
</Items>
</UpdateDatabase>
<UpdateDatabase id="MOD_Component_B">
<Items>
<File>RASL_Set-Up2.xml</File>
</Items>
</UpdateDatabase>
</Components>
<Components>
<UpdateDatabase id="MOD_Component_B">
<Items>
<File>RASL_Set-Up2.xml</File>
</Items>
</UpdateDatabase>
<UpdateDatabase id="MOD_Component_A">
<Items>
<File>RASL_Set-Up.xml</File>
</Items>
</UpdateDatabase>
</Components>
Having difficulties updating the Configuration database. I am trying to alter the minimum and maximum number of City States on a Small map. I don't see any errors in the log but the changes do not occur.
And my RulesConfigTweaks.sql looks like this:
Code:-- Insert SQL Rules Here Update Parameters Set DefaultValue = 'DIFFICULTY_WARLORD' Where Name = 'LOC_GAME_HANDICAP'; Update Parameters Set DefaultValue = 'GAMESPEED_QUICK' Where RecNo = 5; Update MapSizes Set MinCityStates = 8, MaxCityStates = 8, DefaultCityStates = 8 Where MapSizeType = 'MAPSIZE_SMALL';
-- TODO: Add Min/Max city states, set defaults.
--Find Default Number
MapSizeTypes = {};
for row in GameInfo.Maps() do
MapSizeTypes[row.RowId] = row.DefaultPlayers;
end
local sizekey = Map.GetMapSize() + 1;
local iDefaultNumberPlayers = MapSizeTypes[sizekey] or 8;
self.iDefaultNumberMajor = iDefaultNumberPlayers ;
self.iDefaultNumberMinor = math.floor(iDefaultNumberPlayers * 1.5);
<UserInterface>
<Properties>
<Context>InGame</Context>
</Properties>
<Items>
<File>YourUI.xml</File>
</Items>
</UserInterface>
<?xml version="1.0" encoding="utf-8" ?>
<Context Name="YourUI">
</Context>