Mod instruction

The mod instruction is designed to control the inclusion or exclusion of blocks of descriptions and settings based on the global mode of operation. This feature is especially useful in cases where different game modes require different configurations.

Global modes in the Men of War II game

Mode
Description

Multiplayer (mp)

This mode activates configurations that are specifically tailored for multiplayer gameplay.

Everything else

This includes single-player missions and the game editor mode

Template for a mod instruction

Template for the mod instruction

(mod mode_name {code})

mode_name specifies the mode for which the enclosed code block {code} should be active

Example
(mod mp {code})

If the game sets the mp modifier (indicating that the player has launched multiplayer mode), then the {code} block is inserted into the SDL.

For instance, if the mode is set to mp, the code block will only be executed in multiplayer mode.

The mod instruction can also be used in a prohibitive format, which means you can specify that certain code blocks should only be excluded in certain modes rather than included. This is useful for disabling specific features or settings in a particular mode without having to explicitly include them in all other modes.

Example
(mod not_mp {code})

This structured approach using the mod instruction allows developers to neatly organize their code and ensure that the correct settings and features are active based on the game mode, enhancing both maintainability and gameplay experience.

If you have difficulties understanding the terminology and the essence of the instruction description, please refer to the article Basic knowledge about configuration files.

Additionally, you can explore other types of instructions.

Last updated