主站 / 小组 / 文明6 / 文明6MOD Mod组件和文件加载顺序

文明6MOD Mod组件和文件加载顺序

文明6MOD   Mod组件和文件加载顺序

发布用户:bity_1695129908发布类型:转载

原创作者:PlotinusRedux所在平台:互联网

发布日期:2023-06-01 13:18:11更新日期:2023-11-18 10:47:05

是否开源:否是否免费:是

审核人员:系统怪(违规侵权资源,点击直接联系可快速删除!)

模组标签:功能修改运行环境:文明6

浏览次数:2

快捷访问:点击下载

MOD介绍:

Mod, Component, & File Load Order as of Winter  Mod组件和文件加载顺序

注意 - 大多数mod不必担心以下任何一个因为他们没有理由关心加载顺序。如果您想要修改DLC内容或其他mod的内容,或者您正在处理可通过更改加载顺序解决的另一个mod的兼容性问题,则此信息实际上是必需的。

默认顺序

新游戏的mod的默认加载顺序是mods.sqlite中的ModRowId,这基本上意味着mods按照它们被添加到数据库的顺序加载,并在它们的.modinfo修改日期的任何时候重新添加它们。文件更改。

但是,当加载已保存的游戏时,mod会按照修订版ID加载字母数字排序 - GUID用作.modinfo文件的根<Mod>元素中的“id”属性。如果最后添加的Mod的id以“00”开头,比如说,它会在游戏创建过程中最后加载(因为它是最后添加的),但首先是重新加载游戏时,甚至在任何DLC之前。 

基本上,如果你的mod有依赖于加载顺序的元素,不要依赖于mods的默认加载顺序 - 它可能在测试期间起作用,但这可能只是因为它是你改变了.modinfo的最后一个mod。

组件的默认顺序是按照它们在.modinfo文件中出现的顺序加载它们的mod。

文件的默认顺序是按照它们出现在.modinfo的<Files>元素中的顺序加载它们的组件,不在组件内的顺序。

更改Mod加载顺序

mod总是会在.modinfo的<Dependencies>列表中的任何mod之后加载。但是,你真的不想使用它,除非你的mod真的需要运行其他mod。

还有一个<References>元素,*应该*强制mod加载后列出的任何mod,而不实际需要像<Dependencies>那样的mod,但它当前似乎被打破了。

目前还没有可靠的方法来控制mod的加载顺序。但是 - 

跨Mods更改组件加载顺序组件

的<Properties>元素可能包含<LoadOrder> X </ LoadOrder>元素,其中X是全局的正整数或负整数跨mods确定组件的加载顺序,较早的数字加载较少。因此,<LoadOrder>为-1的<UpdateDatabase>将始终在DLC内容和任何未指定较低<LoadOrder>的mod的任何组件之前加载,而不管mod本身加载的顺序如何.A < LoadOrder> of 1当然会导致它在DLC和任何其他没有指定加载顺序的mod的任何组件之后加载。

因此,如果要修改DLC添加的单位,只需指定<LoadOrder>> = 1以确保组件在DLC组件之后运行。

我亲自使用<UpdateDatabase>,<GameplayScript>和<ModArt>对此进行了测试 - 它肯定适用于前2,并且绝对不适用于<ModArt>。

在任何组件的<Items>元素下,<File>元素可以指定优先级X,如<File Priority =“1”> SomeFile </ File>,它将确定组件中文件的加载顺序,覆盖从根目录下的<Files>元素中排序。X可以是正数或负数,未指定时默认为0,与<LoadOrder>相反,更高的数字加载更早。优先级对其他组件中的同一文件或组件之间的加载顺序没有影响 - 它对当前组件的<Items>元素是严格本地的。

改变Dep / ArtDef加载顺序

不幸的是,这里还没有好的答案。<LoadOrder>对<ModArt>组件的顺序没有影响。

一世'正在使用RED,他在那里制作了3个独立的mod:基础RED Mod,用于MoarUnits扩展的RED,以及用于波兰DLC扩展的RED。对于扩展,使用MoarUnits作为示例,他将基本RED mod和MoarUnits mod添加到.modinfo中的<Dependencies>,并将MoarUnits.dep的GUID添加到扩展<RequiredGameArtIDs>,如下所示:

码:

