Advanced package configuration

Creating balanced mods often requires more complex settings of the mod package. Settings for the package are specified in the .info file.

Dependency configuration

You can configure dependencies on existing packages using the dependency block.

The mod will use the original game's resources if the "Men of War II, main package" ID is specified in the dependency block. Otherwise, Men of War II game resources will not be included in the mod.

If a mod is dependent on another mod, a dependency block must be added specifying the ID of the required mod. Multiple dependency blocks can be included to determine the sequence of package connections. Should a mod require several other mods to function properly, a sequence of dependency blocks listing the necessary mod IDs in the order of their connection should be created.

Resources are loaded and modified in the order specified by these blocks in the .info file. The content and functionality of the target files depend on the correct order of these dependency blocks

Any discrepancies in the order can result in errors or conflicts during resource loading

Example of setting the sequence for connecting packages
{id "cc507783-2143-4598-99de-237a5ea5e621"}
{name "Fun games"}
{order 0}
{dependency "02f8e8f9-91d9-45e0-8ee6-dc56adae4763"}; main package
{default_disabled}
{ dependency “Id[A]”}
{ dependency “Id[D]”}
{ dependency “Id[C]”}
{ dependency “Id[B]”}
{author "Created by username, at Mon Apr 17 16:39:49 2024"}

The package "Fun games" uses the main package as its base resources and requires the activation of packages A, B, C, and D. The sequence of dependency blocks sets the order in which these packages must be loaded. This ensures that each package functions correctly.

Resource exclusion

Parameter
Description

delete_global

Specifies a list of resources that should be ignored by the game when activating resources from the global folder.

delete_scene

Specifies a list of resources that should be ignored by the game when activating resources from the scene folder.

Enforced resource activation

Parameter
Description

always_activate_scene

Always activates the 'scene' section of the package if the 'global' section of this package is active. By default, the 'scene' section is activated if a map located in the 'global' section of this package is loaded.

always_activate_global

Indicates that this package changes global game settings. If a package with the always_activate_global parameter is enabled in the game, this fact is always noted in the list when creating a host, in saving the game, and similar instances.

Package compatibility checks

Parameter
Description

incompatible <package id>

Used to specify the IDs of packages that are incompatible with this package. The game will disable any package with the specified ID when this package is activated

min_core_version <version>

The minimum game version with which the package is compatible. If this parameter is not specified, the corresponding check is absent

max_core_version <version>

The maximum game version with which the package is compatible. If this parameter is not specified, the corresponding check is absent

hash

The hash parameter value allows for pre-determining that the package content is the same among different users and on the server when playing together. The hash parameter value is automatically updated when the package is published in the Workshop

client_only

The package content is available only on the client, it is not loaded on the server and does not affect gameplay

obsolete

Allows hiding package resources (entities and textures) in the lists of available resources in the editor

Example .info content for a balanced mod
{id "cc507783-2143-4598-99de-237a5ea5e621"}
{name "Fun games"}
{dependency "02f8e8f9-91d9-45e0-8ee6-dc56adae4763"} ; main package
{dependency "b86c6020-9b25-4659-bcdf-53b12715a0a1"} ; Good mod
{dependency "aa6c6408-9b43-4562-bcdf-53b12715a97d"} ; God mod
{delete_global "/map/single/2" "/video/menu.avi"}
{delete_scene "/entity/service/flag"}
{always_activate_scene}
{always_activate_global}
{author "Created by username, at Mon Apr 17 16:39:49 2024"}

The mod operates on the base of the original game. The mod is compatible with the game version not lower than 1.302. Requires the sequential connection of the Good and God mods. Not compatible with the Realism mod. The game will ignore resources from the folder "/map/single/2" and the file "/video/menu.avi" in the global section. The game will ignore the service object "/entity/service/flag" from the scene section upon loading. Contains a hash for resource identity verification.

Last updated