<RequiredGameArtIDs>

       <元件>

           <name text =“MoarUnits”/>

           <id text =“8342b98d-80c7-4002-87bb-419646bd9b54”/>

       </元素>

   </ RequiredGameArtIDs>

这是杂乱和丑陋的,并需要一个单独的扩展mod为每个额外的兼容性。虽然注意,这只是为了将RED外观应用于MoarUnits和DLC中的其他单元 - 如果你只是为它添加一个新单元和一个artdef,你将不必担心任何这个(虽然如果你的mod变得流行,@ Gedemon会)。

Note--most mods won't have to worry about any of the below because they have no reason to care about load order. This information is really only necessary if you want to modify DLC content or the contents of other mods or you're working on a compatibility issue with another mod that could be resolved by altering load orders.

Default Order

The default load order of mods for new games is by ModRowId in mods.sqlite, which basically means mods are loaded in the order they were added to the database, with them being re-added any time the modified date of their .modinfo file changes.

When a saved game is loaded, however, mods load in alpha-numerical sort order by Mod Id--the GUID used as the "id" attribute in the root <Mod> element of the .modinfo file. If the last added Mod's id starts with "00", say, it will load last during game creation (since it was added last), but first when a game is reloaded, even before any DLC. 

Basically, if your mod has load order dependent elements, don't rely on the default load order of mods--it may appear to work during your testing, but that's probably just because it's the last mod whose .modinfo you changed.

The default order of components is to load with their mods in the order in which they appear in it's .modinfo file.

The default order of files is to load with their components in the order in which they appear in the .modinfo's <Files> element, not in their order within the component.

Changing Mod Load Order

A mod will always load after any mods in its <Dependencies> list in .modinfo. However, you don't really want to use this unless unless your mod really requires the other mods to run.

There is also a <References> element which *should* force a mod to load after any mods listed there without actually requiring those mods like <Dependencies>, but it currently appears to be broken.

There currently is no reliable way to control the load order of mods. However--

Changing Component Load Order Across Mods

The <Properties> element of a component may contain a <LoadOrder>X</LoadOrder> element where X is a positive or negative integer acting globally across mods to determine the load order of the component, with lower numbers loading earlier. Thus, an <UpdateDatabase> with a <LoadOrder> of -1 will always load before the DLC content and any component of any mod that didn't specify a lower <LoadOrder>, regardless of the order the mods themselves load in. A <LoadOrder> of 1 would of course cause it to load after the DLC and any component of any other mod that didn't specify a load order.

So if you want to modify the units added by the DLC, just specify a <LoadOrder> >= 1 to make sure your component runs after the DLC components.

I've personally tested this with <UpdateDatabase>, <GameplayScript>, and <ModArt>--it definitely works with the 1st 2, and definitely does not work with <ModArt>.

Changing File Order Within Components

Under the <Items> element of any component, the <File> element may specify a Priority X like <File Priority="1">SomeFile</File>, which will determine the load order of the file within the component, overriding the order in the <Files> element off the root. X may be positive or negative, defaulting to 0 when not specified, and opposite of <LoadOrder>, higher numbers load earlier. The Priority has no effect on the same file in other Components or on the load order between components--it is strictly local to the <Items> element of the current component.

Changing Dep/ArtDef Load Order

Unfortunately there's no good answer here yet. <LoadOrder> has no effect on the order of <ModArt> components.

I've currently found no better solution than the one @Gedemon is using with R#E#D, where he's made 3 separate mods: the base RED Mod, a RED for MoarUnits extension, and an RED for Polish DLC extension. For the extensions, to use the MoarUnits one as a an example, he is adding the base RED mod and the MoarUnits mod to <Dependencies> in .modinfo and adding MoarUnits.dep's GUID to the extensions <RequiredGameArtIDs> like so:

Code:

<RequiredGameArtIDs>

       <Element>

           <name text="MoarUnits"/>

           <id text="8342b98d-80c7-4002-87bb-419646bd9b54"/>

       </Element>

   </RequiredGameArtIDs>

It's messy and ugly and requires a separate extension mod for each additional compatibility. Although note, this is only necessary in order to apply the R#E#D. look to the additional units in MoarUnits and the DLC--if you're just adding a new unit and an artdef for it, you won't have to worry about any of this (though @Gedemon will if your mod becomes popular).

下载列表

点击进入下载列表

回复区

昵称:

邮箱:

内容:

查看更多回复...